Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Error when teleporting
Error when teleporting
2003-05-17, 11:36 AM #1
<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.
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);
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.
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;
end

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.
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;
end

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).]
Edward's Cognative Hazards
2003-05-17, 12:17 PM #2
something i usually do when teleporting a thing is stop it right before the teleport.
like this:
Code:
StopThing(player);
TeleportThing(player, destination);

but i dont know if its something you have to do when teleporting.

one thing i noticed about your stargate cog is that it is missing the 'return;'
at the end of the 'startup' section,
the 'entered' section,
the 'crossed' section,
and the 'timer' section.
might wanna try fixing that, if you didnt do it on purpose.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 17, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-05-17, 1:41 PM #3
Hey! I tried your suggestion, putting StopThing before TeleportThing. Guess what! I didn't go any where! I didn't teleport! With the Star Gate, I heard a splash (simply because the ride has water flagged sectors) and I went nowhere! AND when I tried to go backwards into the gate, I got turned around.
NOW WHAT?

/Edward

Another famous last words: Smart Girl...
Jurasic Park

[This message has been edited by Edward (edited May 17, 2003).]
Edward's Cognative Hazards
2003-05-17, 1:58 PM #4
Oh dear... I've figured it out! There is something very wrong with the destinations... I think they are not realy there. Game not regestering them.

More famous last words: Woops...

[This message has been edited by Edward (edited May 17, 2003).]
Edward's Cognative Hazards
2003-05-17, 9:47 PM #5
you are not supposed to be able to go back through a stargate without reactivating.

------------------
your curiosity will get the better of YOU one day.

alpha1: winner of the 2003 tfti award.

http://members.shaw.ca/orichan/images/MyArt/Guards.jpg

fear teh evil point finger attack. yu-gi-oh Dub.
Snail racing: (500 posts per line)------@%
2003-05-18, 6:24 AM #6
NO no... Not back to base, but Backwards! You know, not head first but butt first!

Well, How shall I do so that the object is registered by the game as IN a sector?
I'll be happy to give anyone a level to experiment on, as long as you don't make it your own level! It is "Eddy Copyright".

/Edward
Edward's Cognative Hazards
2003-05-18, 3:59 PM #7
I usually do this when teleporting:
Code:
StopThing(Player);
Sleep(0.05);
TeleportThing(Player, Destination);
Sleep(0.05);
StopThing(Player);

That stops the thing, adds a delay (so the player can teleport after that), teleports, and stops the thing again after teleporting (to avoid some wierd vector stuff I usually have probs with, like the player moves on his own after teleporting, even if immobilized). That should work. If not, I might take a closer look at the cogs when I get a chance, but I'm a little out of practice. I haven't cogged for about a month! *GASP*

------------------
"The Just shall live by faith." - Galatians 3:11
Catloaf, meet mouseloaf.
My music
2003-05-19, 6:59 AM #8
Quote:
<font face="Verdana, Arial" size="2">
Well, How shall I do so that the object is registered by the game as IN a sector?
[/B]</font>



select the object, then hit A in JED. that "assighens" them to a sector. i can hardly belive you dident knwo that... but then i cant rember where i found it. in a ATAT enermy ZIP i think..

------------------
I am pjb.
Another post......
another moment of my life wasted.....
What do you mean? i dont knwo what i am doing..
at least i made a level.
PJB's JK page's
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-05-19, 7:08 AM #9
YAAAAAAAAAAHHHHHHHHHHHHHOOOOOOOOOOOOOOOO!
DogSRoOL! DOGS ROOL! Oh wait... I own a cat... ANY WAY! THE DELAY HELPED! And I just found an error in my star gate level! Neve saw it because I never rode the rides.

THANKS!
/Edward
Edward's Cognative Hazards
2003-05-19, 9:45 AM #10
um... sure...

*Slowly backs away from Edward*

------------------
"The Just shall live by faith." - Galatians 3:11
Catloaf, meet mouseloaf.
My music
2003-05-19, 10:23 AM #11
"What?" he asked, stroking his black cat in an evil way, and still having a cute face of wonder and curiosity.
Edward's Cognative Hazards
2003-05-19, 11:43 AM #12
*Attacks Edward's cat and devours it whole, licking his fingers afterwards*
"Delicious!"

------------------
"The Just shall live by faith." - Galatians 3:11
Catloaf, meet mouseloaf.
My music
2003-05-19, 12:04 PM #13
*GACK*
*Spits out a wad of hair.*

------------------
"The Just shall live by faith." - Galatians 3:11

[This message has been edited by DogSRoOL (edited May 19, 2003).]
Catloaf, meet mouseloaf.
My music
2003-05-19, 9:17 PM #14
"MY CAT!!!" shrieked Edward. "Oh well," he continued, picking out a little stick with a button on it.
Edward's Cognative Hazards
2003-05-20, 9:43 AM #15
-the alternatior MK 1 is here-
-pjb warps back in time and crono ports cat from harms way and replaces it with a cat shapesed bomb jsut as dogsdrool eats it-
-warps back to second bomb is about to go off-

"muaahahahahahahahahahahahahahahahahahha, i see everything-

------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's

-the PJB jedi rule book-
rule one,
Quote:
<font face="Verdana, Arial" size="2">never trust a barman with bad grammar</font>
-kyle katarn in JO

Rule Two,
Quote:
<font face="Verdana, Arial" size="2">Gravity is a crule misstress</font>
-kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-05-20, 11:09 AM #16
This story has been moved to The InterActive Story Board! Who wants to make the continuation?

/Edward
Edward's Cognative Hazards

↑ Up to the top!