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

Astral Force V1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Meatmuffin
The user gathers star shaped missles in their vicinity created from Astral power and then proceeds to absorb their power creating a Supernova
-----------------------------------
-Creates 20 Projectiles within 600 AOE of the caster over 2 Seconds
-Caster can move during the spell
-After the last projectile has been created they will start to move towards the user
-If a projectile touches an enemy it will explode and disappear
-For each projectile that reaches the user one charge will be stored
-The supernova's AOE and Damage will vary depending in the charges stored
-----------------------------------
Damage per charge: 10/12/14/16/18
AOE Per Charge: 10/20/30/40/50

Preview - GIF


9af98e4340.gif



Triggers:

  • AFStart
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Astral Force
    • Actions
      • -------- First we set the basic Variables --------
      • Set AF_Index = (AF_Index + 1)
      • Set AF_MUI = (AF_MUI + 1)
      • -------- These two Integers are vital parts of a Indexing spell, allowing the MUI part to work --------
      • Set AF_Caster[AF_MUI] = (Triggering unit)
      • -------- Here we set which unit is casting the spell, using AF_MUI as the variable because every time the spell is activated AF_MUI will increase by 1 --------
      • Set AF_Damage_Set[AF_MUI] = (8.00 + (2.00 x (Real((Level of Astral Force for AF_Caster[AF_MUI])))))
      • -------- This is the calcualtion used to work out the amount of damage each charge will give to the Supernova --------
      • -------- It also sets the amount of damage a unit will recieve if it touches a star --------
      • Set AF_AOE_Set[AF_MUI] = (10.00 x (Real((Level of Astral Force for AF_Caster[AF_MUI]))))
      • -------- This sets how much each charge will increase the Supernova's AOE by --------
      • -------- It also sets the AOE of the stars explosions --------
      • Set AF_Star_AOE[AF_MUI] = 600.00
      • -------- This sets the size of the region in which the stars will appear --------
      • Set AF_Star_Movement[AF_MUI] = 25.00
      • -------- This sets the rate at which the stars will approach the caster --------
      • Set AF_Start_Limit[AF_MUI] = 20
      • -------- This sets the maximum amount of stars --------
      • Set Star_Movement_Check[AF_MUI] = False
      • -------- This tells the game whether the Stars should be moving or not, at the start they shouldn't be so it is set to false --------
      • Set AF_Star_Create_Time[AF_MUI] = 3
      • -------- This says how often a star will be created --------
      • -------- 3*0.03 = 0.09, 0.09*20 = 1.8 (I know it's not 2, but i dealing with 0.03 seconds, making it customisable whilst not using timers is annoying) --------
      • Set AF_ON[AF_MUI] = True
      • -------- This says whether or not the spells is considered "On" so it doesn't run the triggers for the spell if it is finished --------
      • -------- --------
      • Set Star_Create_Current_Time[AF_MUI] = 0
      • Set AF_Star_Amount[AF_MUI] = 0
      • Set AF_Charges[AF_MUI] = 0
      • -------- These are just setting used Integers to 0 before use --------
      • -------- --------
      • Custom script: set udg_AF_Star_Group[(udg_AF_MUI)] = CreateGroup()
      • -------- This gets rid of a bug with Unit Group arrays// first time using it here --------
      • -------- --------
      • -------- Now we start actually doing actions --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AF_MUI Equal to 1
        • Then - Actions
          • Trigger - Turn on AFLoop <gen>
        • Else - Actions
      • -------- If MUI is equal to one then the spell has been activated for the first time, so the loop will need to be turned on --------
Loop:
  • AFLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer AFLoop) from 1 to AF_MUI, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AF_ON[AFLoop] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Star_Movement_Check[AFLoop] Equal to False
                • Then - Actions
                  • Set Star_Create_Current_Time[AFLoop] = (Star_Create_Current_Time[AFLoop] + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Star_Create_Current_Time[AFLoop] Equal to AF_Star_Create_Time[AFLoop]
                    • Then - Actions
                      • Set AF_Caster_Position[AFLoop] = (Position of AF_Caster[AFLoop])
                      • Set Star_Create_Current_Time[AFLoop] = 0
                      • Set AF_Star_Amount[AFLoop] = (AF_Star_Amount[AFLoop] + 1)
                      • Set AF_Star_Region = (Region centered at AF_Caster_Position[AFLoop] with size (AF_Star_AOE[AFLoop], AF_Star_AOE[AFLoop]))
                      • Set AF_Star_Position[AFLoop] = (Random point in AF_Star_Region)
                      • Unit - Create 1 ChargeDummy for (Owner of AF_Caster[AFLoop]) at AF_Star_Position[AFLoop] facing (Random angle) degrees
                      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                      • Animation - Change (Last created unit)'s animation speed to 200.00% of its original speed
                      • Unit - Create 1 StarDummy for (Owner of AF_Caster[AFLoop]) at AF_Star_Position[AFLoop] facing (Random angle) degrees
                      • Unit Group - Add (Last created unit) to AF_Star_Group[AFLoop]
                      • Custom script: call RemoveLocation(udg_AF_Caster_Position[(udg_AFLoop)])
                      • Custom script: call RemoveLocation(udg_AF_Star_Position[(udg_AFLoop)])
                      • Custom script: call RemoveRect(udg_AF_Star_Region)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AF_Star_Amount[AFLoop] Equal to AF_Start_Limit[AFLoop]
                        • Then - Actions
                          • Set Star_Movement_Check[AFLoop] = True
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
                  • Unit Group - Pick every unit in AF_Star_Group[AFLoop] and do (Actions)
                    • Loop - Actions
                      • Set AF_Caster_Position[AFLoop] = (Position of AF_Caster[AFLoop])
                      • Set AF_Star_Position[AFLoop] = (Position of (Picked unit))
                      • Set AF_Star_Offset[AFLoop] = (AF_Star_Position[AFLoop] offset by AF_Star_Movement[AFLoop] towards (Angle from AF_Star_Position[AFLoop] to AF_Caster_Position[AFLoop]) degrees)
                      • Unit - Move (Picked unit) instantly to AF_Star_Offset[AFLoop]
                      • Set AF_Damage_Targets = (Units within AF_AOE_Set[AFLoop] of AF_Star_Offset[AFLoop] matching ((((Matching unit) belongs to an enemy of (Owner of AF_Caster[AFLoop])) Equal to True) and (((Matching unit) is alive) Equal to True)))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in AF_Damage_Targets) Greater than 0
                        • Then - Actions
                          • Unit - Create 1 ChargeDummy for (Owner of AF_Caster[AFLoop]) at AF_Star_Offset[AFLoop] facing (Random angle) degrees
                          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                          • Animation - Change (Last created unit)'s animation speed to 200.00% of its original speed
                          • Unit - Remove (Picked unit) from the game
                          • Unit Group - Pick every unit in AF_Damage_Targets and do (Actions)
                            • Loop - Actions
                              • Unit - Cause AF_Caster[AFLoop] to damage (Picked unit), dealing AF_Damage_Set[AFLoop] damage of attack type Spells and damage type Normal
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between AF_Star_Offset[AFLoop] and AF_Caster_Position[AFLoop]) Less than or equal to 50.00
                        • Then - Actions
                          • Set AF_Charge_Size = ((Real(AF_Charges[AFLoop])) x 50.00)
                          • Unit - Create 1 ChargeDummy for (Owner of AF_Caster[AFLoop]) at AF_Star_Position[AFLoop] facing (Random angle) degrees
                          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                          • Animation - Change (Last created unit)'s animation speed to 200.00% of its original speed
                          • Animation - Change (Last created unit)'s size to (AF_Charge_Size%, AF_Charge_Size%, AF_Charge_Size%) of its original size
                          • Unit - Remove (Picked unit) from the game
                          • Set AF_Charges[AFLoop] = (AF_Charges[AFLoop] + 1)
                        • Else - Actions
                      • Custom script: call DestroyGroup(udg_AF_Damage_Targets)
                      • Custom script: call RemoveLocation(udg_AF_Caster_Position[(udg_AFLoop)])
                      • Custom script: call RemoveLocation(udg_AF_Star_Position[(udg_AFLoop)])
                      • Custom script: call RemoveLocation(udg_AF_Star_Offset[(udg_AFLoop)])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in AF_Star_Group[AFLoop]) Equal to 0
                    • Then - Actions
                      • Set AF_Caster_Position[AFLoop] = (Position of AF_Caster[AFLoop])
                      • Set AF_Damage_Targets = (Units within (AF_AOE_Set[AFLoop] x (Real(AF_Charges[AFLoop]))) of AF_Caster_Position[AFLoop] matching ((((Matching unit) belongs to an enemy of (Owner of AF_Caster[AFLoop])) Equal to True) and (((Matching unit) is alive) Equal to True)))
                      • Unit Group - Pick every unit in AF_Damage_Targets and do (Actions)
                        • Loop - Actions
                          • Unit - Cause AF_Caster[AFLoop] to damage (Picked unit), dealing (AF_Damage_Set[AFLoop] x (Real(AF_Charges[AFLoop]))) damage of attack type Spells and damage type Normal
                      • Custom script: call DestroyGroup(udg_AF_Damage_Targets)
                      • Custom script: call DestroyGroup(udg_AF_Star_Group[(udg_AFLoop)])
                      • Set AF_ON[AFLoop] = False
                      • Set AF_Index = (AF_Index - 1)
                      • Set AF_Charge_Size = ((Real(AF_Charges[AFLoop])) x 50.00)
                      • Unit - Create 1 RedDummy for (Owner of AF_Caster[AFLoop]) at AF_Caster_Position[AFLoop] facing (Random angle) degrees
                      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                      • Animation - Change (Last created unit)'s animation speed to 200.00% of its original speed
                      • Animation - Change (Last created unit)'s size to (AF_Charge_Size%, AF_Charge_Size%, AF_Charge_Size%) of its original size
                      • Unit - Create 1 ExplosionDummy for (Owner of AF_Caster[AFLoop]) at AF_Caster_Position[AFLoop] facing (Random angle) degrees
                      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                      • Animation - Change (Last created unit)'s animation speed to 25.00% of its original speed
                      • Animation - Change (Last created unit)'s size to (AF_Charge_Size%, AF_Charge_Size%, AF_Charge_Size%) of its original size
                      • Custom script: call RemoveLocation(udg_AF_Caster_Position[(udg_AFLoop)])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AF_Index Equal to 0
                        • Then - Actions
                          • Set AF_MUI = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
            • Else - Actions
