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

[GUI] Dustwave System v1.3

I found there's many spells uses dustwave model that expanding and makes the spell more nice. Instead of coding it again and again to make expanding dustwave, this system will reduces your time in making spell :D.

  • Features
    - Expanding and smalling mode
    - Have height
    - Fade in/out
    - Easy to register new instance
    - Easy to import
    - One trigger
  • Code
    • Dustwave GUI
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- DO NOT FORGET TO INITIALIZE SOME VARIABLES --------
        • -------- SEE EXAMPLE INIT TRIGGER --------
        • -------- ------------------------------------------------------ --------
        • -------- Required variables to register --------
        • -------- Dust_NewLoc - determines the spawn location --------
        • -------- Dust_NewExpand - if "True", the dustwave will expand --------
        • -------- Dust_NewFadeOut - if "True", the dustwave will fading out --------
        • -------- Dust_NewDuration - determines how long the dustwave expanding/smalling due to Dust_ScaleSpeed --------
        • -------- if you set the dummy death time in Object Editor to 0, the dustwave will instantly gone due to Dust_Duration --------
        • -------- Dust_NewScale - determines the starting scale of the dustwave --------
        • -------- Dust_NewScaleSpeed - determines how fast the dustwave expanding/smalling --------
        • -------- Dust_NewTransparency - determines the starting transparency of the dustwave --------
        • -------- Dust_NewTransSpeed - determines how fast the dustwave fading in/out --------
        • -------- Dust_NewHeight - determines the starting height of the dustwave --------
        • -------- ------------------------------------------------------ --------
        • -------- ------------------------------------------------------ --------
        • -------- DO NOT TOUCH ANYTHING BELOW IF YOU DO NOT KNOW WHAT YOU ARE DOING! :D --------
        • Custom script: call ExecuteFunc("Dust_Init")
        • Custom script: return
        • Set Dust_Timer = Dust_Timer
        • Custom script: endfunction
        • Custom script: function Dust_Periodic takes nothing returns nothing
        • Set Dust_Index = Dust_Next[0]
        • Custom script: loop
        • Custom script: exitwhen udg_Dust_Index == 0
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Dust_Duration[Dust_Index] Greater than 0.00
            • Dust_Scale[Dust_Index] Greater than or equal to 0.00
            • Dust_Transparency[Dust_Index] Less than 100.00
          • Then - Actions
            • Set Dust_Scale[Dust_Index] = (Dust_Scale[Dust_Index] + Dust_ScaleSpeed[Dust_Index])
            • Custom script: call SetUnitScale(udg_Dust_Dummy[udg_Dust_Index], udg_Dust_Scale[udg_Dust_Index], 0, 0)
            • Set Dust_Transparency[Dust_Index] = (Dust_Transparency[Dust_Index] + Dust_TransSpeed[Dust_Index])
            • Animation - Change Dust_Dummy[Dust_Index]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Dust_Transparency[Dust_Index]% transparency
            • Set Dust_Duration[Dust_Index] = (Dust_Duration[Dust_Index] - Dust_Interval)
          • Else - Actions
            • Unit - Kill Dust_Dummy[Dust_Index]
            • Set Dust_Recycle[Dust_Index] = Dust_Recycle[0]
            • Set Dust_Recycle[0] = Dust_Index
            • Set Dust_Prev[Dust_Next[Dust_Index]] = Dust_Prev[Dust_Index]
            • Set Dust_Next[Dust_Prev[Dust_Index]] = Dust_Next[Dust_Index]
            • Set Dust_ActiveInstance = (Dust_ActiveInstance - 1)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Dust_ActiveInstance Equal to 0
              • Then - Actions
                • Custom script: call PauseTimer(udg_Dust_Timer)
              • Else - Actions
        • Set Dust_Index = Dust_Next[Dust_Index]
        • Custom script: endloop
        • Custom script: endfunction
        • Custom script: function Dust_New takes nothing returns boolean
        • Set Dust_NewIndex = Dust_Recycle[0]
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Dust_NewIndex Equal to 0
          • Then - Actions
            • Set Dust_InstanceCount = (Dust_InstanceCount + 1)
            • Set Dust_NewIndex = Dust_InstanceCount
          • Else - Actions
            • Set Dust_Recycle[0] = Dust_Recycle[Dust_NewIndex]
        • Set Dust_Next[Dust_NewIndex] = 0
        • Set Dust_Prev[Dust_NewIndex] = Dust_Prev[0]
        • Set Dust_Next[Dust_Prev[0]] = Dust_NewIndex
        • Set Dust_Prev[0] = Dust_NewIndex
        • Custom script: set udg_Dust_Dummy[udg_Dust_NewIndex] = CreateUnit(udg_Dust_DefaultOwner, udg_Dust_DummyType, GetLocationX(udg_Dust_NewLoc), GetLocationY(udg_Dust_NewLoc), GetRandomReal(0, 360))
        • Custom script: call SetUnitScale(udg_Dust_Dummy[udg_Dust_NewIndex], udg_Dust_NewScale, 0, 0)
        • Custom script: call SetUnitFlyHeight(udg_Dust_Dummy[udg_Dust_NewIndex], udg_Dust_NewHeight, 0)
        • Animation - Change Dust_Dummy[Dust_NewIndex]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Dust_NewTransparency% transparency
        • Set Dust_Duration[Dust_NewIndex] = Dust_NewDuration
        • Set Dust_Scale[Dust_NewIndex] = Dust_NewScale
        • Set Dust_Transparency[Dust_NewIndex] = Dust_NewTransparency
        • Custom script: if (udg_Dust_NewExpand) then
        • Set Dust_ScaleSpeed[Dust_NewIndex] = Dust_NewScaleSpeed
        • Custom script: else
        • Custom script: set udg_Dust_ScaleSpeed[udg_Dust_NewIndex] = -udg_Dust_NewScaleSpeed
        • Custom script: endif
        • Custom script: if (udg_Dust_NewFadeOut) then
        • Set Dust_TransSpeed[Dust_NewIndex] = Dust_NewTransSpeed
        • Custom script: else
        • Custom script: set udg_Dust_TransSpeed[udg_Dust_NewIndex] = -udg_Dust_NewTransSpeed
        • Custom script: endif
        • Set Dust_ActiveInstance = (Dust_ActiveInstance + 1)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Dust_ActiveInstance Equal to 1
          • Then - Actions
            • Custom script: call TimerStart(udg_Dust_Timer, udg_Dust_Interval, true, function Dust_Periodic)
          • Else - Actions
        • Custom script: return false
        • Custom script: endfunction
        • Custom script: function Dust_Init takes nothing returns nothing
        • Custom script: if (udg_Dust_Timer == null) then
        • Custom script: set udg_Dust_Timer = CreateTimer()
        • Custom script: endif
        • Custom script: call TriggerClearActions(gg_trg_Dustwave_GUI)
        • Custom script: call TriggerClearConditions(gg_trg_Dustwave_GUI)
        • Custom script: call TriggerAddCondition(gg_trg_Dustwave_GUI, Filter(function Dust_New))
  • Register Example
    • Example 1
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Example 1
      • Actions
        • -------- ------------------------------------------------------ --------
        • -------- Sets all required registering variables --------
        • -------- ------------------------------------------------------ --------
        • -------- Get the targeted unit coordinates position X/Y --------
        • Set Dust_NewLoc = (Position of (Target unit of ability being cast))
        • Set Dust_NewExpand = True
        • Set Dust_NewFadeOut = True
        • Set Dust_NewDuration = 0.50
        • Set Dust_NewScale = 0.50
        • Set Dust_NewScaleSpeed = 0.20
        • Set Dust_NewTransSpeed = 0.15
        • Set Dust_NewTransparency = 0.00
        • Set Dust_NewHeight = 0.00
        • -------- After all are setted, run the trigger (CHECKING CONDITIONS) --------
        • Trigger - Run Dustwave GUI <gen> (checking conditions)
        • -------- ------------------------------------------------------ --------
        • -------- Remove unnecessary location --------
        • Custom script: call RemoveLocation(udg_Dust_NewLoc)
  • Initialize Example
    • Example Init
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- ------------------------------------------------------ --------
        • -------- First you must set all of these variables before using the system --------
        • -------- ------------------------------------------------------ --------
        • -------- Configuration --------
        • -------- The first two variables may needed to be setted after imported to your map --------
        • Set Dust_DummyType = Dustwave Dummy
        • Set Dust_DefaultOwner = Neutral Passive
        • -------- Note: This variable should not be changed to lower value, it will make the game laggy --------
        • -------- You can set it to higher value, but not too high to reduce the lag. Recommended value is 0.03 --------
        • Set Dust_Interval = 0.03
        • -------- End of Configuration --------
        • -------- ------------------------------------------------------ --------
  • Credits
    - PurgeandFire for giving lovely review xD
  • Changelog
    - v1.0: Initial version
    - v1.1: More fast. New feature: fading in/out. Running the trigger must CHECKING CONDITIONS. Some configurable variables must be initialized in another trigger
    - v1.2: Fixed some grammars, now i believe this system is very import-able if you follow the instruction perfectly.
    - v1.3: Only the variables that aren't created automatically are listed. No longer use reals to create dustwave, but locations (more GUI-friendly).

