Page 1 of 1
Training level
Posted: Wed Nov 01, 2006 9:01 pm
by *GCC*Nigel
God help me, I actually have to get into scripting...
Is there a way to script a target to fall over when shot in the center, then pop up again when a lever is hit?
Posted: Fri Dec 15, 2006 2:53 pm
by Devil_Dog
Try makeing it a rotating door that opens down when shot(i think you would set the health), and closes up with a trigger near the lever.
Posted: Fri Dec 15, 2006 8:51 pm
by lizardkid
devildog's on the right track, but you really need a script. make a door that rotates DOWN (put the origin at the bottom of the target and then set the angle to the direction it should fall), put a trigger in front of it, give it a setthread of killTarget, and put this in your script.
Code: Select all
killTarget:
$target doopen
$targetTrigger nottriggerable
end
then, on your lever put a setthread and do this
Code: Select all
lever:
$target doclose
$targetTrigger triggerable
end
this is off the top of my head, not totally sure doopen and doclose are correct, it's what g_allclasses says but i'm still not sure. in any event that's the framework you need to make it do what you described.
Posted: Sat Dec 16, 2006 12:05 pm
by bdbodger
You can't make a door rotate down . Setting the angle -2 will make a func_door slide down and -1 will make it slide up but for a rotateing door it will only open and close on a yaw angle . You will have to do it by script . Make your door as normal with an origin brush at the bottom then with both selected make it a script_object . Put a trigger_multiple in front of it where you want it to be shot and have the trigger target your target . Set the projectiles spawnflag checkbox it should then say spawnflags 16 . For the lever you could use an amimate/equipment/trainswitch or amimate/equipment/trainswitch_pulse . Place the switch and put a trigger_use around it . Have the trigger_use target the trainswitch . For the scripting part try this . I will use the targetnames $target_trigger for the trigger multiple and $switch_trigger for the trigger use .
target_down:
$target_trigger.down = 0
$target_trigger time 1
while(1)
{
$target_trigger waittill trigger
if($target_trigger.down = 0)
{
$($target_trigger.target) rotatedownto -90
$($target_trigger.target) waitmove
$target_trigger.down = 1
}
}
end
target_switch:
while(1)
{
$switch_trigger waittill trigger
if($target_trigger.down = 1)
{
$($switch_trigger.target) anim move
$($target_trigger.target) rotateupto 0
$($target_trigger.target) waitmove
$target_trigger.down = 0
}
}
end
Posted: Sat Dec 16, 2006 2:29 pm
by k47a
bdbodger wrote:You can't make a door rotate down
cant you use the 'stormdoor' kind of door? (check Tom's door map for stormdoor)
Posted: Sun Dec 17, 2006 2:53 am
by bdbodger
The storm door was scripted . You can't make a func_rotating door rotate down but you can scirpt a script_object to do that .
Posted: Sun Dec 17, 2006 3:31 am
by tltrude
bdbodger is right, function type doors will not rotate up and down.
You'll probably need to spawn a new trigger in the script after the trigger_multiple is killed.
Posted: Sun Dec 17, 2006 8:46 am
by bdbodger
If you don't give the trigger multiple a health setting it shouldn't be killed it is only when you give it health that it can be killed .