Telephonepole Electricution by a switch

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Slider_V
Private
Posts: 3
Joined: Thu Mar 04, 2004 9:00 pm

Telephonepole Electricution by a switch

Post 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.
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post 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
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
Slider_V
Private
Posts: 3
Joined: Thu Mar 04, 2004 9:00 pm

Post 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?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
Slider_V
Private
Posts: 3
Joined: Thu Mar 04, 2004 9:00 pm

Post by Slider_V »

Excelent!.. work fine.

Before I was putting it for the wrong trigger.

Thx again.
Post Reply