Can somebody examine this COG, I put it in JED, did all the usual stuff, tested it and it fired at itself twice before crashing the game:
symbols
message crossed
#The trigger the computer is meant to look for
surface adjoin0 id=1
surface adjoin1 id=1
surface adjoin2 id=1
surface adjoin3 id=1
#These are the surfaces which trigger the laserprojector
thing laserprojector
#Well duh...The laser projector
template laser=+stlaser
#The laser projectile itself
thing activator
#The person that crossed the adjoin
message pulse
#A pulse function to generate a loading time for the projector (I'm not evil enough to just make it kill them outright)
flex pulselength=0.5
#You can change this, but it is the best for the purpose.
flex damagedone=30
#This is the amount of damage each shot does, be as sadistic as you please
sound fire=trprsht1.wav
#The firing sound
end
code
crossed:
if(GetSenderID() == 1) {
#If it's one of the adjoins above
activator = GetSourceRef();
#Make the activator the person that activated the projector
Setpulse(pulselength);
#Starts the pulse
pulse:
FireProjectile(laserprojector, laser, fire, , actor, 0, , , 180, 1);
#Fires the laser at the activator
DamageThing(activator, damagedone);
#Damages the activator of the projector by the above flex
end
------------------
You were right about one thing master, the negotiators were short
symbols
message crossed
#The trigger the computer is meant to look for
surface adjoin0 id=1
surface adjoin1 id=1
surface adjoin2 id=1
surface adjoin3 id=1
#These are the surfaces which trigger the laserprojector
thing laserprojector
#Well duh...The laser projector
template laser=+stlaser
#The laser projectile itself
thing activator
#The person that crossed the adjoin
message pulse
#A pulse function to generate a loading time for the projector (I'm not evil enough to just make it kill them outright)
flex pulselength=0.5
#You can change this, but it is the best for the purpose.
flex damagedone=30
#This is the amount of damage each shot does, be as sadistic as you please
sound fire=trprsht1.wav
#The firing sound
end
code
crossed:
if(GetSenderID() == 1) {
#If it's one of the adjoins above
activator = GetSourceRef();
#Make the activator the person that activated the projector
Setpulse(pulselength);
#Starts the pulse
pulse:
FireProjectile(laserprojector, laser, fire, , actor, 0, , , 180, 1);
#Fires the laser at the activator
DamageThing(activator, damagedone);
#Damages the activator of the projector by the above flex
end
------------------
You were right about one thing master, the negotiators were short