Okay, Jipe, here's the cog in its entirety. What I'm trying to do is get the cog, whenever a weapon is fired, to shut down.
I've tried lordvader's suggestion, but I can't seem to find the right verb/symbol to use to represent the Force Persuasion cog. I'll keep looking for it, though.
# Jedi Knight Cog Script
#
# FORCE_PERSUASION.COG
#
# FORCEPOWER Script - Persuasion
# Light Side Power
# Bin 26
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing player local
flex mana local
flex cost=3 local
int rank local
sound persuasionSound=ForcePersuas01.WAV local
int channel=-1 local
int iAlignmentPriority=-1 local
int inbubble=0 local
int old local
int new local
message startup
message activated
message pulse
message newplayer
message killed
message selected
message enterbubble
message exitbubble
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
inbubble = 0;
call stop_power;
Return;
# ........................................................................................
activated:
if(inbubble) Return;
if(old == 0)
{
new = 1;
if(!IsInvActivated(player, 26))
{
print("Immersion Activated");
if(GetInv(player, 64) != 1) ChangeInv(player, 14, -cost);
// Send a "force disturbance"...
if(!IsMulti())
SendMessageExRadius(GetThingPos(player), cost, 0x4, splash, 26, 0, 0, 0);
SetInvActivated(player, 26, 1);
PlayMode(player, 24);
// Play activation sound
PlaySoundThing(persuasionSound, player, 1.0, -1, -1, 0x80);
rank = GetInv(player, 26);
// Set player invisible to AI
SetActorFlags(player, 0x80);
//Change Alignment Priority
{
if (iAlignmentPriority != -1)
{
aiRemoveAlignmentPriority(iAlignmentPriority);
iAlignmentPriority = -1;
}
iAlignmentPriority = aiAddAlignmentPriority(0.0, 1);
}
// Set player "invisible" to real players
if(rank == 1) jkSetPersuasionInfo(player, 14, 22);
else if(rank == 2) jkSetPersuasionInfo(player, 11, 19);
else if(rank == 3) jkSetPersuasionInfo(player, 8, 16);
else if(rank == 4) jkSetPersuasionInfo(player, 5, 13);
SetThingCurGeoMode(player, 0);
jkSetFlags(player, 0x20);
SetPulse(0.5);
}
}
Return;
# ........................................................................................
pulse:
if(GetThingHealth(player) < 1) call stop_power;
mana = GetInv(player, 14);
if(GetInv(player, 64) != 1) ChangeInv(player, 14, -cost);
if(mana <= 0)
{
call stop_power;
}
Return;
# ........................................................................................
selected:
old = new;
if(old == 1)
{
call stop_power;
}
Return;
# ........................................................................................
killed:
if(GetSenderRef() != player) Return;
newplayer:
call stop_power;
Return;
# ........................................................................................
enterbubble:
inbubble = 1;
call stop_power;
Return;
# ........................................................................................
exitbubble:
inbubble = 0;
Return;
# ........................................................................................
stop_power:
print("Immersion Deactivated");
new = 0;
SetPulse(0);
KillTimerEx(1);
if(channel != -1)
{
StopSound(channel, 0.1);
channel = -1;
}
SetInvActivated(player, 26, 0);
ClearActorFlags(player, 0x80);
SetThingCurGeoMode(player, GetThingGeoMode(player));
jkClearFlags(player, 0x20);
{
if (iAlignmentPriority != -1)
{
aiRemoveAlignmentPriority(iAlignmentPriority);
iAlignmentPriority = -1;
}
}
Return;
end
------------------
I just love that part of the Jedi Code that says, "There is no ignorance - only knowledge". If that's the case, then what am I doing on this Force-blasted message board??!!
I just love that part of the Jedi Code that says, "There is no ignorance - only knowledge". If that's the case, then what am I doing on this Force-blasted message board??!!