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

Is this Multi User friendly?

Status
Not open for further replies.
Level 17
Joined
May 6, 2008
Messages
1,598
  • Windfury
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to WindFury_Caster[(Player number of (Owner of (Attacking unit)))]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 15
        • Then - Actions
          • Set Windfury_CasterPoint = (Position of WindFury_Caster[(Player number of (Owner of (Attacking unit)))])
          • Unit - Create 1 Caster for (Owner of WindFury_Caster[(Player number of (Owner of (Attacking unit)))]) at Windfury_CasterPoint facing Default building facing degrees
          • Set WindFury_CasterUnit = (Last created unit)
          • Unit - Add Windfury Dummy to WindFury_CasterUnit
          • Unit - Set level of Windfury Dummy for WindFury_CasterUnit to 1
          • Unit - Order WindFury_CasterUnit to Orc Shaman - Bloodlust WindFury_Caster[(Player number of (Owner of (Attacking unit)))]
          • Unit - Add a 3.00 second Generic expiration timer to WindFury_CasterUnit
          • Set WindFury_CasterUnit = No unit
          • Custom script: call RemoveLocation(udg_Windfury_CasterPoint)
        • Else - Actions
          • Do nothing
  • Windfury User
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Windfury
    • Actions
      • Set WindFury_Caster[(Player number of (Owner of (Learning Hero)))] = (Learning Hero)
What I'm trying to ask if this ability is user friendly, it's like bash, but gives you a bloodlust buff.



Thanks to Yearight for giving me the trigger to play with
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
It is MUI for all the units that are in that array.
But it can be optimized.
1. I have no idea why you use an unit array with some units, but I presume you know ;)
2. Never use a "do nothing" unless in a if statement with single arguments. So in this case you should remove it.
3. Put the if(the one for chance) in the conditions of the trigger, but keep the actions of the if in the actions part of the trigger.
P.s there are tutorials on MUI
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
  • Windfury
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to WindFury_Caster[(Player number of (Owner of (Attacking unit)))]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 15
        • Then - Actions
          • Set Windfury_CasterPoint = (Position of WindFury_Caster[(Player number of (Owner of (Attacking unit)))])
          • Unit - Create 1 Caster for (Owner of WindFury_Caster[(Player number of (Owner of (Attacking unit)))]) at Windfury_CasterPoint facing Default building facing degrees
          • Set WindFury_CasterUnit = (Last created unit)
          • Unit - Add Windfury Dummy to WindFury_CasterUnit
          • Unit - Set level of Windfury Dummy for WindFury_CasterUnit to 1
          • Unit - Order WindFury_CasterUnit to Orc Shaman - Bloodlust WindFury_Caster[(Player number of (Owner of (Attacking unit)))]
          • Unit - Add a 3.00 second Generic expiration timer to WindFury_CasterUnit
          • Set WindFury_CasterUnit = No unit
          • Custom script: call RemoveLocation(udg_Windfury_CasterPoint)
        • Else - Actions
          • Do nothing
  • Windfury User
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Windfury
    • Actions
      • Set WindFury_Caster[(Player number of (Owner of (Learning Hero)))] = (Learning Hero)
What I'm trying to ask if this ability is user friendly, it's like bash, but gives you a bloodlust buff.



Thanks to Yearight for giving me the trigger to play with

Well the fact is its not MUI. Mui is actually meaning Multi-Unit-Instance, meaning it doesnt matter what unit or what player who uses the trigger. It can therefor be accessable by two units owned by the same player, if you want to.

The spell is however Multi-Player-Instance, MPI, Which allows it to work for many players.
Though, a spell like this could be messed up if you use wait actions in it (but you arent so never mind).

Also keep in mind that it could be bugged sometimes, because the fact is, you are using some globals without arrays. If you want to be 100% sure it is going to work MPI always, use
  • Set Windfury_CasterPoint[array] = .......
  • Set WindFury_CasterUnit[array] = .......
Hm but, all these actions are called within a millisecond or something.
The chance of bugging itelf is not very great.

/regards
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Wc3 engine cannot execute more than one function at a time so such a trigger is MUI(for all the units in the array, which as I said is stupid).
Not to use an array, you need to check something like is level of ability more than 1(samo goes for buffs in jass) or does unit have a buff(in gui).
Also do not use
Unit - Order WindFury_CasterUnit to Orc Shaman - Bloodlust WindFury_Caster[(Player number of (Owner of (Attacking unit)))]
use
Unit - Order WindFury_CasterUnit to Orc Shaman - Bloodlust attacking unit
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Well, yeah I am not sure, but there are not many things that can execute lots of things at the same time.
Anyway two different events will not happen in the same time.
Like units 1 and 2 from the array attacking.
Absolutely always one of them attacks/casts or whatever before the other.
 
Status
Not open for further replies.
Top