# Jedi Knight Cog Script Generated by CogWriter ver 0.1 beta 1/21/98 10:17:40 AM # # jed_door.cog [ver 1.0a] # # Generic basic door activated by player # This cog will open the door and close it again after the WaitTime specified times out.. # Controls 1 door. # # ......Thing Settings # # Set ThingFlags to 0x408 # Set NumFrames to 2 # Two frames are used # # [DL] Jan/98 # # This cog script is Not supported by LucasArts Entertainment Company symbols message activated message arrived message blocked message startup message timer thing door linkid=0 # set your door Thing number to this symbol # mask=0x405 flex Light=0.5 local # extra light value to brighten door sector flex Speed=8.0 # speed doors will operate at flex Wait=2.0 # wait time before door closes again (seconds) int DSector local end # ======================================================================================== code startup: DSector = GetThingSector(door); SetSectorAdjoins(DSector ,0); // remove the adjoins to speed up frame rate SetSectorLight(DSector, Light, 0.0); // add some light to door sector Return; # ........................................................................................ activated: if(IsThingMoving(door)) Return; if(GetCurFrame(door) !=0) Return; MoveToFrame(door,1, Speed); SetSectorAdjoins(DSector,1); Return; # ........................................................................................ arrived: if(IsThingMoving(door)) Return; if(GetCurFrame(door) ==1) { SetTimer(Wait); Return; } else { SetSectorAdjoins(DSector, 1); Return; } # ........................................................................................ blocked: MoveToFrame(door, 1 - GetGoalFrame(door), Speed); Return; # ........................................................................................ timer: MoveToFrame(door,0, Speed); Return; end