• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Is this MUI/MPI?

Status
Not open for further replies.
Level 15
Joined
Jan 27, 2007
Messages
948
Hello!
I made a skill which temprarily multiply your int x2 and after 30 sec the int goes back to normal. The trigger is right there. The question is: Is this MUI/MPI?

Thanks in advance!

  • Divine Wisdom
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Blast
    • Actions
      • Hashtable - Save (Intelligence of (Casting unit) (Exclude bonuses)) as 1 of ID in Hashtable
      • Hero - Modify Intelligence of (Casting unit): Add (Load 1 of ID from Hashtable)
      • Wait 30.00 game-time seconds
      • Hero - Modify Intelligence of (Casting unit): Subtract (Load 1 of ID from Hashtable)
      • Hashtable - Clear all child hashtables of child ID in Hashtable
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
No. Hashtables aren't some magic MUI machine, they are just basically a big two-dimensional array. You still need some way of guaranteeing the instance will be unique or at least unique to a unit. For example, in this case you could replace the "1" key with the unit's ID.

The simpler method is to just use a local variable, but you'd need to use JASS for that.
 
  • Divine Wisdom
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Blast
    • Actions
      • Hashtable - Save (Intelligence of (Triggeringg unit) (Exclude bonuses)) as 1 of (Key(Triggering Unit)) in Hashtable
      • Hero - Modify Intelligence of (Triggering unit): Add (Load 1 of (Key(Triggering Unit)) from Hashtable)
      • Wait 30.00 game-time seconds
      • Hero - Modify Intelligence of (Triggering unit): Subtract (Load 1 of (Key(Triggering Unit)) from Hashtable)
      • Hashtable - Clear all child hashtables of child (Key(Triggering Unit)) in Hashtable
Always use Triggering unit instead of casting unit. It designs the same unit (when casting unit work) and save things at the Unit's handle.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
The classic way to use locals in GUI with minimal JASS knowledge is this:

Step 1: Create a global variable called YourVariableName

Step 2: Add this to the start of the trigger:

  • Custom script: local YourVariableType udg_YourVariableName
So for example, in this case you could do

{Variable called HeroInt}

  • Actions
    • Custom script: local integer udg_HeroInt
    • Set HeroInt = (Intelligence of (Triggering Unit) (Exclude Bonuses))
    • Hero - Modify Intelligence of (Triggering Unit): Add HeroInt
    • Wait 30.00 game-time seconds
    • Hero - Modify Intelligence of (Triggering Unit): Subtract HeroInt
 
Level 15
Joined
Jan 27, 2007
Messages
948
  • Divine Wisdom
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Blast
    • Actions
      • Hashtable - Save (Intelligence of (Triggeringg unit) (Exclude bonuses)) as 1 of (Key(Triggering Unit)) in Hashtable
      • Hero - Modify Intelligence of (Triggering unit): Add (Load 1 of (Key(Triggering Unit)) from Hashtable)
      • Wait 30.00 game-time seconds
      • Hero - Modify Intelligence of (Triggering unit): Subtract (Load 1 of (Key(Triggering Unit)) from Hashtable)
      • Hashtable - Clear all child hashtables of child (Key(Triggering Unit)) in Hashtable
Always use Triggering unit instead of casting unit. It designs the same unit (when casting unit work) and save things at the Unit's handle.

How can I do this "(Key(Triggering Unit))"?


The classic way to use locals in GUI with minimal JASS knowledge is this:

Step 1: Create a global variable called YourVariableName

Step 2: Add this to the start of the trigger:

  • Custom script: local YourVariableType udg_YourVariableName
So for example, in this case you could do

{Variable called HeroInt}

  • Actions
    • Custom script: local integer udg_HeroInt
    • Set HeroInt = (Intelligence of (Triggering Unit) (Exclude Bonuses))
    • Hero - Modify Intelligence of (Triggering Unit): Add HeroInt
    • Wait 30.00 game-time seconds
    • Hero - Modify Intelligence of (Triggering Unit): Subtract HeroInt

I'll try that.
Edit: AWWWWWW YEAH!!!!!!! It works flawlessly!

Thanks guys! ^^ I'm really grateful!
 
Status
Not open for further replies.
Top