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 → Battle cog that has been edited alost and still dont work..
Battle cog that has been edited alost and still dont work..
2001-06-19, 5:40 AM #1
Well its susposed to make it so when you enter a sector randomly after some time it teleports you to a ghost pos and makes 3 troopers appear then once youve killed em all your susposed to teleport back to the same place you were but its not working as of yet... Anyone got any ideas?
Code:
# Advanced Teleportation Cog
# lordvader
# Made for Lt_Greywolf
#
# Edited to try and make it work by: Lt_Greywolf, Uber(HOV),
# This Cog is not supported by LucasArts Entertainment Co.
symbols
thing		player			local
sector		telesec
thing		newpos
flex		delay=500
message		startup
message		entered
message		killed
thing		t1
thing		t2
thing		t3
int		deaths=0		local
int		hasgone=1		local
template	tpl_ghost=ghost		local
thing		theghost		local
end

code
startup:
player=GetLocalPlayerThing();
Return;

entered:
if(hasgone=0)
{
 Sleep(delay);
 theghost=CreateThing(tpl_ghost, player);
 TeleportThing(newpos, player); //if this doesn't work, try switching player and newpos
 hasgone=1;
}
Return;


killed:
if(GetSenderRef()==t1 || GetSenderRef()==t2 || GetSenderRef()==t3)
{
 if(GetSourceRef()==player)
 {
   deaths= deaths+1;
   if(deaths==3)
  {
   TeleportThing(player, theghost);
  }
 }
}
Return;
End


------------------
The only way to live a good life is to act on your emotions.
2001-06-19, 5:54 AM #2
Well thanks to gunny I found out my teleport sectors were backwards but it still dont make troopers [http://forums.massassi.net/html/frown.gif]

------------------
The only way to live a good life is to act on your emotions.
2001-06-19, 5:59 AM #3
Code:
# Advanced Teleportation Cog
# lordvader
# Made for Lt_Greywolf
#
# Edited to try and make it work by: Lt_Greywolf, Uber(HOV),
# This Cog is not supported by LucasArts Entertainment Co.
symbols
thing		player			local
sector		telesec
thing		newpos
flex		delay=3
message		startup
message		entered
message		killed
thing		t1
thing		t2
thing		t3
int		deaths=0		local
int		hasgone=1		local
template	tpl_ghost=ghost		local
thing		theghost		local
end

code
startup:
player=GetLocalPlayerThing();
Return;

entered:
if(hasgone=0)
{
 Sleep(delay);
 theghost=CreateThing(tpl_ghost, player);
 TeleportThing(player, newpos); //if this doesn't work, try switching player and newpos
 hasgone=1;
}
CreateThing(stormtroop, t1);
CreateThing(stormtroop, t2);
CreateThing(stormtroop, t3);
Return;


killed:
if(GetSenderRef()==t1 || GetSenderRef()==t2 || GetSenderRef()==t3)
{
 if(GetSourceRef()==player)
 {
   deaths= deaths+1;
   if(deaths==3)
  {
   TeleportThing(player, theghost);
  }
 }
}
Return;
End

[http://forums.massassi.net/html/smile.gif] New code.

------------------
The only way to live a good life is to act on your emotions.
2001-06-19, 6:14 AM #4
BTW the cog dose not make the troopers appear


------------------
The only way to live a good life is to act on your emotions.
2001-06-19, 6:40 AM #5
Ok im going to get this to work on my own. [http://forums.massassi.net/html/smile.gif]
Code:
# Advanced Teleportation Cog
# lordvader
# Made for Lt_Greywolf
#
# Edited to try and make it work by: Lt_Greywolf, Uber(HOV),
# This Cog is not supported by LucasArts Entertainment Co.
symbols
thing		player			local
sector		telesec
thing		newpos
flex		delay=3
message		startup
message		entered
message		killed
thing		t1
thing		t2
thing		t3
int		deaths=0		local
int		hasgone=0		local
template	tpl_ghost=ghost		local
template        stormtroop=
thing		theghost		local
end

code
startup:
player=GetLocalPlayerThing();
Return;

entered:
if(hasgone=0)
{
 Sleep(delay);
 theghost=CreateThing(tpl_ghost, player);
 TeleportThing(player, newpos); //if this doesn't work, try switching player and newpos
 hasgone=1;
}
CreateThing(stormtroop, t1);
CreateThing(stormtroop, t2);
CreateThing(stormtroop, t3);
Return;


killed:
if(GetSenderRef()==t1 || GetSenderRef()==t2 || GetSenderRef()==t3)
{
 if(GetSourceRef()==player)
 {
   deaths= deaths+1;
   if(deaths==3)
  {
   TeleportThing(player, theghost);
  }
 }
}
Return;
End


------------------
The only way to live a good life is to act on your emotions.
2001-06-19, 6:42 AM #6
BTW the only part left is to make it teleport you back to the first ghost pos where you were.

------------------
The only way to live a good life is to act on your emotions.
2001-06-19, 8:50 PM #7
Make sure that the ghost exicts in the level , try replacing it with like a box template to see if it works.

BTW you may want to finish this line of code in the symbols section ... template stormtroop=

↑ Up to the top!