Hi!
I have a COG here for JK MP, and when I hit one light, all lights with this COG do the same.
Please help me to do so that if I hit one light, only that one will move.
/Edward
I have a COG here for JK MP, and when I hit one light, all lights with this COG do the same.
Code:
# Bump Light
#
# By Edward and help from DSLS_DeathSythe
#===============
flags=0x240
symbols
#---------------
message activated
message damaged
message trigger
message timer
thing light mask=0x408
thing x
keyframe bump
int is_busy=0 local
int bump_trig=1 local
#---------------
end
#===============
code
#---------------
startup:
//-Clear the IS_BUSY...
is_busy = 0;
ThingLight(light, 0, 0.01);
return;
#---------------
activated:
//-Check to see if the cog is busy...
if(is_busy == 1)
return;
//-Make sure it was the light...
if(GetSenderRef() != light)
return;
SendTrigger(-1, bump_trig, 0, 0, 0, 0);
return;
#---------------
damaged:
//-Check to see if the cog is busy...
if(is_busy == 1)
return;
//-Make sure it was the light...
if(GetSenderRef() != light)
return;
SendTrigger(-1, bump_trig, 0, 0, 0, 0);
return;
#---------------
trigger:
//-Make sure that its the right trigger...
if(GetSourceRef() != bump_trig)
return;
//-Check to see if the cog is busy...
if(is_busy == 1)
return;
//-Make the cog busy and set a timer that is as
//-long as the bump keyframe...
is_busy = 1;
SetTimerEx(GetKeyLen(bump), 1, 0, 0);
//-Play key and turn the light on...
PlayKey(light, bump, 1, 0x2);
ThingLight(x, 1, 0.9);
SetTimerEx(1.0, 2, 0, 0);
return;
#---------------
timer:
//-Clear the IS_BUSY...
if(GetSenderID() == 1)
{
is_busy = 0;
return;
}
//-Turn light off...
else
if(GetSenderID() == 2)
ThingLight(x, 0, 1.1);
return;
#===============
endPlease help me to do so that if I hit one light, only that one will move.
/Edward