• 🏆 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!

[General] how can i intercept a lack of orders

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
You might have to check periodically until it has no order. I think either null or it is an empty string is used, but I could be completely wrong.

Anyway, check what the order is for the unit when it has no orders and then check periodically for that.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
i did not think of that. here it is. Untitled Trigger 001
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units of type Basal Golem created from blood forge) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of (Picked unit)) Equal to (Order(<Empty String>))
Then - Actions
Unit - Order (Picked unit) to Night Elf Druid Of The Claw - Bear Form
Unit - Order (Picked unit) to Night Elf Druid Of The Claw - Night Elf Form
Else - Actions
Do nothing
 
Level 25
Joined
May 11, 2007
Messages
4,651
Tested your map, placed some Basal Golem created from blood forge on the map and hit test.

They do transform when idle. It's just a 2 second delay since your trigger runs every 2 seconds.

Also, you should consider fixing your leaks now, as if you try to fix them when the map is nearly done, it's going to be a big pain to fix all the triggers.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Leaks:
  • Untitled Trigger 001
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Basal Golem created from blood forge) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Current order of (Picked unit)) Equal to (Order(smart))
                  • (Current order of (Picked unit)) Equal to (Order(attack))
                  • (Current order of (Picked unit)) Equal to (Order(move))
                  • (Current order of (Picked unit)) Equal to (Order(cloudoffog))
                  • (Current order of (Picked unit)) Equal to (Order(charm))
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Unit - Order (Picked unit) to Night Elf Druid Of The Claw - Bear Form
              • Unit - Order (Picked unit) to Night Elf Druid Of The Claw - Night Elf Form
unit group leak.

  • construction on site 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Foundation1 <gen> contains (Casting unit)) Equal to True
              • (Ability being cast) Equal to transform into arbor lodge new
              • (Number of units in (Units in Foundation1 <gen> matching ((Unit-type of (Matching unit)) Equal to Basal Golem created from blood forge))) Equal to 4
        • Then - Actions
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Item - Move (Item carried by (Picked unit) in slot 1) to ((Position of (Picked unit)) offset by (-200.00, 0.00)))
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Unit - Remove (Picked unit) from the game)
          • Unit - Create 1 Arbor Lodge for (Owner of (Casting unit)) at (Center of Foundation1 <gen>) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to site1
          • Player - Add 250 to (Owner of (Last created unit)) Current lumber
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Foundation1 <gen> contains (Casting unit)) Equal to True
              • (Ability being cast) Equal to transform into barrracks new
              • (Number of units in (Units in Foundation1 <gen> matching ((Unit-type of (Matching unit)) Equal to Basal Golem created from blood forge))) Equal to 4
        • Then - Actions
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Item - Move (Item carried by (Picked unit) in slot 1) to ((Position of (Picked unit)) offset by (-200.00, 0.00)))
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Unit - Remove (Picked unit) from the game)
          • Unit - Create 1 Barracks custom for (Owner of (Casting unit)) at (Center of Foundation1 <gen>) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to site1
          • Player - Add 250 to (Owner of (Last created unit)) Current lumber
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Foundation1 <gen> contains (Casting unit)) Equal to True
              • (Ability being cast) Equal to transform into crypt new
              • (Number of units in (Units in Foundation1 <gen> matching ((Unit-type of (Matching unit)) Equal to Basal Golem created from blood forge))) Equal to 4
        • Then - Actions
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Item - Move (Item carried by (Picked unit) in slot 1) to ((Position of (Picked unit)) offset by (-200.00, 0.00)))
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Unit - Remove (Picked unit) from the game)
          • Unit - Create 1 Crypt custom for (Owner of (Casting unit)) at (Center of Foundation1 <gen>) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to site1
          • Player - Add 250 to (Owner of (Last created unit)) Current lumber
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Foundation1 <gen> contains (Casting unit)) Equal to True
              • (Ability being cast) Equal to transform into rune stone new
              • (Number of units in (Units in Foundation1 <gen> matching ((Unit-type of (Matching unit)) Equal to Basal Golem created from blood forge))) Equal to 4
        • Then - Actions
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Item - Move (Item carried by (Picked unit) in slot 1) to ((Position of (Picked unit)) offset by (-200.00, 0.00)))
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Unit - Remove (Picked unit) from the game)
          • Unit - Create 1 Rune stone for (Owner of (Casting unit)) at (Center of Foundation1 <gen>) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to site1
          • Player - Add 250 to (Owner of (Last created unit)) Current lumber
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Foundation1 <gen> contains (Casting unit)) Equal to True
              • (Ability being cast) Equal to transform into temple new
              • (Number of units in (Units in Foundation1 <gen> matching ((Unit-type of (Matching unit)) Equal to Basal Golem created from blood forge))) Equal to 4
        • Then - Actions
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Item - Move (Item carried by (Picked unit) in slot 1) to ((Position of (Picked unit)) offset by (-200.00, 0.00)))
          • Unit Group - Pick every unit in (Units in Foundation1 <gen>) and do (Unit - Remove (Picked unit) from the game)
          • Unit - Create 1 Temple custom for (Owner of (Casting unit)) at (Center of Foundation1 <gen>) facing Default building facing degrees
          • Unit Group - Add (Last created unit) to site1
          • Player - Add 250 to (Owner of (Last created unit)) Current lumber
        • Else - Actions
          • Do nothing
Point leaks.

Okay, your golems will not transform if you tell them to move twice, just double click.
So after an obelisk uses the transform to golem ability, you have to the golem to move/attack to the same position the obelisk where ordered to move/attack to.
 
Level 11
Joined
Jun 2, 2013
Messages
613
So here's probably your problem (and i'm not sure if this is true or not). But let's Think of it this way:

A unit is issued a 'move' order to a target point. That 'Move' order has been received by the game - ordering him to MOVE to that point was the order. Actually getting to that point is NOT part the order. Since you are checking for an ORDER every two seconds, if the unit hasn't received a new order by the time it gets to the target point, it transforms regardless of where it is.

What you could do is set a temp point at the position of the order and check to see if he has gotten there or not before transforming.

As for leaks, check here:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/memory-leaks-263410/
 
So here's probably your problem (and i'm not sure if this is true or not). But let's Think of it this way:

A unit is issued a 'move' order to a target point. That 'Move' order has been received by the game - ordering him to MOVE to that point was the order. Actually getting to that point is NOT part the order. Since you are checking for an ORDER every two seconds, if the unit hasn't received a new order by the time it gets to the target point, it transforms regardless of where it is.

What you could do is set a temp point at the position of the order and check to see if he has gotten there or not before transforming.

As for leaks, check here:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/memory-leaks-263410/
This is not true. The unit will keep the "move" (or "smart", depending on what you used) order until it reaches it's destination. The only exception to this is movement as part of the auto-engagement mechanics, which will still be considered as no order, as technically, that unit is acting out of free will.

So if you want your unit not to transform while moving because of auto-engage, you actually need to use the "IsUnitMoving" snippet.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
that is still a single unit script and i have lots of basal golems that is created from the blood forge. i need a solution that works independent of how many units the player controls.

Then add the non-moving units to a unit group. Pick all units in the group every .25 seconds, if they are still not moving do the order check - if they started moving remove them from the group.

That will work.
 
Status
Not open for further replies.
Top