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 → Gun Removal
Gun Removal
2007-03-10, 10:14 AM #1
I have this cog here, that takes all of the players weapons when the player crosses an adjoin. but there are 2 problems:
1: If one player crosses the adjoin, all other players lose thier weapons too
2: If the player gets his lightsaber taken away, it retracts, but continues to hum

any help would be appreciated, or better yet, a complete re-write of the cog.

Code:

Flags=0x240

symbols

int        player        local

message        crossed

surface        adjoin

int        Gun1            local
int        Gun2            local
int        Gun3            local
int        Gun4            local
int        Gun5            local
int        Gun6            local
int        Gun7            local
int        Gun8            local
int        Gun9            local
int        Gun10            local


message    StartUp

end

# ======

code

StartUp:

Player = GetLocalPlayerThing();

return;

# .........

crossed:

//Print("No guns for you.");

SetActorFlags(player, 0x8);

Gun1 = GetInv(player, 1);
Gun2 = GetInv(player, 2);
Gun3 = GetInv(player, 3);
Gun4 = GetInv(player, 4);
Gun5 = GetInv(player, 5);
Gun6 = GetInv(player, 6);
Gun7 = GetInv(player, 7);
Gun8 = GetInv(player, 8);
Gun9 = GetInv(player, 9);
Gun10 = GetInv(player, 10);

SetInv(player, 1, 0);
SetInv(player, 2, 0);
SetInv(player, 3, 0);
SetInv(player, 4, 0);
SetInv(player, 5, 0);
SetInv(player, 6, 0);
SetInv(player, 7, 0);
SetInv(player, 8, 0);
SetInv(player, 9, 0);
SetInv(player, 10, 0);

If(GetCurWeapon(player) == 10) jkSetFlags(player, 0x8);

SetCurWeapon(player, 0);

return;

end
Baby dragons can't figure out humans- If they didn't want to be eaten, why were they made of meat and treasure?
2007-03-10, 3:43 PM #2
To fix the cog so only the player that crosses the adjoin loses weapons, find this line ... :
Code:
crossed:

... and place under it, this line:
Code:
if (GetSourceRef() != player) return;

The line checks that the player that caused the crossed message is the same as the local player, and returns to engine if not the same.


To fix the problem with the saber hum, find these lines ... :
Code:
If(GetCurWeapon(player) == 10) jkSetFlags(player, 0x8);
SetCurWeapon(player, 0);

... and place above them, this line:
Code:
SelectWeapon(player, 1);

The line switches the player to fists, which should turn off the saber hum. If you really want to keep the fists instead of what you have now, then delete the two lines mentioned and keep the one just inserted.


Please post again to let us know if this works or not.

:)

↑ Up to the top!