• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

A MUI Trigger

Status
Not open for further replies.
Level 8
Joined
Mar 26, 2009
Messages
301
Here is what I need:
In war3, when ensnare is cast on a unit, it disables movement, but not attack, spellcasting or turning (around itself) Using this to my advantage, I made a turret system. When player selects the turret (sentry gun) and right clicks on a spot, turret will face that direction. This was basically what I needed and It works, to a point. But, unit doesn't forget its "move" order EVER and so does not auto attack nearby enemies unless player orders unit to stop or manually attack a target. At this point, I need a trigger that:
- Waits till ensnared unit to face the direction,
- Then order it to stop so movement order will be interupted and turret will keep auto engaging nearby enemies.

I can trigger this to happen for a single unit. But if multiple of same units are selected and ordered to face a direction, "wait" action will cause a problem because it is not MUI. So what I am asking is, how do I make this MUI? =)
P.S: I only trigger in GUI, so I can't add anything to my map that can't be done via GUI (and custom scripts)
 
Level 5
Joined
Nov 30, 2010
Messages
184
Trigger:
Event: unit is ordered to target a point
Condition: unit type of targeting unit is sentry gun
Action: make targeting unit face target point
---------order targeting unit to stop

The trigger may not be phrased exactly like this as I'm not posting this from my computer, the functions aren't copied word for word.
 
Level 11
Joined
May 31, 2008
Messages
698
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (==) (Order(move))
      • (Unit-type of (Triggering unit)) Equal to (==) Turret
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • Unit - Make (Triggering unit) face (Angle from (Position of (Triggering unit)) to (Target point of issued order)) over 0.00 seconds
This doesnt work? it should if you do make unit face angle instead of make unit face point.
and ofcourse you would have to take care of the leaks.

Edit:
okay, that doesnt work. but you can use a wait. this works just fine, i tested it with like 10 riflemen ensnared, selected all of them, ordered them to move, and it worked prefect. the wait doesnt make it non-MUI. and it also allows them to turn towards the point you want them to
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Unit-type of (Ordered unit)) Equal to (==) Rifleman
    • Actions
      • Wait 0.10 seconds
      • Unit - Order (Ordered unit) to Stop
 
Last edited:
Level 5
Joined
Nov 30, 2010
Messages
184
Using wait turns the trigger not MUI. To make it MUI, you have to use two triggers.

Trigger1:
Event: a unit is issued an order targeting a point
Condition: unit type of triggering unit is equal to turret
------------type of order issued equals to move
Action: add triggering unit to waitgroup

Trigger2:
Event: every 0.10 seconds
Condition:
Action: pick every unit in waitgroup and do actions
---------loop:
------------order picked unit to stop
 
Level 8
Joined
Mar 26, 2009
Messages
301
Is your model an actual turret? You had better change the model than muddling up with triggering stuff, it would be way easier.
That's an important point. I forgot to explain.
You know how bombard tower and treant protector works in war3. They face the direction while engaging enemies. When there is no longer threat, they return to their normal facing direction (which is something like 300 degrees more or less) The model I use works similar. So it has a default facing angle (which can be changed via triggers and i do) but as the treant protector does, sentry gun returns to its default facing angle after killing an unit. I want it to remain at same facing angle as he was attacking the enemy unit. So to quickly fix it, I added movement ability to turret but also cast 0 secs (infinite) ensnare on it to prevent movement while leaving the units turning around itself ability functional.
Problem is explained in my first post as:
In war3, when ensnare is cast on a unit, it disables movement, but not attack, spellcasting or turning (around itself) Using this to my advantage, I made a turret system. When player selects the turret (sentry gun) and right clicks on a spot, turret will face that direction. This was basically what I needed and It works, to a point. But, unit doesn't forget its "move" order EVER and so does not auto attack nearby enemies unless player orders unit to stop or manually attack a target. At this point, I need a trigger that:
- Waits till ensnared unit to face the direction,
- Then order it to stop so movement order will be interupted and turret will keep auto engaging nearby enemies.

