View Full Version : Weird script mover problem
damocles
17th July 2005, 17:04
I have a very simple script mover door setup in my map - basically a big door is opened and closed via button. It all works as expected, except for one thing. On some occasions (seemingly upredictably) when the mover starts to move, it completely vanishes and all players become "stuck". It's as if the mover suddenly envelops the whole level.
As I said, it works fine most of the time, but every so often, this happens. Anyone have any idea what the cause is or whether it's a known bug?
d3coy
17th July 2005, 19:59
post your script for better results
damocles
17th July 2005, 20:41
Pretty straightforward script. And ther garage door mover is a simple brush entity, usual fare with two path_corners used for the up and down positions.
garagedoor
{
spawn
{
wait 250
accum 1 set 0 // accum 1 is the "in motion" flag
}
death
{
}
trigger up
{
accum 1 abort_if_equal 1
accum 1 set 1
alertentity gdoor_opensound
gotomarker gdoor_top 16 deccel wait
alertentity gdoor_opensound
alertentity gdoor_finishsound
wait 1250
trigger garagedoorbutton ready
trigger garagedoorbutton2 ready
accum 1 set 0
}
trigger down
{
accum 1 abort_if_equal 1
accum 1 set 1
alertentity gdoor_opensound
gotomarker gdoor_bottom 16 deccel wait
alertentity gdoor_opensound
alertentity gdoor_finishsound
wait 1250
trigger garagedoorbutton ready
trigger garagedoorbutton2 ready
accum 1 set 0
}
}
garagedoorbutton
{
spawn
{
wait 250
accum 4 set 0
accum 1 set 0 // active flag - 1 means its already moving
}
trigger ready
{
accum 1 set 0
}
trigger unready
{
accum 1 set 1
}
trigger pressed
{
accum 1 abort_if_equal 1
accum 1 set 1
trigger garagedoorbutton2 unready
// tbd: play some kind of error sound if not able to move
accum 4 trigger_if_equal 0 garagedoor up
accum 4 trigger_if_equal 1 garagedoor down
accum 4 inc 1
accum 4 abort_if_less_than 2
accum 4 set 0
}
}
garagedoorbutton2
{
spawn
{
wait 250
accum 4 set 0
accum 1 set 0 // active flag - 1 means its already moving
}
trigger ready
{
accum 1 set 0
}
trigger unready
{
accum 1 set 1
}
trigger pressed
{
accum 1 abort_if_equal 1
accum 1 set 1
trigger garagedoorbutton unready
// tbd: play some kind of error sound if not able to move
accum 4 trigger_if_equal 0 garagedoor up
accum 4 trigger_if_equal 1 garagedoor down
accum 4 inc 1
accum 4 abort_if_less_than 2
accum 4 set 0
}
}
LaggingTom
17th July 2005, 21:10
Do you have origin brushes in your script_movers?
damocles
17th July 2005, 21:18
yep. Like I said, the door works perfectly most of the time, but one in every ten or so times it will do the weird bug.
LaggingTom
17th July 2005, 21:26
Setstate the button entities to invisible when it's unready and try it. It might just be a random pressing that it's letting by the accum.
damocles
18th July 2005, 14:42
nope :( hiding the buttons hasn't fixed it either. One thing worth noting, as it might shed some light - the error only occurs when the door is trying to move to the down position.
damocles
18th July 2005, 15:05
ah....found it. And it warrants a D'OH! because I'm an idiot. When one button moved the door up or down, I forgot to inc the accum in the other buttion that tracked the door position. The error was occuring when the door was being told to move to the location it was already at.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.