Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Can't destroy a projectile
Can't destroy a projectile
2001-09-19, 10:47 AM #1
I'm making a parachute mod. You press a hotkey to turn it on, press again to turn it off.

The main cog is like this:

turn on:
SendTrigger(-1, 23, player, 0, 0, 0);

turn off:
SetInvActivated(player, 123, 1);
SetTimerEx(0.3, 3, 0.0, 0.0);

timer:
if (GetSenderId() == 3)
{
SetInvActivated(player, 123, 0);
}

-------------

the client cog is like this (I fixed it so theres no checksum error now):
Code:
if (GetSourceRef() == 23)
      {
   theguy = GetParam(0);
   thechute = FireProjectile(theguy, canada, -1, -1, '0.0 0.0 0.0', '0 0 0', 1.0, 0x0, -1, -1);
   AttachThingToThingEx(thechute, theguy, 0x8);
      }


Here's the problem. It's the cog which destroys the parachute. It is linked from the projectile in static.jkl:
Code:
# Jedi Knight Cog Script
#
# stopchute.cog
#
# Cog for destroying the parachute.
# by ID_Junkguy for Free Fallin' mod

symbols

message      created
message      pulse

end

# ========================================================================================

code

created:
   SetThingpulse(GetSenderRef(), 0.1);
   Return;

pulse:
   if(IsInvActivated(GetThingParent(GetSenderRef()), 123) == 1)
   {
	SetLifeLeft(GetSenderRef(), 0.01);
   }

   return;

end


When I test it by myself in multiplayer, it works. But when theres 2 players, the host's chute doesn't disappear, and the host can't see the other player's chute disappear either (but the other player can see his chute disappear.)

So how do I fix this? I think maybe it has something to do with the GetThingParent... or maybe I should use DestroyThing instead of SetLifeLeft?
2001-09-19, 1:36 PM #2
Just use DestroyThing(); That will always destroy a thing as long as the cog is not local.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-09-20, 12:53 PM #3
i personally use damagething to kill something that is local
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-09-21, 2:33 PM #4
He wants to DESTROY it out of the game. DamageThing() and those health ones won't work unless it's an actor. DamageThing() is the best way to remove something from the game.
Bassoon, n. A brazen instrument into which a fool blows out his brains.

↑ Up to the top!