Simple cargo lift cog I wrote, as the cogs in the JK game itself are too complicated to be used in general situations. I figured I'd post it here just in case anyone wants to use it. Just remember to give me credit.
Creates cargo crates (or whatever other objects you might want to use) at a ghost position at user defined intervals, sends the crates to the frame 1 of that ghost position, and destroys them. Also plays a sound that accompanies the crates. Can be used as either a vertical cargo lift, or in conjunction with a cog that scrolls textures as a conveyor belt transporting crates horizontally.
------------------
And everything under the sun is in tune, but the sun is eclipsed by the moon...
DSettahr's Homepage | Cantina Cloud | Rally NY
[This message has been edited by DSettahr (edited April 13, 2004).]
Creates cargo crates (or whatever other objects you might want to use) at a ghost position at user defined intervals, sends the crates to the frame 1 of that ghost position, and destroys them. Also plays a sound that accompanies the crates. Can be used as either a vertical cargo lift, or in conjunction with a cog that scrolls textures as a conveyor belt transporting crates horizontally.
Code:
# Jedi Knight Cog Script # # DS_cargolift.cog # # Cog that controls a simple cargo lift. Crates are created at a ghost point at # a user defined time interval, sent to frame 1 of the ghost point at a user defined # speed, and then destroyed. The ghost object used must have two frames, frame 0 being # the same as the ghost objects position, and frame 1 being the target that the crates # are sent too. # # [DSettahr] # # (C) 2004 by DSettahr. You may use or modify this cog as you like as long as you # provide credit to me. symbols message startup message pulse message arrived thing start template cratetemplate=crate4_6 flex interval=15.0 flex speed=2.0 thing crate local sound liftsnd=00ConveyorAmb02.wav local int curFrame local int soundchannel0=-1 local end code startup: //Set the pulse rate from the user defined interval SetPulse( interval ); return; pulse: //Create the crate at the ghost object crate = CreateThing( cratetemplate, start ); CaptureThing( crate ); //Play the lift sound soundchannel0 = PlaySoundThing( liftsnd, crate, 2, -1, -1, 0x81 ); //Send the crate on its path to frame 1 MoveToFrame( crate, 1, speed ); return; arrived: //Get the frame of the crate curFrame = GetCurFrame( GetSenderRef() ); if ( curFrame == 1 ) { //Destroy the crate DestroyThing( GetSenderRef() ); } return; end
------------------
And everything under the sun is in tune, but the sun is eclipsed by the moon...
DSettahr's Homepage | Cantina Cloud | Rally NY
[This message has been edited by DSettahr (edited April 13, 2004).]