when using the symbol "damaged" in a COG on a surface, for some reason it only reacts when i hit the surface with the light saber, and even then i have to hit the surface a few times before it does anything. here's the cog if you want to take a look. any suggestions as to what the problem is?
# Jedi Knight Cog Script
symbols
surface cond1 linkid=4
surface cond2 linkid=5
surface switch1 linkid=1
surface switch2 linkid=2
surface switch3 linkid=3
thing player local
sound elec=00electrexplo03.wav
sound objective=accomplish1.wav
template boom=+conc_exp
int done1=0 local
int done2=0 local
int power1=1 local
int power2=1 local
int power3=1 local
message activated
message damaged
end
code
activated:
if (GetSenderId() == 4 || getsenderid() == 5)
{
print("I should probably cut the power to these things before I do anything to them");
}
else if (GetSenderId() == 1)
{
if (power1 == 1)
{
power1 = 0;
print("power 1 off");
}
else
{
power1 = 1;
}
}
else if (GetSenderId() == 2)
{
if (power2 == 1)
{
power2 = 0;
print("power 2 off");
}
else
{
power2 = 1;
}
}
else if (GetSenderId() == 3)
{
if (power3 == 1)
{
power3 = 0;
print("power 3 off");
}
else
{
power3 = 1;
}
}
return;
damaged:
if (GetSenderId() == 1 && done1 == 0)
{
done1 = 1;
setwallcel(cond1, 1);
PlaySoundPos(elec, SurfaceCenter(cond1), 1, -1, -1, 0);
if (power1 == 1 || power3 == 1)
{
player=GetLocalPlayerThing();
CreateThing(boom, player);
CreateThing(boom, player);
}
if(getwallcel(cond2) == 1)
{
sleep(2.0);
print("OBJECTIVE COMPLETE!");
playsoundlocal(objective, 1, 0, 132);
player=GetLocalPlayerThing();
SetGoalFlags(player, 3, 0x2);
}
}
else if (GetSenderId() == 2 && done2 == 0)
{
done2 = 1;
setwallcel(cond2, 1);
PlaySoundPos(elec, SurfaceCenter(cond2), 1, -1, -1, 0);
if (power2 == 1 || power3 == 1)
{
player=GetLocalPlayerThing();
CreateThing(boom, player);
CreateThing(boom, player);
}
if(getwallcel(cond1) == 1)
{
sleep(2.0);
print("OBJECTIVE COMPLETE!");
playsoundlocal(objective, 1, 0, 132);
player=GetLocalPlayerThing();
SetGoalFlags(player, 3, 0x2);
}
}
return;
end
------------------
www.lastgreatwar.com
# Jedi Knight Cog Script
symbols
surface cond1 linkid=4
surface cond2 linkid=5
surface switch1 linkid=1
surface switch2 linkid=2
surface switch3 linkid=3
thing player local
sound elec=00electrexplo03.wav
sound objective=accomplish1.wav
template boom=+conc_exp
int done1=0 local
int done2=0 local
int power1=1 local
int power2=1 local
int power3=1 local
message activated
message damaged
end
code
activated:
if (GetSenderId() == 4 || getsenderid() == 5)
{
print("I should probably cut the power to these things before I do anything to them");
}
else if (GetSenderId() == 1)
{
if (power1 == 1)
{
power1 = 0;
print("power 1 off");
}
else
{
power1 = 1;
}
}
else if (GetSenderId() == 2)
{
if (power2 == 1)
{
power2 = 0;
print("power 2 off");
}
else
{
power2 = 1;
}
}
else if (GetSenderId() == 3)
{
if (power3 == 1)
{
power3 = 0;
print("power 3 off");
}
else
{
power3 = 1;
}
}
return;
damaged:
if (GetSenderId() == 1 && done1 == 0)
{
done1 = 1;
setwallcel(cond1, 1);
PlaySoundPos(elec, SurfaceCenter(cond1), 1, -1, -1, 0);
if (power1 == 1 || power3 == 1)
{
player=GetLocalPlayerThing();
CreateThing(boom, player);
CreateThing(boom, player);
}
if(getwallcel(cond2) == 1)
{
sleep(2.0);
print("OBJECTIVE COMPLETE!");
playsoundlocal(objective, 1, 0, 132);
player=GetLocalPlayerThing();
SetGoalFlags(player, 3, 0x2);
}
}
else if (GetSenderId() == 2 && done2 == 0)
{
done2 = 1;
setwallcel(cond2, 1);
PlaySoundPos(elec, SurfaceCenter(cond2), 1, -1, -1, 0);
if (power2 == 1 || power3 == 1)
{
player=GetLocalPlayerThing();
CreateThing(boom, player);
CreateThing(boom, player);
}
if(getwallcel(cond1) == 1)
{
sleep(2.0);
print("OBJECTIVE COMPLETE!");
playsoundlocal(objective, 1, 0, 132);
player=GetLocalPlayerThing();
SetGoalFlags(player, 3, 0x2);
}
}
return;
end
------------------
www.lastgreatwar.com