unfortunately, there is an other problem:
every time I push the button the script “thinks” I pressed the button twice.
here is the output of /g_scriptdebug 1:
47300 : (door_1_TST) GScript event: trigger activate
47300 : (door_1_TST) GScript command: trigger door_1 open
47300 : (door_1) GScript event: trigger open
47300 : (door_1) GScript command: accum 0 inc 1
47300 : (door_1) GScript command: accum 0 trigger_if_equal 1 door_1 open1
47300 : (door_1) GScript event: trigger open1
47300 : (door_1) GScript command: faceangles 0 20 0 800 wait
there is no action!
and the script continues
47400 : (door_1_TST) GScript event: trigger activate
47400 : (door_1_TST) GScript command: trigger door_1 open
47400 : (door_1) GScript event: trigger open
47400 : (door_1) GScript command: accum 0 inc 1
47400 : (door_1) GScript command: accum 0 trigger_if_equal 1 door_1 open1
47400 : (door_1) GScript command: accum 0 trigger_if_equal 2 door_1 open2
47400 : (door_1) GScript event: trigger open2
47400 : (door_1) GScript command: faceangles 0 60 0 800 wait
48200 : (door_1) GScript command: wait 2500
the door opens
when I press the button again:
52700 : (door_1_TST) GScript event: trigger activate
52700 : (door_1_TST) GScript command: trigger door_1 open
52700 : (door_1) GScript event: trigger open
52700 : (door_1) GScript command: accum 0 inc 1
52700 : (door_1) GScript command: accum 0 trigger_if_equal 1 door_1 open1
52700 : (door_1) GScript command: accum 0 trigger_if_equal 2 door_1 open2
52700 : (door_1) GScript command: accum 0 trigger_if_equal 3 door_1 open_final
52700 : (door_1) GScript event: trigger open_final
52700 : (door_1) GScript command: faceangles 0 90 0 800 wait
same story: no action and the script continues
52800 : (door_1_TST) GScript event: trigger activate
52800 : (door_1_TST) GScript command: trigger door_1 open
52800 : (door_1) GScript event: trigger open
52800 : (door_1) GScript command: accum 0 inc 1
52800 : (door_1) GScript command: accum 0 trigger_if_equal 1 door_1 open1
52800 : (door_1) GScript command: accum 0 trigger_if_equal 2 door_1 open2
52800 : (door_1) GScript command: accum 0 trigger_if_equal 3 door_1 open_final
52800 : (door_1) GScript command: accum 0 trigger_if_equal 4 door_1 close
52800 : (door_1) GScript event: trigger close
52800 : (door_1) GScript command: faceangles 0 0 0 800 wait
53600 : (door_1) GScript command: accum 0 set 0
here is the script I use:
door_1_TST
{
trigger activate
{
trigger door_1 open
}
}
door_1
{
spawn
{
accum 0 set 0
}
trigger open
{
accum 0 inc 1
accum 0 trigger_if_equal 1 door_1 open1
accum 0 trigger_if_equal 2 door_1 open2
accum 0 trigger_if_equal 3 door_1 open_final
accum 0 trigger_if_equal 4 door_1 close
}
trigger open1
{
faceangles 0 20 0 800 wait
wait 2500
}
trigger open2
{
faceangles 0 60 0 800 wait
wait 2500
}
trigger open_final
{
faceangles 0 90 0 800 wait
}
trigger close
{
faceangles 0 0 0 800 wait
accum 0 set 0
}
}
edit:
when I use
trigger open
{
accum 0 inc 1
accum 0 trigger_if_equal 2 door_1 open1
accum 0 trigger_if_equal 4 door_1 open2
accum 0 trigger_if_equal 6 door_1 open_final
accum 0 trigger_if_equal 8 door_1 close
}
the door works as expected, so I will use this part in the script
The question still remains: why?