Jump to content
Sign in to follow this  
zovirl

Trigger works, equivalent script doesn\'t.  Game bug?

Recommended Posts

Hey, I have this script that doesn't work.  I am starting to think it must be a bug in the game but maybe I'm missing something.  First, a trigger that works correctly:

Name: tCircle

Activation: Anybody Present, repeatedly

Condition: !((vehicle player) in list tCircle

On activation: hint "player left circle"

On deactivation: hint "player entered circle"

Now, that works properly.  When the player goes outside, it says he left the circle.  When the player comes back it says he entered the circle.  It doesn't matter if the player is riding in a vehicle or not.  Also, getting in and out of vehicles causes no problems.

Now, check out this script which SHOULD do the same thing (unless I'm missing something):

#Top

; short delay to keep game from locking

; up if it loops really fast

~.001

;tInner is a trigger, set to "anybody present", repeatedly

@!((vehicle player) in list tInner)

hint "player left circle"

@(vehicle player) in list tInner

hint "player entered circle"

goto "top"

Ok, that should behave just like the trigger.  But it doesn't.  If the player is inside the trigger and gets out of a vehicle, sometimes it will say he left the circle and then says he enetered the circle again.  Why is it doing this?  Why does it say the player has left the circle when all he has done is step out of a vehicle?  And why doesn't this problem affect the trigger?

I know I could just stick with the trigger and it would work, but this is really a distilled version of the script to show off the problem.  I want a bunch of other stuff to happen so a trigger would be a hassle...

(Edited by zovirl at 9:53 pm on Dec. 6, 2001)

Share this post


Link to post
Share on other sites

Ur problem in tInner array

Ok, trace the script:

Player in vehicle and in trigger

tInner = [Vehicle]

!((vehicle player) in list tInner) ->

(Vehicle) in list tInner = true ->

!true = false.

Script wait on command

@!((vehicle player) in list tInner)

Player get out vehicle

SURPRICE!!!!

tInner still contain only [Vehicle]

!((vehicle player) in list tInner) ->

(player) in list tInner = false ->

!false = true.

Script show hint "player left circle"

Trigger update tInner and now they contain [Vehicle, player]

@(vehicle player) in list tInner ->

(player) in list tInner = true

Script show hint "player entered circle"

smile.gif

Try this:

#t1

~.01

? ((vehicle player) in list tInner) : goto "t1"

hint "player left circle"

#t2

~.01

? !((vehicle player) in list tInner) : goto "t2"

hint "player entered circle"

goto "t1"

Share this post


Link to post
Share on other sites

Yeah, I guess I could do that....but...I really want to use the @ command. I think it should be more efficient than a polling loop (although I could be wrong...). I do see what is happening though. When the player exits the vehicle, the "vehicle player" starts returning the player a bit before the trigger list gets the player added to it.

what a mess smile.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×