Keywords:
Star, Missle, Astral, Explosion, Force, AOE, Charge, MUI, Movement, Comments, Commented, GUI
Contents

Astral Force (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 12:20, 7th Apr 2015 IcemanBo: Read my post in thread.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

12:20, 7th Apr 2015
IcemanBo: Read my post in thread.
 
Level 11
Joined
Jul 25, 2014
Messages
490
Firstly, the oversized gif makes it harder to browse. If you could make it a little bit smaller, that would be lovely.

In the second chunk of your loop triggers, you use Picked Unit a lot of times. Better store the picked unit(s) into a variable before you call any functions with it, that way, you save some functions.

I'm not sure about this, but when checking conditions if the picked unit is alive, or an enemy, or is not a structure etc. you don't make 1 long line. You use a group (Units in range) and then make an If Then Else statement to check the conditions, and if the actions meet the conditions, they are executed.

Store Last Created Unit into a variable as well, for the same reason as for Picked Unit(s).
 
Some quick notes:

- Create a config trigger, where user can define certain aspects of the spell to his needs.
- Don't hardcode, if not needed. Try to make as much configurable/setable as possible.
- OwnerOfCaster could be indexed as well.
- Something like "MUI" doesn't really belong in a variable name. It's not really matching. Current/Max -Index is much better.
- Please add some import instructions.
 
Last edited:
You shouldn't use a FOR loop. It's seem easy to do but It's very slow. Try to use Unit Indexer or Hanky Indexer Template.

Nearly every GUI spell that is not instant needs either a for loop or unit indexer to be MUI and there is a lot of it on hive. Does that mean that every single GUI spell must use an indexer? o_O

Why? :vw_wtf:

It would help saying why it's bad not just saying it.

If you convert for loop to custom text, you'll see that it is actually using the following syntax:
JASS:
 loop
        exitwhen udg_Temp_Int > udg_Index
        // do stuff
        set udg_Temp_Int = udg_Temp_Int + 1
    endloop
Basicly the computer checks everytime if Temp_Int > Index and if not, increases Temp_Int by one. The de-index part's coding also takes a lot of space and is less inefficient. A unit indexer assign a unique custom value to every unit in a map. In that way, you can store data in an array in the same element (the container number of stored data in an array) that the unit's custom value that relates to that unit. This can be used to improve efficiency because it doesn't need that index/de-index method.
 
Top