Posted by GMS_SLUG on February 08, 1998 at 23:11:25:
I can't get this cog of mine to work... I'm pretty sure I just screwed up on the flags in both the cog and the items.dat.....
# Jedi Knight Cog Script
# item_holoshroud.cog
# Changes player's model to imperial officer and renders him invisible to AI. Runs # off of batteries.
# INVENTORY Script - HoloShroud
# [SLUG]
# ========================================================================================
symbols
thing player
int actorflags
message activated
message pulse
message killed
sound activate=holo-on.wav
sound deactivate=holo-off.wav
end
# ========================================================================================
code
activated:
player = GetSourceRef();
actorFlags = GetActorFlags(player);
if(GetInv(player, 116))
{
if(GetInv(player, 13) < 0)
{
// Print("HoloShroud OFF");
jkPrintUNIString(player, 248);
ClearActorFlags(player, 0x80);
SetInvActivated(Player, 116, 0);
PlaySoundThing(deactivate, player 1.0, -1, -1, 0x80);
SetPulse(0);
}
else
{
if(GetInv(player, 13) > 0)
{
// Print("HoloShroud ON");
jkPrintUNIString(player, 247);
SetInvActivated(player, 116, 0);
// Set player invisible to AI
SetActorFlags(player, 0x80);
// Change player model to officer
SetThingModel(io.3do);
PlaySoundThing(activate, player, 1.0, -1, -1, 0x80);
SetPulse(1.5);
}
else
{
// Print("HoloShroud out of power");
PlaySoundThing(deactivate, player, 1.0, -1, -1, 0x80);
jkprintUNIString(player, 249);
}
}
}
Return;
# ........................................................................................
pulse:
ChangeInv(player, 13, -1);
if(GetInv(player, 13) == 0)
{
// Print("HoloShroud out of power");
jkPrintUNIString(player, 249);
PlaySoundThing(deactivate, player, 1.0, -1, -1, 0x80);
ClearActorFlags(player, 0x80);
SetInvActivated(player, 116, 0);
SetPulse(0);
}
Return;
# ........................................................................................
killed:
player = GetLocalPlayerThing();
if(GetSenderRef() !=player) Return;
if(IsInvActivated(player, 116) == 1)
{
SetPulse(0);
ClearActorFlags(player, 0x80);
SetInvActivated(player, 116, 0);
}
Return;
end
What I'm not sure about is how I've set the actor flags to (player, 0x80).. The rest of the cog looks ok to me.. 'course, I'm not too great with cogs so for all I know the entire cog could be screwed up.... Here's the line I put in the items.dat (I wanted this to be entirely new item, not replace one so I made a new listing for it..)
holoshroud 116 1 1 0x122 cog=item_holoshroud.cog
again, I'm just not sure what to do for flags...