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):
Here's the problem. It's the cog which destroys the parachute. It is linked from the projectile in static.jkl:
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?
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?