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

Aura System in GUI

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
- I saw the two aura systems in this forum, they're all great. But they're jass, I isn't good at jass, and neither the others. So I decided to make this aura system, it's simpler than the two, may be it's useful for some people, like me. With this system, the user can easily turn any active-unit-target ability into an aura.

- Require: JNGP 1.5d or newer version of JNGP

- Hope this can help :thumbs_up:

JASS:
                             SYSTEM AURA
                           by LeoNguyen112
//---------Installation-----------------------------------------------//
//    Go to File -> Preferences -> Make sure you had checked          //
//"Automatically create unknown variables while pasting trigger data" //
//    Copy the category named System into your map.                   //
//--------------------------------------------------------------------//
//---------Usage------------------------------------------------------//
//    When you want to make a custom aura, you have to set these      //
//variables below:                                                    //
// -Aura_Max : the maximum of aura your map have.                     //
// -Aura_Aura : the aura ability. This ability should be a passive    //
//                ability and have only effect below hero/unit        //
// -Aura_Ability : the ability effects on units under the aura.       //
// -Aura_Buff : the buff effects on units under the aura.             //
// -Aura_EnemyOrAlly : True; aura effect on enemies                   //
// -Aura_EnemyOrAlly : False; aura effect on allies                   //
// -Aura_Range : area of effect.                                      //
// -Aura_Order : the string order of Aura_Ability. It can be found in //
//                Oject Editor, Text - Order String  - Use/Turn On    //
//--------------------------------------------------------------------//
//--------------------------------------------------------------------//

  • Aura Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Aura_Loop) from 1 to Aura_Max, do (Actions)
        • Loop - Actions
          • Set Aura_Group[1] = (Units in (Playable map area) matching ((Level of Aura_Aura[Aura_Loop] for (Matching unit)) Greater than 0))
          • Unit Group - Pick every unit in Aura_Group[1] and do (Actions)
            • Loop - Actions
              • Set Aura_Unit = (Picked unit)
              • Set Aura_Point = (Position of Aura_Unit)
              • Set Aura_Group[2] = (Units within Aura_Range[Aura_Loop] of Aura_Point matching (((Matching unit) belongs to an enemy of (Owner of Aura_Unit)) Equal to Aura_EnemyOrAlly[Aura_Loop]))
              • Unit Group - Pick every unit in Aura_Group[2] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • ((Picked unit) has buff Aura_Buff[Aura_Loop]) Equal to False
                          • (Level of Aura_Aura[Aura_Loop] for Aura_Unit) Greater than (For (Picked unit) the level of Aura_Buff[Aura_Loop])
                      • ((Picked unit) is A structure) Equal to False
                      • ((Picked unit) is Mechanical) Equal to False
                      • ((Picked unit) is Magic Immune) Equal to False
                      • ((Picked unit) is alive) Equal to True
                    • Then - Actions
                      • Unit - Create 1 Dummy Unit for (Owner of Aura_Unit) at Aura_Point facing Default building facing degrees
                      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                      • Unit - Add Aura_Ability[Aura_Loop] to (Last created unit)
                      • Unit - Set level of Aura_Ability[Aura_Loop] for (Last created unit) to (Level of Aura_Aura[Aura_Loop] for Aura_Unit)
                      • Unit - Order (Last created unit) to Aura_Order[Aura_Loop] (Picked unit)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_Aura_Point)
              • Custom script: call DestroyGroup(udg_Aura_Group[2])
          • Custom script: call DestroyGroup(udg_Aura_Group[1])
          • Set Aura_Group[1] = (Units in (Playable map area) matching (((Matching unit) has buff Aura_Buff[Aura_Loop]) Equal to True))
          • Unit Group - Pick every unit in Aura_Group[1] and do (Actions)
            • Loop - Actions
              • Set Aura_Unit = (Picked unit)
              • Set Aura_Point = (Position of Aura_Unit)
              • Set Aura_Group[2] = (Units within Aura_Range[Aura_Loop] of Aura_Point)
              • Unit Group - Pick every unit in Aura_Group[2] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • ((Picked unit) is dead) Equal to True
                          • ((Picked unit) belongs to an ally of (Owner of Aura_Unit)) Equal to Aura_EnemyOrAlly[Aura_Loop]
                          • (Level of Aura_Aura[Aura_Loop] for (Picked unit)) Equal to 0
                    • Then - Actions
                      • Unit Group - Remove (Picked unit) from Aura_Group[2]
                    • Else - Actions
              • If ((Number of units in Aura_Group[2]) Equal to 0) then do (Unit - Remove Aura_Buff[Aura_Loop] buff from Aura_Unit) else do (Do nothing)
              • Custom script: call RemoveLocation(udg_Aura_Point)
              • Custom script: call DestroyGroup(udg_Aura_Group[2])
          • Custom script: call DestroyGroup(udg_Aura_Group[1])
  • Aura Setting
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Aura_Max = 2
      • -------- Slow Aura --------
      • Set Aura_Aura[1] = Devotion Aura
      • Set Aura_Ability[1] = Slow (Neutral Hostile)
      • Set Aura_Buff[1] = Slow
      • Set Aura_EnemyOrAlly[1] = True
      • Set Aura_Range[1] = 450.00
      • Set Aura_Order[1] = slow
      • -------- Aura of Regeneration --------
      • Set Aura_Aura[2] = Endurance Aura
      • Set Aura_Ability[2] = Rejuvenation (Neutral Hostile)
      • Set Aura_Buff[2] = Rejuvenation
      • Set Aura_EnemyOrAlly[2] = False
      • Set Aura_Range[2] = 900.00
      • Set Aura_Order[2] = rejuvination
