• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Pause/Order Bug

Status
Not open for further replies.
Level 20
Joined
Jul 10, 2009
Messages
477
Hey,

I just discovered a problem which I believe to be a World Editor or Wc3 bug, probably only relating GUI-code.

It concerns these 2 triggers:
(Note that my editor is in German. I tried to translate the GUI code, but it will contain several mistakes. For this reason, I uploaded a map including the triggers that should be displayed in English when opened with an English World Editor.)

  • Trigger 1
    • Events
      • Player - Player 1 (Red) types a chat message containing x as Exact Matching
    • Conditions
    • Actions
      • Unit - Create 1 Soldier for Player 1 (Red) at ((Center of (Playable map area)) offset by (2000.00, 0.00)) facing (Center of (Playable map area))
      • Unit - Pause on (Last created unit)
  • Trigger 2
    • Events
      • Unit - A unit Receives an Order Aiming at a Location
    • Conditions
      • (Issued order) Not Equal To (Order(move))
    • Actions
      • Unit - Order (Triggering unit) to Move to (Center of (Playable map area))
These triggers are fairly easy. The first one spawns a soldier when typing x in the chat, and pauses him immediately. The second one disables some kind of orders, giving a movement order to the middle of the map instead.

What should happen:
When Player 1 types "x" in the chat, a soldier should spawn and get paused.

What actually happens:
When Player 1 types "x" in the chat, a soldier spawns and walks to the middle of the map. He does not get paused.

Observations:
  • First of all, it is clear that Trigger2 somehow orders the soldier to move. So creating or pausing the soldier must be responsible for Trigger2 to shoot.
  • When deactivating the "Unit - Pause on (Last created unit)" line in Trigger1, the spawned soldier does not move. Therefore the pause-action is responsible and the create-action is not. To pause a unit seems to create an order aiming at a location (weird?). When displaying the "Issued Order" in Trigger2 with a text message on the screen, the display shows (null).
  • When deactivating the "Order (Triggering unit) to Move To .." line in Trigger2, the soldier actually gets paused. So the move-order has to be responsible for the soldier to get unpaused.

This sounds weird, because a movement order should never interrupt a pause. Indeed, a unit with an active order remembers its order when it gets paused until the moment when it gets unpaused. And a paused unit can't receive orders at all. So under all circumstances, it should never happen that a unit which gets paused and receives a movement order (in any sequence), prefers the movement order.
In addition, a pause should not trigger the "A unit Receives an Order Aiming at a Location" event.

I know that I can solve the problem by deactivating Trigger2 before the pause-line in Trigger1, and re-activating it afterwards.
But I actually don't want to know how to solve the problem, but why and where it comes off.
Is this indeed a bug, or am I missing something?


I am looking forward to your answers :)

Greetings!
 

Attachments

  • BugMap.w3x
    16.5 KB · Views: 84
This works.


  • Trigger 1
    • Events
      • Player - Player 1 (Red) types a chat message containing x as An exact match
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at ((Center of (Playable map area)) offset by (2000.00, 0.00)) facing (Center of (Playable map area))
      • Unit - Pause (Last created unit)
      • Custom script: call IssueImmediateOrderById(bj_lastCreatedUnit, 851973)
      • Unit - Unpause (Last created unit)
  • Trigger 2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Not equal to (Order(move))
    • Actions
      • Custom script: if (GetIssuedOrderId() != 851973) then
      • Game - Display to (All players) for 30.00 seconds the text: (String((Issued order)))
      • Unit - Order (Triggering unit) to Move To (Center of (Playable map area))
      • Custom script: endif

The issue is that likely pausing the unit simply fires the order event.

Ordering "851973" is a way to stop the unit without keeping it paused.
 

Attachments

  • BugMap.w3x
    16.6 KB · Views: 80
Level 20
Joined
Jul 10, 2009
Messages
477
Even if pausing the unit triggers Trigger2, the movement order given there should not interrupt the pause, should it?
I actually don't want to unpause the soldier. I want him to be paused. :)

I know that I can change Trigger1 like this to solve the problem:
  • Trigger 1
    • Events
      • Player - Player 1 (Red) types a chat message containing x as An Exact Match
    • Conditions
    • Actions
      • Unit - Create 1 Soldier for Player 1 (Red) at ((Center of (Playable map area)) offset by (2000.00, 0.00)) facing (Center of (Playable map area))
      • Trigger - Turn off Trigger 2 <gen>
      • Unit - Pause (Last created unit)
      • Trigger - Turn on Trigger 2 <gen>
But as I said, I don't want to solve the problem, but I basically want to understand where this weird behaviour comes from. :)

Is a pause probably not an instant change, but an order which has to be executed, so that Trigger2 prevents it from being executed? I gues, that would explain it.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
I thought pausing units was a game state flag for the unit that prevented the game from updating it to some extent. Similar to hiding units allows them to keep moving but removes them from common play field processes. Ordering a paused unit should do nothing since it is paused so cannot act.

Pausing a unit orders it to stop. I think this was done by Blizzard to prevent all kinds of bugs from occurring with channelled spells and paused units where they would continue to channel even when paused (unable to channel) since they never were told to stop.

What could be happening is that the move order you issue overwrites the pause order so the pause action fails since the unit never stops (can only pause a stopped unit).
 
