Posted by Dak on March 18, 1998 at 19:51:12:
Howdy.. trying to make a simple teleporter cog should be easy. And I reckon it would be if a person knew anything about cogs or programming in general, but this guy only knows the architecture end of editing. Here is what i came up with by taking apart some other JK cogs... keep in mind i don't know the difference between a { and chicken. any suggestions or rude remarks as to the nature of my poor programming are welcome.
here's one that don't work:
# Simple Teleporter
symbols
sector start desc=start
thing dest nolink,desc=dest
thing dest1 nolink,desc=dest1
int player local
int senderRef=0 local
int sourceRef=0 local
int dummy local
template teleport_particles=+telesparks local
sound teleportsnd=ForceThrow01.WAV local
message entered
# ........................................................................................
entered:
if(GetSenderType() != 5) Return;
player = GetSourceRef();
senderRef = GetSenderRef();
CaptureThing(player);
if(senderRef == start)
{
if(verbose > 2) Print("Teleporter");
}
dest = (dest + 1) % 8;
StopThing(player);
TeleportThing(player, start[dest]);
dummy = CreateThingAtPos(teleport_particles, GetThingSector(player), GetThingPos(player), '0 0 0');
if(play_sounds) dummy = PlaySoundThing(teleportsnd, player, 1.0, -1, -1, 0x80);
Return;
}
end
#----------
Thanks!
-Dak Janson