Keywords:
aura, system, range, spell, LeoNguyen112, passive
Contents

System - Aura in GUI (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Moderator: Pharaoh_ Date: 03:49, 24th Apr 2012 This is very simple and inefficient. • You use two instances of a variable to refer to different auras. • You globally pick units...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

160036-albums4747-picture55861.png

Moderator: Pharaoh_
Date: 03:49, 24th Apr 2012

Review
This is very simple and inefficient.
• You use two instances of a variable to refer to different auras.
• You globally pick units; you should assign them in the group (Unit Group - Add (Triggering unit) to UnitGroup), once they have learned the skill or once they have entered the map (by checking if they already are in the group) [second case would apply to unit that are non-hero, in case one of them possesses such an aura].
• You could use a hashtable and save the values required to the rawcode of each aura ability, instead of the way they are currently configured. This way, you could most possibly merge the aura groups.

There are way better aura systems in the Spells section already and far more efficient. This resource requires heavy improvements and it's one of those moments that you wonder if GUI itself is the optimal solution to achieve the desired effect flawlessly.
 
Really you'd only /actually/ need a single loop to handle -every- aura you added on, you just need to store everything in variables - including wether it effects allies/enemies/AOE/etc. They way you'd split Allies/Enemy auras would be through an ID variable to determine which they effect by having an IF statement in the loop

You could then assign an aura to a variable (matching how many auras involving this loop the unit has) i.e. have an aura counting variable (to keep track of how many auras are on a unit) and then seperate ones to assign which aura goes where each aura belongs (add them onto the end. So in this case say you had this slow aura and rejuvination aura: you learn slow first, the variable containing amount of auras becomes one (for the unit), and the position of this aura is also one (also linked to the unit), you then assign other variables which'd have to be 2D - first to where it belongs in the overall group, and then secondly which aura it is effecting. This'd then be repeated to apply to every new aura added

(This is all assuming you're not using unit groups but rather running a variable from 1 to (number of units in the array)


This is assuming that you're dynamically arraying units

Note: This may not be accurate/Actually work considering I just typed this all out as opposed to making it in WE

  • Ability Learnt
    • Events
      • Unit - a unit Learns a skill
    • Conditions
    • Actions
      • For each (Indexer) from 1 to Amount_of_Auras do (actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Aura(Indexer) = Learnt Ability
            • Then - Actions
              • -------- Saving the number of the ability --------
              • Set Aura_ID = Indexer
              • Set bFound = False
              • Set Temp_Unit = (Triggering unit)
              • -------- Checking if the unit is already assigned an index --------
              • -------- Saving the point at which it was found if it was --------
              • For each (Indexer) from 1 to Aura_Index do (actions)
                • Loop - actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Aura_Unit(Indexer) = Temp_Unit
                    • Then - Actions
                      • Set bFound = True
                      • Set iPoint = Indexer
                    • Else - Actions
              • -------- Checking if the unit /was/ found --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • bFound = True
                • Then - Actions
                  • Set Save_Aura_Index = Aura_Index
                  • Set Aura_Index = iPoint
                • Else - Actions
                  • Set Aura_Index = Aura_Index + 1
                  • Set Save_Aura_Index = Aura_Index
              • -------- Setting up the new Indexes --------
              • Set Aura_Unit(Aura_Index) = Triggering Unit
              • -------- Increasing the amount of auras on the unit --------
              • Set Aura_Count(Aura_Index) = AuraCount(Aura_Index) + 1
              • -------- Applying stats of the aura to the correct aura number --------
              • Set Aura_AOE(Aura_Count(Aura_Index)) = Aura_Stats_AOE(Aura_ID)
              • Set Aura_Aura_Name(Aura_Count(Aura_Index)) = Aura_Stats_Name(Aura_ID)
              • Set Aura_Aura_Effect(Aura_Count(Aura_Index)) = Aura_Stats_Effect(Aura_ID)
              • Set Aura_Targets(Aura_Count(Aura_Index)) = Aura_Stats_Targets(Aura_ID)
              • Set Etc.
              • -------- Resetting the Aura_Index --------
              • Set Aura_Index = Save_Aura_Index
              • Else - Actions
Note that Aura_Targets(Aura_Count(Aura_Index)) would be either 1 or 2 (or 0 or 1 or whatever to determine wether it effects enemies or allies in the loop trigger)

Additionally: Auras would all have to be set up in their own little section which would also have to contain setting their position in the Aura(Index) variable I.e. Aura(1) = Rejuvination Aura


I would go further to explain this all, however then I'd basically be turning it into my own system working how I'd want it to
 
@ Tank-Commander:
I had thought about that way before, but the problem is how I can set this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • Aura(Indexer) = Learnt Ability
I usually use loop in my spell or system, since I could not set the condition above, I changed the way to make it.

Hero Skill comparison

  • (Learned Hero Skill) Equal to Aura(Indexer)
Just don't do an ability comparison - use a hero skill comparison
 
Why does it say it requires JNGP? It's pure GUI isn't it?

I've used JNGP for a long time, and I don't sure that pure GUI has a condition
(For (Unit) the level of Buff) Equal to 0.
So it's better to set the JNGP in requirement :grin:
Hero Skill comparison

  • (Learned Hero Skill) Equal to Aura(Indexer)
Just don't do an ability comparison - use a hero skill comparison

But I can't set (Learned Hero Skill) = variable. I don't see any place in Hero Skill Comparison to put a variable Aura[Indexer] :( .
 
Top