• 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.

Problem with the MUI first try

Status
Not open for further replies.
Level 8
Joined
Aug 15, 2010
Messages
216
good evening brothers! as you may know, i recently started my new map, veramarth.
i uploaded it here for some time now, 5 days or so, and i promissed my friends a new hero for tomorrow , but i'm stuck at a trigger, for the spell "thunder form" , it was my first try at the MUI, and i tried to copy the triggers from a spell i imported, dash, to learn it, but doesnt work, here. take a look:
  • Thunder form
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Form
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DashInteger[0] Equal to 0
        • Then - Actions
          • Trigger - Turn on Thunder form loop <gen>
        • Else - Actions
      • Set DashInteger[0] = (DashInteger[0] + 1)
      • Set DashInteger[1] = (DashInteger[1] + 1)
      • Set DashCaster[DashInteger[1]] = (Triggering unit)
      • Set CastinHeroAgi = (Real((Agility of DashCaster[DashInteger[1]] (Include bonuses))))
      • Set CastinHeroInt = (Real((Intelligence of DashCaster[DashInteger[1]] (Include bonuses))))
      • Set HellionboltLvl = (Level of Thunder Form for DashCaster[1])
      • Set Region = (Region centered at (Position of (Casting unit)) with size (500.00, 500.00))
      • Special Effect - Create a special effect attached to the chest of (Casting unit) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Player Group - Pick every player in (All enemies of (Owner of (Casting unit))) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units in Region owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing (0.50 x ((CastinHeroAgi + CastinHeroInt) x (Real(HellionboltLvl)))) damage of attack type Spells and damage type Normal
      • Special Effect - Destroy (Last created special effect)
      • Set DashSpeed[DashInteger[1]] = (Current movement speed of DashCaster[DashInteger[1]])
      • Unit - Set DashCaster[DashInteger[1]] movement speed to ((Current movement speed of (Triggering unit)) + (100.00 x (Real(HellionboltLvl))))
      • Unit - Turn collision for DashCaster[DashInteger[1]] Off
      • Animation - Change DashCaster[DashInteger[1]]'s animation speed to 200.00% of its original speed
      • Animation - Change DashCaster[DashInteger[1]]'s vertex coloring to (60.00%, 60.00%, 100.00%) with 50.00% transparency
the second trigger, the loop is
  • Thunder form loop
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DashInteger[2]) from 1 to DashInteger[1], do (Actions)
        • Loop - Actions
          • Unit - Turn collision for DashCaster[DashInteger[2]] On
          • Animation - Change DashCaster[DashInteger[2]]'s animation speed to 100.00% of its original speed
          • Animation - Change DashCaster[DashInteger[2]]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
          • Unit - Set DashCaster[DashInteger[2]] movement speed to DashSpeed[DashInteger[2]]
      • Set DashInteger[1] = 0
      • Trigger - Turn off (This trigger)
 
Anything you use twice or more should be stored in a variable and the variable should be used.

Example: (0.50 x ((CastinHeroAgi + CastinHeroInt) x (Real(HellionboltLvl))))
casting unit / owner of casting unit. And so on.

Also don't use casting unit use triggering unit.

Look at my tutorial things a guier should know. The chapter on how to index. It will help you with indexing.

Your current problem is that you do not index / de-index anything. You just run the trigger then run the other trigger and end it.

Also in any MUI trigger every 5.00 seconds is a very bad idea.
 
Level 7
Joined
Mar 6, 2006
Messages
282
whats the usage of tempint in your indexing?

That's to replace Integer A, in GUI. In a For Loop, you usually do:

  • For each (Integer A) from x to x, do (Actions)
Which is bad for MUI because "Integer A" is actually a variable used for looping and you may be using that in a number of other places in your map.

You want your own integer for looping, so you do:

  • For each (Integer Variable) from x to x, do (Actions)
And set the variable to your own personal looping integer for this trigger.
 
Status
Not open for further replies.
Top