Note: I still don't know the author of the dustwave model for this system. Please tell me if you know him or if it's you

Keywords:
System, Dustwave, GUI
Contents

Test Map (Map)

Reviews
18:02, 25th Sep 2013 PurgeandFire: Perfect. It looks a lot better now. Approved! (Old) Review: http://www.hiveworkshop.com/forums/spells-569/gui-dustwave-system-v1-2-a-239632/index2.html

Moderator

M

Moderator

18:02, 25th Sep 2013
PurgeandFire: Perfect. It looks a lot better now. Approved!

(Old) Review:
http://www.hiveworkshop.com/forums/spells-569/gui-dustwave-system-v1-2-a-239632/index2.html
 
A pretty nice system. It is coded well.

There are only a few things you need to fix:
  • You don't need to list all the variables. You only need to list the ones you don't use in GUI functions, because the rest will be generated anyway. It is not the worst thing ever since that code isn't reached, but it is always good to chip off a few extra lines.
  • You should take a location input instead of reals. I know that reals are more efficient, but for this to be truly GUI-friendly, it should support locations. Why? Because GUI doesn't take coordinates as input--they only take locations. Thus, it is inconvenient to have to set the location, and then set the X and Y. That should be handled within the system itself.

    Think about it this way. Some kid makes lemonade for people, but he doesn't have anything but the water, sugar, and a spoon. Thus, he asks people to bring him lemon juice so that he can sell them the lemonade. That is kind of like the system--it is asking them to bring something obscure that they would have to go out of their way to get. Wouldn't it make more sense for him to just ask for lemons?

    Now, that anecdote may or may not have made any sense, but taking locations as input for a GUI system is better in the long run. You can still use the reals internally; just use GetLocationX() and GetLocationY() (or the GUI equivalents).

Fix those and I'll approve.
 
Top