Level 20
Joined
Jul 10, 2009
Messages
477
I agree that the move order somehow overwrites the "pause order" (assuming that pausing is an order). But pausing does not order the unit to stop (at least not in the sense of the "stop" ability that all units have). The "stop" order lets a unit forget all of its active orders. But Pausing lets a unit remember its active orders, and continuing them when being unpaused.

Thats why a trigger such as
  • Example Trigger
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Move to (Center of (Playable map area))
      • Unit - Pause (Triggering unit)
      • Wait 1.00 game-time seconds
      • Unit - Unpause (Triggering unit)
lets every unit which enters the battlefield wait for a second and then move to the center of the map.

Note that it does not make a difference to put in a further order behind the pause-action like this:
  • Example Trigger
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Move to (Center of (Playable map area))
      • Unit - Pause (Triggering unit)
      • Unit - Order (Triggering unit) to Move to (Center of (Playable map area))
      • Wait 1.00 game-time seconds
      • Unit - Unpause (Triggering unit)
The unit will ignore the second move order because it is already paused. And it will walk to the middle of the map when it gets unpaused.



Extension of my first post:

I noticed another circumstance which underlines my assumption that this is a World Editor/Wc3 bug.
Please consider the two triggers from the very beginning of this page and extend it with a third trigger as follows:
  • Trigger 1
    • Events
      • Player - Player 1 (Red) types a chat message containing x as An Exact Match
    • Conditions
    • Actions
      • Unit - Create 1 Soldier for Player 1 (Red) at ((Center of (Playable map area)) offset by (2000.00, 0.00)) facing (Center of (Playable map area))
      • Unit - Pause (Last created unit)
  • Trigger 2
    • Events
      • Unit - A unit is Issued An Order Targeting a Point
    • Conditions
      • (Issued order) Not Equal To (Order(move))
    • Actions
      • Unit - Order (Triggering unit) to Move to (Center of (Playable map area))
      • Trigger - Turn off (This Trigger)
  • Trigger 3
    • Events
      • Player - Player 1 (Red) types a chat message containing y as An Exact Match
    • Conditions
    • Actions
      • Unitgroup - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
First of all, you type x ingame, and notice (like always) that the spawned soldier does not get paused, walking to the middle of the map instead. Because Trigger 2 gets turned off, you can move him freely afterwards.
Then you type y to activate Trigger 3, and discover that the lucky soldier again does not get paused. But Trigger 2 can't be blamed this time, because it did already get turned off.
This leads to the conclusion that the soldier is threated as an "already paused unit" ingame, although he can be controlled normally.

This is getting weirder and weirder ;)

I attached the extended Bug Map for you.
 

Attachments

  • BugMap_v2.w3x
    16.6 KB · Views: 118
Level 20
Joined
Jul 10, 2009
Messages
477
I'm still interested in this topic, so I'm fine with giving it a bit of further discussion :)

can u try pause all units? try issuing the unit to order to stop then pause the unit.
I don't know exactly what you mean (plz enlighten me), but ordering all units to stop before pausing them (in Trigger 3) would not change the result at all. (Units still do not get paused, they just stop in addition and are freely movable afterwards).
 
Level 13
Joined
Dec 21, 2010
Messages
541
I'm still interested in this topic, so I'm fine with giving it a bit of further discussion :)


I don't know exactly what you mean (plz enlighten me), but ordering all units to stop before pausing them (in Trigger 3) would not change the result at all. (Units still do not get paused, they just stop in addition and are freely movable afterwards).

I tested the map... I tried pause all units and it also didn't work.. I tried to make a new trigger that pauses all units every 0.03 seconds.. and still doesn't work... I got same problem with my map where after I resurrect the hero and issued it to move to one point it also doesn't pause when I tried to pause it..
 
Level 20
Joined
Jul 10, 2009
Messages
477
When you pause a not already paused/stunned unit, the unit receives a point (0,0) order, this order is 851973, there is no string equivalent.
I suppose you could just add the condition issued order != null to your trigger 2
That's some good information! I guess, that's why TriggerHappy adviced me to use
  • Custom script: if (GetIssuedOrderId() != 851973) then
Unfortunately, the condition "issued order != null" does not work, so you have to use that Custom Script.

venger07 said:
I tested the map... I tried pause all units and it also didn't work.. I tried to make a new trigger that pauses all units every 0.03 seconds.. and still doesn't work... I got same problem with my map where after I resurrect the hero and issued it to move to one point it also doesn't pause when I tried to pause it..
Could indeed have the same reason as described here. You should check if you use triggers that fire when issueing orders to units. You could also check if unpausing before pausing helps.


________________________________________________________________

We know by now that pausing a unit, related to the order "851973", can be prevented by interrupting that order. The fact that a unit going through this process can't be paused again can be explained by the game believing it to be paused nevertheless. So it makes sense that you can restore the unit's ability to get paused by unpausing it at first.

That means, if you modify Trigger 3 as follows, it would work as intended (and indeed pause all units):
  • Trigger 3
    • Events
      • Player - Spieler 1 (Red) types a chat message containing y as An Exact Match
    • Conditions
    • Actions
      • Unitgroup - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
          • Unit - Pause (Picked unit)
 
Status
Not open for further replies.
Top