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?
Training level
Moderator: Moderators
-
*GCC*Nigel
- Second Lieutenant
- Posts: 169
- Joined: Sun Dec 04, 2005 5:13 am
Training level
Stein Auf
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.
then, on your lever put a setthread and do this
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.
Code: Select all
killTarget:
$target doopen
$targetTrigger nottriggerable
end
Code: Select all
lever:
$target doclose
$targetTrigger triggerable
end
Moderator
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
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
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


