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

I need help on solving the MUI QWER blizzard spells with slow

Status
Not open for further replies.
Level 2
Joined
Jul 15, 2016
Messages
26
Hi I was making a spell call blizzard.
Calls down waves of freezing ice shards that damage units in a target area and slows their movement by 25%.

I use the blizzard adding freeze effect(slow aura)(GUI)


(The important part)
1.The game is where heroes buy the skill at shop and heroes can acquire up to 4 slots that is QWER. I have a set of qwer blizzard here.
2.Long time ago I usually use the GUI to make spell, until one day I found out that the GUI is meant for single person use only and the MUI is for multi instances use. Now, I decided to try turning my trigger GUI to MUI.
3.The blizzard have add slow effect, there is where i add the dummy there, there is another trigger that orders the system kill the dummy when the caster stop or finished the casting.

I started to change all the GUI spells to MUI, starting with blizzard. I knew there is something wrong here and I don't know here is it, so seek out for help. Feel free to correct me.:grin:

  • PENDINGBLIZARD
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Blizzard Q
          • (Ability being cast) Equal to Blizzard W
          • (Ability being cast) Equal to Blizzard E
          • (Ability being cast) Equal to Blizzard R
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Blizzard Q
        • Then - Actions
          • Set blizzard_index = (blizzard_index + 1)
          • Set blizzard_caster[blizzard_index] = (Triggering unit)
          • Set blizzard_dummy[blizzard_index] = (Last created unit)
          • Set blizzard_temploc = (Position of blizzard_caster[blizzard_index])
          • Unit - Create 1 DUMMY for (Owner of (Triggering unit)) at BLIZZARD_TEMPLOC facing Default building facing degrees
          • Unit - Add Blizzard Slow Aura (Blizzard) to BLIZZARD_DUMMY
          • Unit - Set level of Blizzard Slow Aura (Blizzard) for BLIZZARD_DUMMY to (Level of (Ability being cast) for BLIZZARD_UNIT)
          • Unit - Add a 10.10 second Generic expiration timer to BLIZZARD_DUMMY
          • Custom script: call RemoveLocation(udg_BLIZZARD_TEMPLOC)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Blizzard W
            • Then - Actions
              • Set blizzard_index = (blizzard_index + 1)
              • Set blizzard_caster[blizzard_index] = (Triggering unit)
              • Set blizzard_dummy[blizzard_index] = (Last created unit)
              • Set blizzard_temploc = (Position of blizzard_caster[blizzard_index])
              • Unit - Create 1 DUMMY for (Owner of (Triggering unit)) at BLIZZARD_TEMPLOC facing Default building facing degrees
              • Unit - Add Blizzard Slow Aura (Blizzard) to BLIZZARD_DUMMY
              • Unit - Set level of Blizzard Slow Aura (Blizzard) for BLIZZARD_DUMMY to (Level of (Ability being cast) for BLIZZARD_UNIT)
              • Unit - Add a 10.10 second Generic expiration timer to BLIZZARD_DUMMY
              • Custom script: call RemoveLocation(udg_BLIZZARD_TEMPLOC)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Blizzard E
                • Then - Actions
                  • Set blizzard_index = (blizzard_index + 1)
                  • Set blizzard_caster[blizzard_index] = (Triggering unit)
                  • Set blizzard_dummy[blizzard_index] = (Last created unit)
                  • Set blizzard_temploc = (Position of blizzard_caster[blizzard_index])
                  • Unit - Create 1 DUMMY for (Owner of (Triggering unit)) at BLIZZARD_TEMPLOC facing Default building facing degrees
                  • Unit - Add Blizzard Slow Aura (Blizzard) to BLIZZARD_DUMMY
                  • Unit - Set level of Blizzard Slow Aura (Blizzard) for BLIZZARD_DUMMY to (Level of (Ability being cast) for BLIZZARD_UNIT)
                  • Unit - Add a 10.10 second Generic expiration timer to BLIZZARD_DUMMY
                  • Custom script: call RemoveLocation(udg_BLIZZARD_TEMPLOC)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Ability being cast) Equal to Blizzard R
                    • Then - Actions
                      • Set blizzard_index = (blizzard_index + 1)
                      • Set blizzard_caster[blizzard_index] = (Triggering unit)
                      • Set blizzard_dummy[blizzard_index] = (Last created unit)
                      • Set blizzard_temploc = (Position of blizzard_caster[blizzard_index])
                      • Unit - Create 1 DUMMY for (Owner of (Triggering unit)) at BLIZZARD_TEMPLOC facing Default building facing degrees
                      • Unit - Add Blizzard Slow Aura (Blizzard) to BLIZZARD_DUMMY
                      • Unit - Set level of Blizzard Slow Aura (Blizzard) for BLIZZARD_DUMMY to (Level of (Ability being cast) for BLIZZARD_UNIT)
                      • Unit - Add a 10.10 second Generic expiration timer to BLIZZARD_DUMMY
                      • Custom script: call RemoveLocation(udg_BLIZZARD_TEMPLOC)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
        • Else - Actions
          • Trigger - Turn on PENDINGBlizzard Stop or Cancel <gen>

  • PENDINGBlizzard Stop or Cancel
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Blizzard Q
          • (Ability being cast) Equal to Blizzard W
          • (Ability being cast) Equal to Blizzard E
          • (Ability being cast) Equal to Blizzard R
    • Actions
      • Unit - Remove blizzard_dummy[blizzard_index] from the game
      • Trigger - Turn off PENDINGBlizzard Stop or Cancel <gen>
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,659
GUI stands for Graphical User Interface:

When people talk about GUI in regards to Warcraft 3 modding they're talking about using the Trigger Editor in order to create Triggers, Events, Conditions, and Actions as opposed to coding everything with either the Jass or Lua programming languages. The upside of GUI is that it's easy to use. The downside of GUI is that it lacks the efficiency and flexibility that coding things from scratch offers. Maps use the Jass language by default but Lua is far superior.

You basically have three options to choose from when creating the logic for your map: GUI, coding, or a mixture of both.

MUI stands for Multi-Unit-Instanceable and MPI stands for Multi-Player-Instanceable, which just means that a trigger can work for multiple units/players at the same time without any conflicting issues.

Regarding your triggers, you're making some mistakes. A lot of the variables are using the wrong name and are in the wrong position. You're also using unnecessary If Then Else statements as well as failing to use their Else - Actions properly. The way you turn on/off the trigger is not MUI safe. The way you reference blizzard_dummy[blizzard_index] in the Stop/Cancel trigger is wrong since blizzard_dummy[blizzard_index] will always be equal to the the most recently created dummy unit.

This spell can be simplified with a Unit Indexing system since all you need to do is link the Dummy unit to the Caster:
  • Blizzard Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Blizzard Q
          • (Ability being cast) Equal to Blizzard W
          • (Ability being cast) Equal to Blizzard E
          • (Ability being cast) Equal to Blizzard R
    • Actions
      • Set blizzard_caster = (Triggering unit)
      • Set blizzard_cv = (Custom value of blizzard_caster)
      • Set blizzard_temploc = (Position of blizzard_caster)
      • Unit - Create 1 DUMMY for (Owner of (blizzard_caster)) at blizzard_temploc facing Default building facing degrees
      • Set blizzard_dummy[blizzard_cv] = (Last created unit)
      • Unit - Add Blizzard Slow Aura (Blizzard) to blizzard_dummy[blizzard_cv]
      • Unit - Set level of Blizzard Slow Aura (Blizzard) for blizzard_dummy[blizzard_cv] to (Level of (Ability being cast) for blizzard_caster)
      • Unit - Add a 10.10 second Generic expiration timer to blizzard_dummy[blizzard_cv]
      • Custom script: call RemoveLocation(udg_blizzard_temploc)
  • Blizzard Stop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Blizzard Q
          • (Ability being cast) Equal to Blizzard W
          • (Ability being cast) Equal to Blizzard E
          • (Ability being cast) Equal to Blizzard R
    • Actions
      • Unit - Remove blizzard_dummy[Custom value of (Triggering unit)] from the game
Unit Indexing allows us to save data directly to our units by using their Custom Value as the [Index] in our Variable Arrays. How it works is the system assigns each unit on the map a unique custom value at the start of the game and then proceeds to do the same for any newly created units. Note that this will cause problems if you were setting Custom Value yourself in any of your triggers, but don't worry, you can make those triggers use the system instead. It also recycles unused Custom Values so that you never have to worry about reaching an array size limit. The limit is 8191 in older versions and 32,764 in newer versions.

I'm using the system to link the Dummy unit to the Caster so that as long as we have a reference to the Caster we can also get it's Dummy unit. This method works because the spell is channeling and the Dummy unit is removed when it stops, therefore your Hero can only ever create and track 1 Dummy unit at a time. This method would break if your Hero could somehow have multiple Blizzards running at the same time because blizzard_dummy[] can only track 1 Dummy per Hero.

Some spells will require Dynamic Indexing (link in my signature) in order to be MUI. Learning how to use Dynamic Indexing in combination with Unit Indexing will allow you to do just about anything. You can also use a Hashtable if you don't wish to use a Unit Indexing system. I can see you're on an older version of Warcraft 3 so make sure you find a system that is compatible.
 
Last edited:
Status
Not open for further replies.
Top