MOVE Action Nonsense, Round II

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

MOVE Action Nonsense, Round II

Post by A-Red »

More fun with MOVE actions...

On Haravikk's advice, I tried setting my MOVEs to deactivate on execution, so they didn't trigger subsequent actions too quickly and lead to the script being very far ahead of itself. It seems to have worked, but I'm having other issues. Failure deactivated the actions just like success (ie the unit gets blocked by something on its way and instead of the units getting back on course the MOVE would stop). So to deal with that I set each of the MOVEs to deactivate on Success rather than Execution. This gives me a rather bizarre problem, as you can see from the log quote below (some other irrelevant script has been removed):
Nonsense wrote:2006-08-03 23:47:14 ### MA [move] Patrol 2 Move 3: #2 monsters moved

2006-08-03 23:47:15 ### MA [move] Patrol 2 Move 3: #2 monsters moved

2006-08-03 23:47:16 ### MA [move] Patrol 2 Move 3: #2 monsters moved

2006-08-03 23:47:17 ### MA [move] Patrol 2 Move 3: #2 monsters moved

2006-08-03 23:47:18 ### MA [move] Patrol 2 Move 3: #2 monsters moved
2006-08-03 23:47:19 ### MA [move] Patrol 2 Move 3: succeeded
2006-08-03 23:47:19 ### MA [move] Patrol 2 Move 3: deactivated

2006-08-03 23:47:19 ### MA [acli] (2) 4a or 4b?: Activating single action
2006-08-03 23:47:19 ### MA [acli] (2) 4a or 4b?: succeeded
2006-08-03 23:47:19 ### MA [acli] (2) 4a or 4b?: deactivated
2006-08-03 23:47:19 ### MA [move] Patrol 2 Move 3: succeeded

2006-08-03 23:47:20 ### MA [acli] (2) 4a or 4b?: Activating single action
2006-08-03 23:47:20 ### MA [acli] (2) 4a or 4b?: succeeded
2006-08-03 23:47:20 ### MA [acli] (2) 4a or 4b?: deactivated
Note that the MOVE succeeds, deactivates, and activates an action list when it turns off. But then comes the weird part. In spite of having just been turned of, the MOVE succeeds and deactivates _again_, causing the action list to fire a second time. This can cause the patrol to be given both of the random actions on the list, one the first time and the other the second time. The effect is that they start pacing back and forth, trying to alternately reach two distant waypoints.

Why is this happening? Is there anything I can do about it?

A-Red
Myrd
Site Admin
Posts: 4031
Joined: Fri Mar 19, 2004 10:17 pm

Post by Myrd »

You sure you aren't activating it another time?
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

That was my first thought as well, but I've looked all over and been unable to find any way that it would be activated a second time. I also set it up so the action list would deactivate the MOVE on activation, but the MOVE still succeeded a second time.

Maybe I should also mention that the MOVE only succeeds and deactivates twice as far as I can tell--it's not an infinite loop. My best guess is that it's some side effect of the fact that it deactivates on successful execution, but I haven't been able to effectively counteract it so far.
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

Further testing shows that using "Activates Only Once" makes no difference, so it's definitely not activating twice.
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Post by haravikk »

It's possible that it's succeeding once for each monster, since they will almost always arrive at different times.

You will need to have your random action (an action list I ussume?) be the one that activates only once. And have another identical one in case you need it.

I can't be certain though, as I said in my other post, movement actions can be extremely quirky under various circumstances which is annoying. e.g, if one of your units doesn't get to the location, but another does, then it will succeed regardless, same if you are using on execution, if one fails, then the action can in theory fail then succeed later on.
It depends a lot on your needs I suppose, as I avoid MOVE actions if I can unless there's only one unit to move that is important. ie; an alternative is to have two MOVEs, one for the unit that you want to trigger the action, and one to move the other unit after it.

In hindsight this behaviour you're observing could actually be REALLY useful, though not in this case. You could I suppose add a deactivates on success parameter to the MOVE, and it to this to be sure that it should be deactivating as promised.
Being Haravikk gets you girls like these:
Image
Gleep
Posts: 291
Joined: Sun Aug 14, 2005 10:18 am

Post by Gleep »

Yeah I had a similar problem with a move deactivating before all my units got to the waypoint. I used a rout instead which worked a lot better cause I could use two waypoints and they would split up and go to whichever was closest. I don't think that is what you want. :(

Good Luck, Loathing is so loathsome compared to Fear heh
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

Thanks for the help. It looks like you're right; there are two units moving, and success happens when each of them hits the waypoint. I can't make the ACLI activate only once, because I'll need everything to be able to loop through again.

But I did find a way to deal with it. The action succeeded twice, but apparently only deactivates once (I guess it's not technically still running when the second unit gets there). So I set it to activate the ACLI on deactivation instead of success.

I also discovered that if there is more than one waypoint (which happened in a couple of places in my script), a MOVE can never succeed. The monsters would just go back and forth through the waypoints indefinitely. I have one waypoint for everything now, and it's a little awkward at times but it doesn't screw up the script.

That pretty much solves all my problems, although there's still one place where the units get to their waypoint and then stand there forever, even though the debugger says the next MOVE is running and I've made sure I used the right units.

A-Red
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Post by haravikk »

Units will only go between the waypoints indefinitely if you set the loop parameter? Or the back and forth flag. The MOVE command is almost exactly identical to if you had ordered the move yourself.

The equivalent of looping is shift clicking to set waypoints, then shift clicking on the first waypoint you set to create a loop.
To go back and forth you shift click to set waypoints then click on the last waypoint again.

If they're looping then you should double check they're not having the move triggered multiple times or anything.
Being Haravikk gets you girls like these:
Image
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

There's no loop. I don't know what it was exactly, but making it only one waypoint solved it.
Post Reply