I'll focus on the argument of the comparator since that's where the real problem is.
It is possible to subtract arrays:
From the Command Ref on
www.flashpoint1985.com, downloads sections
arrayA - arrayB
Operand types:
arrayA: Array
arrayB: Array
Type of returned value:
Array
Description:
all elements in arrayB removed from arrayA
Example:
[0, 1, 2, 4, 0, 1, 2, 3, 4, 5] - [1, 2, 3] , result is [0, 4, 0, 4, 5]
Based upon this definition of Array Subtraction I don't think that a direct array comparison to 0 will yield a "true" condition. Therefore, instead of:
_diff = _lastpos - _newpos
?_diff == 0 : goto "end"
You can try the following example. But the empty values may cause some unpredictable results, since what you are really looking for is an empty array…
_diff = _lastpos - _newpos
? (_diff select 0 == ‘') and (_diff select 1 == ‘') and (_diff select 1 == ‘') : goto "end"
This next example makes for a messier chunk of code but does illustrate how flexible the scripting language is, and I can almost guarantee that it will work.
? ((_lastpos select 0 - _newpos select 0) == 0) and (_lastpos select 1 - _newpos select 1) == 0) and ((_lastpos select 2 - _newpos select 2) == 0) : goto "end"
Now, since you mentioned a dude that has stopped running You might want to simplify the above statement by just using the X and Y values from the array. Like this:
? ((_lastpos select 0 - _newpos select 0) == 0) and (_lastpos select 1 - _newpos select 1) == 0 : goto "end"
Hope this helps
Calamity out…