I can trigger this to happen for a single unit. But if multiple of same units are selected and ordered to face a direction, "wait" action will cause a problem because it is not MUI. So what I am asking is, how do I make this MUI? =)
P.S: I only trigger in GUI, so I can't add anything to my map that can't be done via GUI (and custom scripts)
About "Unit - Face Angle Instantly" action; well I don't want to use that because of the "instant" part =)
 
Last edited:
Level 8
Joined
Mar 26, 2009
Messages
301
Using wait turns the trigger not MUI. To make it MUI, you have to use two triggers.

Trigger1:
Event: a unit is issued an order targeting a point
Condition: unit type of triggering unit is equal to turret
------------type of order issued equals to move
Action: add triggering unit to waitgroup

Trigger2:
Event: every 0.10 seconds
Condition:
Action: pick every unit in waitgroup and do actions
---------loop:
------------order picked unit to stop
This method looked promising. I tried it but it didn't work. Here are the triggers.
  • Turret Face Angle Stop 1
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(move))
      • ((Unit-type of (Ordered unit)) Equal to Turret) or ((Unit-type of (Ordered unit)) Equal to Heavy Turret)
    • Actions
      • Unit Group - Add (Ordered unit) to Global_Turret_Group
  • Turret Face Angle Stop 2
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Global_Turret_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Stop
 
Level 11
Joined
May 31, 2008
Messages
698
Using wait turns the trigger not MUI. To make it MUI, you have to use two triggers.

Trigger1:
Event: a unit is issued an order targeting a point
Condition: unit type of triggering unit is equal to turret
------------type of order issued equals to move
Action: add triggering unit to waitgroup

Trigger2:
Event: every 0.10 seconds
Condition:
Action: pick every unit in waitgroup and do actions
---------loop:
------------order picked unit to stop

wait functions dont make it non-MUI.....try it for yourself, it works just fine. and if you use your method you have to remove the unit from the group after it is stopped, otherwise it would mess up the animation because it would continuously be ordered to stop, even when it tries to attack. That might even disable it's ability to attack.

But the way that i said, with the wait, works perfectly fine. it is 100% MUI
 
Level 8
Joined
Mar 26, 2009
Messages
301
It doesn't work. With the wait, game can not keep track of references like "casting unit, triggering unit" etc.. You need to use variables for that. And if you use variables and wait, it is not MUI any longer. Tested your method, it didn't work either =)
 
Level 11
Joined
May 31, 2008
Messages
698
It doesn't work. With the wait, game can not keep track of references like "casting unit, triggering unit" etc.. You need to use variables for that. And if you use variables and wait, it is not MUI any longer. Tested your method, it didn't work either =)

you used the trigger i posted on my edit?

Cause i used that trigger here, it seems to work fine.
Just ensnare all the riflemen with your footman and order them to all move at the same time, they will auto attack still.
 

Attachments

  • gfhg.w3x
    16.9 KB · Views: 80
Level 8
Joined
Mar 26, 2009
Messages
301
you used the trigger i posted on my edit?

Cause i used that trigger here, it seems to work fine.
Just ensnare all the riflemen with your footman and order them to all move at the same time, they will auto attack still.
Lol, that actually works. "Or" condtions in my map cause a malfunction. Same does adding a "issued order = move".. I have no idea why but, it happens. I removed them from the condiitons (although they were matched during the game) and it worked. Logically this should stop unit from attacking or applying other orders but it does not. Haha, really weird.. :vw_wtf:
 
Level 11
Joined
May 31, 2008
Messages
698
the key is; issued an order targeting a point
only move, attack-move, patrol, or point target abilities fall under that category :D
so when it attacks a unit, that is an order that is targeting a unit, not a point
 
Status
Not open for further replies.
Top