Ok, I've been editing jk for 1,5 years now, and frankly I still suck with cogging...
This time is the first time I tried making a if, else statement, so that's probably where I went wrong.
The idea:
Teleport, but after a button is shot it teleports to a different location.
The preperation:
We take s5l4_teleport.cog as a base.
The work:
We *try to make it do the things we want it to do*. I came up with this, which *obviously * doesn't work. (I'm surprisingly good in making non functional cogs ) (Syntax checker keeps silent, as usual...)
This time is the first time I tried making a if, else statement, so that's probably where I went wrong.
The idea:
Teleport, but after a button is shot it teleports to a different location.
The preperation:
We take s5l4_teleport.cog as a base.
The work:
We *try to make it do the things we want it to do*. I came up with this, which *obviously * doesn't work. (I'm surprisingly good in making non functional cogs ) (Syntax checker keeps silent, as usual...)
Code:
# Jedi Knight Missions Cog # # [TL] # # (C) 1997 LucasArts Entertainment Co. All Rights Reserved #============================================================================ symbols message entered message startup message damaged sector enter0 linkid=1 sector enter1 linkid=1 sector enter2 linkid=1 sector enter3 linkid=1 sector enter4 linkid=1 sector enter5 linkid=1 int player local int dummy local surface button sound teleportsnd=sithtmplloop.wav thing newspot2 thing newspot end #============================================================================ code entered: player=GetLocalPlayerThing(); StopThing(player); AddDynamicAdd(player, .612, .439, .98); If (GetWallCel(button)= 0) Sleep(0.25); AddDynamicAdd(player, 255, 255, 255); dummy = PlaySoundLocal(teleportsnd, 1.0, 0, 0); TeleportThing(player, newspot); Else TeleportThing(player, newspot2); return; damaged: if (GetSenderRef() == button); SetWallCel(button, 1); end