I need help with this projectile stuff I'm going to use later in my cliffhanger cog. The main cog right now is used in the test level. The other cog is the cog attached to the projectile.
^ Main Cog
This is the projectile cog:
What the problem is, is that the ball cog should report the last known position of the ball 3do thing before it's destroyed, then send it to the main cog for other uses. The problem is, it doesn't. And I don't know why.
Any help would be great!
Code:
# Jedi Knight COG Script # # Script.COG # # Created by Emon. E-Mail: ejm_emon@hotmail.com - Zone: EJM_Emon - ICQ: 35960628 # Feel free to use this COG as long as credit is given in the readme file. # # Description # # # This COG is not supported by LucasArts Entertainment Co. flags=0x240 symbols thing Player local thing BallA local thing BallB local thing Ghost local template Ball=+cliffjkball1 local template Ghost_Pos=+cliffjkghost local sound FireSound=nosound.wav local vector BallPos local message startup message pulse message user0 end # ======================================================================================== code startup: Player = GetLocalPlayerThing(); SetPulse(.1); Return; pulse: If(GetAttachFlags(Player) == 0) { Ghost = CreateThing(Ghost_Pos, Player); SetThingLook(Ghost, VectorZ(GetThingLVec(Player))); BallA = FireProjectile(Ghost, Ball, FireSound, -1, '0.0 0.2 0.0', '0 0 0', 9999999999, -1, -1, -1); DestroyThing(Ghost); } Return; user0: PrintVector(GetParam(0)); Return; end
^ Main Cog
This is the projectile cog:
Code:
# Jedi Knight COG Script # # Script.COG # # Created by Emon. E-Mail: ejm_emon@hotmail.com - Zone: EJM_Emon - ICQ: 35960628 # Feel free to use this COG as long as credit is given in the readme file. # # Description # # # This COG is not supported by LucasArts Entertainment Co. //flags=0x240 symbols thing Ball local vector BallPos=0 local vector BallPosPulse local cog MainCog=cliffjk.cog local message pulse message removed message created end # ======================================================================================== code pulse: BallPosPulse = GetThingPos(Ball); Return; removed: SetPulse(0); BallPos = BallPosPulse; SendMessageEx(MainCog, user0, BallPos, 0, 0, 0); Return; created: Ball = GetSenderRef(); SetPulse(.001); Return; end
What the problem is, is that the ball cog should report the last known position of the ball 3do thing before it's destroyed, then send it to the main cog for other uses. The problem is, it doesn't. And I don't know why.
Any help would be great!
Bassoon, n. A brazen instrument into which a fool blows out his brains.