Page 1 of 1

Telephonepole Electricution by a switch

Posted: Thu Mar 04, 2004 9:02 pm
by Slider_V
I was needing some help in scripting a trigger that when activated by a switch it would hurt a player if on some telephone wires.

my current code is

Code: Select all

wireelectricution:
while ((level.rightwire != -1) && (level.righttime != 5)) 
 {
	$alliesright_wire volumedamage 10
	level.righttime = level.righttime + 1
	wait 1
}
if (level.righttime == 5 )
{
 level.rightwire = -1
 level.righttime = 0
}
end

alliesright:
$alliesright_trigger waittill trigger
$alliesright_switch anim turnon
$alliesright_switch playsound alarm_switch
wait 0.5
level.rightwire = 1
goto alliesright

end
all thats in my map scr file and is properly called by

Code: Select all

    level waittill prespawn
thread alliesright
thread wireelectricution
Any help with this would be gratly appreciated.

Posted: Thu Mar 04, 2004 10:04 pm
by Axion
Hi, and welcome to .Map!

Here is a link to a map with electricity in it- It might prove to be of some use.

http://www.carbongraphx.com/mohaa/maps/electromap.zip

Posted: Thu Mar 04, 2004 11:13 pm
by bdbodger
I guess what you are trying to do is make the wire live for 5 seconds when the trigger is triggered ? And you are useing the animate_equipment_electric-switch-nopulse
If so try this

wireelectricution:
While(1) //dosen't end
{
$alliesright_trigger waittill trigger
$alliesright_switch anim turn
wait .2 // maybe adjust this
$alliesright_switch anim on
$alliesright_switch loopsound alarm_switch

for(local.i=1;local.i<= 5;local.i++) // loops 5 times
{
$alliesright_wire volumedamage 10
wait 1
}
$alliesright_switch stoploopsound
$alliesright_switch anim off
} // loops back here but I add end anyway
end

Posted: Sat Mar 06, 2004 10:18 pm
by Slider_V
Worked great! :D Thaks for your help bdbodger.

BTW.
I also had a question on Player shootable triggers.
I have a Trapdoor that opens only when shot. but the problem comes when you shoot it multiple times.. it spins the 90 degrees again instead of waiting to close. The more I shoot it the more it Rotates.

Maybee I should start another thread?

Posted: Sat Mar 06, 2004 11:46 pm
by bdbodger
You can try putting a line in your thread to make the trigger nottriggerable until the door closes .

doorthread:
$mytrigger nottriggerable
....
....
....
$mytrigger triggerable
end

or setting a value
level.dooropener = 0

doorthread:

if(level.dooropener == 0 )
{
level.dooropener =1
do door stuff
....
level.dooropener = 0
}
end

Posted: Sun Mar 07, 2004 1:56 am
by Slider_V
Excelent!.. work fine.

Before I was putting it for the wrong trigger.

Thx again.