<original from http://forums.massassi.net/html/Forum2/HTML/010715.html>Hi!
Ever had the problem that when you make a COG to teleport the player from here to there and back again, and all of a sudden, you don't end up in that sector you want to end up in but instead you end up outside the game, falling without getting anywhere?</original>
Now people have asked me to post the COG in this forum so:
In gate, go to wormhole corridor, and out the other end.
Never get to the corridorr.
--------------------------------------------
In, ride a corridorr a bit, end up in another level. Jump back and get spit out from where you jumped in the first place.
Got to my destination but never returned. Sector sound from destination stayed in my speakers.
And yes, I had fun with the Caps lOCK.
--------------------------------------------
Simple go into sector and return to starting point. And no, I didn't set the thing for the player. I did set it for a ghost.
Yes it's big. Could that be the problem? Well, I never get to the sector. But I do end up in that possition! And I can see the objects in the next sector!
Same goes for all other COGs. I teleport, I start "falling" (actually screem as if I was falling), and I turn around, and I can see the sector I just left!
So... Oh and I tried another cut-scene COG where I teleport the player to a hiding place. I was thinking of making a cut-scene where you can skip the cut-scene simply by pressing the Activate key. But nothing happened, so I allowed the external view to view me, and I saw I was in the position of the ghost object, but the sector was gone, but I could still see the cut-scene from a, wierd, interesting, perspective.
And so I say... HELP!!!
/Edward
[This message has been edited by Edward (edited May 17, 2003).]
Ever had the problem that when you make a COG to teleport the player from here to there and back again, and all of a sudden, you don't end up in that sector you want to end up in but instead you end up outside the game, falling without getting anywhere?</original>
Now people have asked me to post the COG in this forum so:
In gate, go to wormhole corridor, and out the other end.
Code:
# This here is a Star Gate Cog!
#
# middle_ring = the ring containing the symbols. It should turn.
# dialer = Activate this to start the StarGate
# start = ghost. The start of the ride
# end = ghost. You apear here when ride is over.
# ending = Enter here and it is all over.
# water1 = Go through here and your in for the ride of your life!
# water2 = the back of the StarGate.
#
# By Edward
symbols
message startup
message entered
message activated
message crossed
message timer
thing middle_ring
thing dialer
thing start
thing endit
sector ending
sound starting
sound exiting
sound off
surface water1
surface water2
thing player local
int on=0 local
flex opentime
flex speed=2
end
##############################################################################################################################################
code
startup:
SetFaceGeoMode(water1,0x0);
SetFaceGeoMode(water2,0x0);
on=0;
player = GetLocalPlayerThing();
MoveToFrame(middle_ring,0,100);
activated:
if(GetSenderRef()!=dialer) Return;
if(on==0)
{
SetFaceGeoMode(water1,0x4);
SetFaceGeoMode(water2,0x4);
on=1;
PlayThingSound(starting,middle_ring,1,1,10,0xC0);
SetTimer(opentime);
MoveToFrame(middle_ring,1,speed);
}
else if(on==1)
{
SetFaceGeoMode(water1,0x0);
SetFaceGeoMode(water2,0x0);
on=0;
PlayThingSound(off,middle_ring,1,1,10,0xC0);
SetTimer(0);
MoveToFrame(middle_ring,0,speed);
}
Return;
entered:
if(GetSenderRef()!=ending) Return;
if(on==0)
{
SetFaceGeoMode(water1,0x4);
SetFaceGeoMode(water2,0x4);
on=1;
PlayThingSound(starting,middle_ring,1,0,1,0xC0);
SetTimer(opentime);
MoveToFrame(middle_ring,1,speed);
}
TeleportThing(player,endit);
PlayThingSound(exeting,middle_ring,0.25,1,10,0xC0);
PlayLocalSound(exeting,1,0,0xC0);
crossed:
if(GetSenderRef()!=water1) Return;
if(on==0) Return;
TeleportThing(player,start);
timer:
SetFaceGeoMode(water1,0x0);
SetFaceGeoMode(water2,0x0);
on=0;
PlayThingSound(off,middle_ring,1,1,10,0xC0);
SetTimer(0);
MoveToFrame(middle_ring,0,speed);
endNever get to the corridorr.
--------------------------------------------
In, ride a corridorr a bit, end up in another level. Jump back and get spit out from where you jumped in the first place.
Code:
# Jump through painting and go to its destination.
#
# By Edward
symbols
message crossed
surface painting
thing destination
thing exiting
surface exit
template sparky
sound poof
sound paf
sound musicy
end
#
code
crossed:
if(GetSenderRef()==painting) {
creatething(sparky,getloacalplayerthing());
PlaySoundThing(poof,gETlOCALpLAYERtHING(),1,-1,25,0x00);
PlaySoundLocal(musicy,1,0,0x00);
sleep(GetSoundLen(musicy));
creatething(sparky,destination);
TeleportThing(GetLocalPlayerThing(),destination);
PlaySoundThing(paf,gETlOCALpLAYERtHING(),1,-1,25,0x00);
} Else if(GetSenderRef()==exit) {
creatething(sparky,getloacalplayerthing());
PlaySoundThing(poof,gETlOCALpLAYERtHING(),1,-1,25,0x00);
creatething(sparky,exiting);
TeleportThing(GetLocalPlayerThing(),exiting);
PlaySoundThing(paf,gETlOCALpLAYERtHING(),1,-1,25,0x00);
}
return;
endGot to my destination but never returned. Sector sound from destination stayed in my speakers.
And yes, I had fun with the Caps lOCK.
--------------------------------------------
Simple go into sector and return to starting point. And no, I didn't set the thing for the player. I did set it for a ghost.
Code:
# All at once
#
# By Edward
symbols
message startup
message crossed
message activated
message pulse
thing elev
thing start
surface exitelev
surface clouds
surface lookup
surface enterelev
thing cloudpos0
thing cloudpos1
thing cloudpos2
thing cloudpos3
thing cloudpos4
thing cloudpos5
thing cloudpos6
thing cloudpos7
thing cloudpos8
template crate0
template crate1
template crate2
template crate3
template crate4
template droid0
template droid1
template droid2
template droid3
template droid4
template droid5
template droid6
template droid7
template st0
template st1
template st2
template st3
template st4
template st5
template ic0
template ic1
template o0
template o1
template reeyee0
template reeyee1
template reeyee2
template reeyee3
template reeyee4
template reeyee5
template reeyee6
template reeyee7
template reeyee8
template tusk0
template tusk1
template tusk2
template tusk3
template civ0
template civ1
template civ2
template civ3
template civ4
template civ5
template civ6
template civ7
template civ8
template civ9
template civ10
template civ11
template civ12
template civ13
template civ14
template civ15
template health
surface ok
thing go
sound drop
sound door
sound beep
material cratecloud
material droidcloud
material stcloud
material iccloud
material ocloud
material reeyeecloud
material tuskencloud
material civcloud
material healthcloud
int i=0 local
int z=0 local
int a=0 local
end
#
code
startup:
sleep(1);
SetSurfaceMat(clouds,cratecloud);
PlaySoundLocal(beep,1,0,0xC0);
print("OK! Here it is, the cloud level.");
sleep(5);
PlaySoundLocal(beep,1,0,0xC0);
print("You are to try to get to the other side of each room,");
sleep(5);
PlaySoundLocal(beep,1,0,0xC0);
print("at the same time as avoiding things that are raining down on you.");
sleep(5);
PlaySoundLocal(beep,1,0,0xC0);
print("When ready to move on, press the switch!");
return;
activated:
If(GetSenderRef()!=ok) return;
MoveToFrame(elev,1,8);
return;
crossed:
If(GetSenderRef()==exitelev)
{
MoveToFrame(elev,0,8);
}
else if(GetSenderRef()==enterelev)
{
z=0;
if(i==8) { TeleportThing(GetLocalPlayerThing(),go); PlaySoundLocal(drop,1,0,0xC0);
SetInv(GetLocalPlayerThing(), 10, 1); SelectWeapon(GetLocalPlayerThing(),10); print("Don't move!"); } Else { TeleportThing(GetLocalPlayerThing(),start); PlaySoundLocal(door,1,0,0xC0); }
i=i+1;
}
else if(GetSenderRef()==lookup)
{
if(z==1) return;
z=1;
a=0;
PlaySoundLocal(beep,1,0,0xC0);
If(i==0)
{
SetSurfaceMat(clouds,cratecloud);
print("^Oh look! A crate cloud!^");
}
Else if(i==1)
{
SetSurfaceMat(clouds,droidcloud);
print("^Oh look! A droid cloud!^");
}
else if(i==2)
{
SetSurfaceMat(clouds,stcloud);
print("^Oh look! A StormTrooper cloud!^");
}
else if(i==3)
{
SetSurfaceMat(clouds,iccloud);
print("^Oh look! A Commando cloud!^");
}
else if(i==4)
{
SetSurfaceMat(clouds,ocloud);
print("^Oh look! An Officer cloud!^");
}
else if(i==5)
{
SetSurfaceMat(clouds,reeyeecloud);
print("^Oh look! A Reeyee cloud!^");
}
else if(i==6)
{
SetSurfaceMat(clouds,tuskencloud);
print("^Oh look! A Tuskan cloud!^");
}
else if(i==7)
{
SetSurfaceMat(clouds,civcloud);
print("^Oh look! A civilian cloud!^");
}
else if(i==8)
{
SetSurfaceMat(clouds,healthcloud);
print("^Oh look! A health cloud!^");
print("It's raining Bacta fluid! :P");
}
sleep(2);
SetPulse(0.1);
}
return;
pulse:
a=a+1;
if(i==0)
{
CreateThing(crate0[rand()*4],cloudpos0[rand()*8]);
}
else if(i==1)
{
CreateThing(droid0[rand()*7],cloudpos0[rand()*8]);
}
else if(i==2)
{
CreateThing(st0[rand()*5],cloudpos0[rand()*8]);
}
else if(i==3)
{
CreateThing(ic0[rand()*2],cloudpos0[rand()*8]);
}
else if(i==4)
{
CreateThing(o0[rand()*2],cloudpos0[rand()*8]);
}
else if(i==5)
{
CreateThing(reeyee0[rand()*8],cloudpos0[rand()*8]);
}
else if(i==6)
{
CreateThing(tusk0[rand()*3],cloudpos0[rand()*8]);
}
else if(i==7)
{
CreateThing(civ0[rand()*15],cloudpos0[rand()*8]);
}
else if(i==8)
{
CreateThing(health,cloudpos0[rand()*8]);
}
if(a>=10)
setpulse(0);
return;
endYes it's big. Could that be the problem? Well, I never get to the sector. But I do end up in that possition! And I can see the objects in the next sector!
Same goes for all other COGs. I teleport, I start "falling" (actually screem as if I was falling), and I turn around, and I can see the sector I just left!
So... Oh and I tried another cut-scene COG where I teleport the player to a hiding place. I was thinking of making a cut-scene where you can skip the cut-scene simply by pressing the Activate key. But nothing happened, so I allowed the external view to view me, and I saw I was in the position of the ghost object, but the sector was gone, but I could still see the cut-scene from a, wierd, interesting, perspective.
And so I say... HELP!!!
/Edward
[This message has been edited by Edward (edited May 17, 2003).]