• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

This Order id wont work!

Status
Not open for further replies.
Level 11
Joined
Dec 5, 2009
Messages
846
Hello i want this order id to work. But it doesn't.

BTW: i have tested ''attack-move'' ''move-attack'' attack-move-to

  • Mercenary AI Copy
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • P_Hero[((Player number of (Triggering player)) - 1)] Equal to (Ordered unit)
    • Actions
      • Set Merc_Point[1] = (Target point of issued order)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(move-attack-to))
        • Then - Actions
          • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Attack-Move To Merc_Point[1]
        • Else - Actions
        • Custom script: call RemoveLocation(udg_Merc_Point[1])
Don't worry the other conditions works!
 
Level 13
Joined
May 11, 2008
Messages
1,198
first of all i don't see a group loop...
also, i think this would look neater in jass...
it looks like you might want to move multiple units according t where a single unit is...but it appears that your code will only move one unit when you're moving the other unit...
 
Level 9
Joined
May 27, 2006
Messages
498
The order name of attack-move is just "attack".
Also, you could put that condition in the trigger conditions instead of an if-then-else block, so that your trigger won't run pointlessly on every issued order.

Try it out and see whether it works. In case it doesn't, use (Owner of (Triggering Unit)) instead of (Triggering player).
 
Level 11
Joined
Dec 5, 2009
Messages
846
The order name of attack-move is just "attack".
Also, you could put that condition in the trigger conditions instead of an if-then-else block, so that your trigger won't run pointlessly on every issued order.

Try it out and see whether it works. In case it doesn't, use (Owner of (Triggering Unit)) instead of (Triggering player).


Nope its not ''attack''
And i don't think it matters if i use owner of triggering unit. Cuz everything else works in this trigger without the attack-move
here's the whole thing.

  • AI
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • P_Hero[((Player number of (Triggering player)) - 1)] Equal to (Ordered unit)
    • Actions
      • Set Merc_Point[1] = (Target point of issued order)
      • Set Merc_Point[3] = (Position of P_Mercenaries[((Player number of (Triggering player)) - 1)])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(attack))
        • Then - Actions
          • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Attack-Move To Merc_Point[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of issued order) belongs to an enemy of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Attack-Move To Merc_Point[3]
        • Else - Actions
      • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Right-Click Merc_Point[1]
      • Custom script: call RemoveLocation(udg_Merc_Point[3])
      • Custom script: call RemoveLocation(udg_Merc_Point[1])
 
Level 13
Joined
May 11, 2008
Messages
1,198
i meant that: i don't want to recreate your gui. if you convert to custom text and paste that here, i'll examine it...even saying that... i think they might be right about the player. needing to be owner of trigger unit. because the first part says a unit does order..blah blah...it says nothing about a player doing something. so there is no triggering player.
 
Level 11
Joined
Dec 5, 2009
Messages
846
I know the problem if i recreate my code like this:

  • Mercenary AI
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • P_Hero[((Player number of (Triggering player)) - 1)] Equal to (Ordered unit)
    • Actions
      • Set Merc_Point[1] = (Target point of issued order)
      • Set Merc_Point[3] = (Position of P_Mercenaries[((Player number of (Triggering player)) - 1)])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(attack))
        • Then - Actions
          • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Attack-Move To Merc_Point[1]
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of issued order) belongs to an enemy of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Attack-Move To Merc_Point[3]
        • Else - Actions
      • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Right-Click Merc_Point[1]
      • Custom script: call RemoveLocation(udg_Merc_Point[3])
      • Custom script: call RemoveLocation(udg_Merc_Point[1])
This will work... But then then it will leak... Someone have a clue how to do now ? xP

BTW: ty raft for the order Id +rep.
 
Level 9
Joined
May 27, 2006
Messages
498
Well, maybe jass is a "long, treacherous, and exhausting path", but you know, shooting yourself out of a catapult will make you splash atop that mountain... I don't know how about you, but I, for one, wouldn't call that successful.
 
Level 13
Joined
May 11, 2008
Messages
1,198
is that what the last part of his sig says? for some reason the line after 'while gui is like' is cut off.

well, i CAN theoretically read in gui, problem is i make errors in discerning what is there, so i have to read the material over and over and over again and still get it wrong. gui is supposed to be like normal english grammatically... but isn't...it's broken between code language and english and is impossible to make sense of except through trial and error. jass at least is just code language instead of an attempt at proper english grammar.

don't get me wrong, i used to use gui a lot in making maps...but i was never very successful with it so i learned jass.
 
Level 11
Joined
Dec 5, 2009
Messages
846
• Player number of (Triggering player) is enough. The -1 (referring to Player(0) = Red) is used in Jass. GUI has some differences with Jass.
• Skip remaining actions is not needed there. It should be used in loops, after finding the appropriate index.
• Finally, use (smart) instead of (attack).

I used smart but it didn't work. I used attack and it worked with the skip remaining actions. I've posted the trigger here in this thread. That one works. But when you skip remaining actions the leaks wont be cleared right? So how to clear the leaks when having a skip remaining actions ? :p
 
Level 9
Joined
May 27, 2006
Messages
498
Just don't use skip remaining actions and remove this:
  • Unit - Order P_Mercenaries[((Player number of (Triggering player)) - 1)] to Right-Click Merc_Point[1]
Or put it inside an if-then-else block, checking the proper order-id ("move"?)

Or, you could copy the custom scripts and put them right before the skip action.
 
Level 13
Joined
May 11, 2008
Messages
1,198
dude...normally you clear the leaks at the end right? but now you got skip remaining actions...so clear the leaks before skip remaining actions. that's what you need to do. because the skip becomes the end. so clear the leaks before the end. and before the skip. just don't end up clearing the leaks twice.
 
Status
Not open for further replies.
Top