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

Split Fireball V 1.01

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
The Hero launches a Fireball in target direction.
The Fireball will last for a set couple of seconds before it explodes, or untill it hits a target.
If it hits a target, the Fireball will explode, creating 2 new Fireballs which are launched in different directions. Lasts untill a number of hits has been reached. Hits, fireball lifetime, fireball speed, cast range and damage increases with level.

  • Hashtable
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Firetable = (Last created hashtable)
      • Set ExplodeRange = 50.00
      • Set SpawnRange = 53.00
  • Split Fireball Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Split Fireball
    • Actions
      • Trigger - Turn on Split Fireball Move <gen>
      • Set FirePoint = (Position of (Triggering unit))
      • Set FireMovePoint = (Target point of ability being cast)
      • Unit - Create 1 Fireball for (Owner of (Triggering unit)) at FirePoint facing (Angle from FirePoint to FireMovePoint) degrees
      • Unit - Set level of Fireball Death for (Last created unit) to (Level of Split Fireball for (Triggering unit))
      • Hashtable - Save (Level of Split Fireball for (Triggering unit)) as (Key FireHits) of (Key (Last created unit)) in Firetable
      • Hashtable - Save ((Real((Level of Split Fireball for (Triggering unit)))) x 5.00) as (Key FireSpeed) of (Key (Last created unit)) in Firetable
      • Unit - Add a ((Real((Level of Split Fireball for (Triggering unit)))) x 2.00) second Generic expiration timer to (Last created unit)
      • Hashtable - Save (Angle from FirePoint to FireMovePoint) as (Key FireFacing) of (Key (Last created unit)) in Firetable
      • Unit Group - Add (Last created unit) to Fireballs
      • Custom script: call RemoveLocation ( udg_FirePoint )
      • Custom script: call RemoveLocation ( udg_FireMovePoint )
  • Split Fireball Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Fireballs and do (Actions)
        • Loop - Actions
          • Set FirePoint = (Position of (Picked unit))
          • Set FireMovePoint = (FirePoint offset by (Load (Key FireSpeed) of (Key (Picked unit)) from Firetable) towards (Load (Key FireFacing) of (Key (Picked unit)) from Firetable) degrees)
          • Unit - Move (Picked unit) instantly to FireMovePoint
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain pathing at FireMovePoint of type Walkability is off) Equal to True
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Firetable
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units within ExplodeRange of FireMovePoint matching (((Owner of (Matching unit)) Not equal to (Owner of (Picked unit))) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))) Greater than 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key FireHits) of (Key (Picked unit)) from Firetable) Greater than 0
                • Then - Actions
                  • Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by SpawnRange towards ((Load (Key FireFacing) of (Key (Picked unit)) from Firetable) + 90.00) degrees) facing ((Load (Key FireFacing) of (Key (Picked unit)) from Firetable) + 90.00) degrees
                  • Hashtable - Save ((Load (Key FireFacing) of (Key (Picked unit)) from Firetable) + 90.00) as (Key FireFacing) of (Key (Last created unit)) in Firetable
                  • Hashtable - Save (Load (Key FireSpeed) of (Key (Picked unit)) from Firetable) as (Key FireSpeed) of (Key (Last created unit)) in Firetable
                  • Hashtable - Save ((Load (Key FireHits) of (Key (Picked unit)) from Firetable) - 1) as (Key FireHits) of (Key (Last created unit)) in Firetable
                  • Unit - Set level of Fireball Death for (Last created unit) to (Level of Fireball Death for (Picked unit))
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Unit Group - Add (Last created unit) to Fireballs
                  • Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by SpawnRange towards ((Load (Key FireFacing) of (Key (Picked unit)) from Firetable) - 90.00) degrees) facing ((Load (Key FireFacing) of (Key (Picked unit)) from Firetable) - 90.00) degrees
                  • Hashtable - Save ((Load (Key FireFacing) of (Key (Picked unit)) from Firetable) - 90.00) as (Key FireFacing) of (Key (Last created unit)) in Firetable
                  • Hashtable - Save (Load (Key FireSpeed) of (Key (Picked unit)) from Firetable) as (Key FireSpeed) of (Key (Last created unit)) in Firetable
                  • Hashtable - Save ((Load (Key FireHits) of (Key (Picked unit)) from Firetable) - 1) as (Key FireHits) of (Key (Last created unit)) in Firetable
                  • Unit - Set level of Fireball Death for (Last created unit) to (Level of Fireball Death for (Picked unit))
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Unit Group - Add (Last created unit) to Fireballs
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Firetable
                  • Unit - Kill (Picked unit)
                • Else - Actions
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Firetable
                  • Unit - Kill (Picked unit)
            • Else - Actions
          • Custom script: call RemoveLocation ( udg_FirePoint )
          • Custom script: call RemoveLocation ( udg_FireMovePoint )
  • Fireball Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Fireball
    • Actions
      • Unit Group - Remove (Dying unit) from Fireballs
      • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Firetable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Fireballs) Equal to 0
        • Then - Actions
          • Trigger - Turn off Split Fireball Move <gen>
        • Else - Actions

V 1.01 - New Tooltip. Fixed grammar errors. Fixed minor leaks.

Enjoy!

Rate and comment!


Keywords:
Fireball, Split, Epic, Laserdude, Boom, Explode, Fire, Ball, Many, Create, Splitting, Mega, Level, Levels.
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 13:16, 4th Mar 2011 Bribe: My review Status: Rejected until updated

Moderator

M

Moderator

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

13:16, 4th Mar 2011
Bribe:


My review

Status: Rejected until updated
 
Level 8
Joined
Jun 30, 2010
Messages
259
looks nice but why you don't move
  • Unit Group - Remove (Dying unit) from Fireballs
into the loop after killing the unit?

I knew someone would mention that.
Because that is unneccessary, since I still need the Fireball Death trigger, bacause of the Generic Expiration Timers, so without it, all the Fireballs which does not hit anything would never get out of the unit group, so then I don't add the same action into the same event, because it would be unneccessary.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Always put two or more casters in the test map so it's easier to test MUI stuff.
Learn tooltip has lots of typos/bad grammar. For example "untill" -> "until" , "ammount" -> "amount" , "inscreases" -> "increases".
I also prefer the standard Blizzard way of displaying ability level data.
The dummy doesn't need invulnerability ability, it has locust.
Generally if you use something more than once, save it to a variable and use the variable. Like angle from point a to point b and triggering unit. This increases performance.
Split Fireball Move should be initially off. And turned on/off when needed.
Here again, set picked unit to a variable, and use the variable instead of picked unit.
Leak:
  • (Number of units in (Units within 50.00 of FireMovePoint matching...
Leak:
  • Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by 53.00...
FireLoad, FireSpacing and FireHits should be loaded to a variable.
Fireball Death is unnecessary. Remove the unit from the group in the looping trigger, after you kill it.
The whole if/then/else structure could be better organized. You shouldn't have clear hashtable and kill unit twice there.
The caster won't get the credit from the kill, might be a problem.
The spell isn't easily configurable.
 
Level 8
Joined
Jun 30, 2010
Messages
259
Always put two or more casters in the test map so it's easier to test MUI stuff.
Learn tooltip has lots of typos/bad grammar. For example "untill" -> "until" , "ammount" -> "amount" , "inscreases" -> "increases".
I also prefer the standard Blizzard way of displaying ability level data.
The dummy doesn't need invulnerability ability, it has locust.
Generally if you use something more than once, save it to a variable and use the variable. Like angle from point a to point b and triggering unit. This increases performance.
Split Fireball Move should be initially off. And turned on/off when needed.
Here again, set picked unit to a variable, and use the variable instead of picked unit.
Leak:
  • (Number of units in (Units within 50.00 of FireMovePoint matching...
Leak:
  • Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by 53.00...
FireLoad, FireSpacing and FireHits should be loaded to a variable.
Fireball Death is unnecessary. Remove the unit from the group in the looping trigger, after you kill it.
The whole if/then/else structure could be better organized. You shouldn't have clear hashtable and kill unit twice there.

I Will fix grammar and make the ability tooltip look better.
I Will make the offset in the trigger below and the condition to a real variable.
  • Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by 53.00...
I will fix the turnoff to reduce lag.
Things I dissagree with:
Sometimes it happens that units with only locust CAN take damage, therefore I prefer to stick to having invulnerability there to take away that possibility.
No. Hashtable data is better than using a hashtable combined with variables, and I rather use a hashtable then using only variables.
As mentioned in my post above, Fireball Death MUST remain there, or the whole spell will leak and some units will stay in the unit group forever, since the fireballs uses generic expiration timers. This is why I also must add a Clear Hashtable Data to that trigger, which will NOT leak in the move trigger if the kill picked unit action is moved to the end of the trigger.

How would you want me to change the if/then/else structure? A looping action can not be added since there is 2 different angles.

EDIT: Fixed things I promised to fix.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Sometimes it happens that units with only locust CAN take damage, therefore I prefer to stick to having invulnerability there to take away that possibility.

Really? When is that? Damage target and damage area won't affect units with locust.

No. Hashtable data is better than using a hashtable combined with variables, and I rather use a hashtable then using only variables.
I'm sorry to say but that's nonsense. I mean this:
  • set r1 =Load (Key FireFacing) of (Key (Picked unit)) from Firetable
  • set r2 = Load (Key FireSpeed) of (Key (Picked unit)) from Firetable
  • set i1 = Load (Key FireHits) of (Key (Picked unit)) from Firetable
  • Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by SpawnRange towards r1 + 90.00) degrees) facing r1 + 90.00) degrees
  • set u1 = Last created unit
  • Hashtable - Save r1 + 90.00) as (Key FireFacing) of (Key (Last created unit)) in Firetable
  • Hashtable - Save r2 as (Key FireSpeed) of (Key (Last created unit)) in Firetable
  • Hashtable - Save i1 - 1) as (Key FireHits) of (Key (Last created unit)) in Firetable
  • Unit - Set level of Fireball Death for (Last created unit) to (Level of Fireball Death for (Picked unit))
  • Unit - Add a 3.00 second Generic expiration timer to u1
  • Unit Group - Add u1 to Fireballs

As mentioned in my post above, Fireball Death MUST remain there, or the whole spell will leak and some units will stay in the unit group forever, since the fireballs uses generic expiration timers.

You could add "unit is alive check". You can leave the dying trigger there if you want to. It's just that all units will trigger the A unit dies trigger.

Keep on making the spell better, and remember to fix the leaks :)
 
Level 8
Joined
Jun 30, 2010
Messages
259
Really? When is that? Damage target and damage area won't affect units with locust.


I'm sorry to say but that's nonsense. I mean this:
  • set r1 =(Load (Key FireFacing) of (Key (Picked unit)) from Firetable
  • set r2 = Load (Key FireSpeed) of (Key (Picked unit)) from Firetable
  • set i1 = Load (Key FireHits) of (Key (Picked unit)) from Firetable
  • Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by SpawnRange towards r1 + 90.00) degrees) facing r1 + 90.00) degrees
  • set u1 = Last created unit
  • Hashtable - Save r1 + 90.00) as (Key FireFacing) of (Key (Last created unit)) in Firetable
  • Hashtable - Save r2 as (Key FireSpeed) of (Key (Last created unit)) in Firetable
  • Hashtable - Save i1 - 1) as (Key FireHits) of (Key (Last created unit)) in Firetable
  • Unit - Set level of Fireball Death for (Last created unit) to (Level of Fireball Death for (Picked unit))
  • Unit - Add a 3.00 second Generic expiration timer to u1
  • Unit Group - Add u1 to Fireballs



You could add "unit is alive check". You can leave the dying trigger there if you want to. It's just that all units will trigger the A unit dies trigger.

Keep on making the spell better, and remember to fix the leaks :)

1. When creating dummy units, sometimes units will start attacking them, this has happened to me sometimes when I am creating spell swith dummy units.

2. When it comes to hashtables, people seem to have different views of what is best. I made another spell, which was basically what you are saying, but then, people said it was useless to combine variables with hashtable data when you could just use one of them, and since indexing systems is MUCH harder to make with spells like these, I'd rather use hashtables.

3. Unit is alive check? Why? It allready checks if the unit is a Fireball, and if it is, it is allways dead, since the acion is - A unit dies.

4. All the leaks is fixed, as far as I can see.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
1. Weird. Units with locust can't be targeted.
2. This has nothing to do with indexing vs. hashtables. I'm not talking about indexing. It's all about not needing to load the same data over and over, when you only have to load it once.
3. Unit is alive check in the looping trigger.
4. Both of the leaks I pointed out are still there.
 
Level 8
Joined
Jun 30, 2010
Messages
259
1. Weird. Units with locust can't be targeted.
2. This has nothing to do with indexing vs. hashtables. I'm not talking about indexing. It's all about not needing to load the same data over and over, when you only have to load it once.
3. Unit is alive check in the looping trigger.
4. Both of the leaks I pointed out are still there.

1. They can not be targeted no, but auto attack (which occours if you attack a creep) can still hit them.
2. And if I decided to do as you wish, how exactly would you mean I should change the triggers?
3. It is not required if I allready turn off the trigger when there are no fireballs in there (which I do now), right?
4. I notice that one of them is there. But the condition one is gone, since the Real has been replaced with a variable.
 
Level 8
Joined
Jun 30, 2010
Messages
259
2. Look at the trigger example I posted.
3. That's a good solution.
4. There's still a group created in the condition, and it is not cleared.

4. Number of units? That is just a condition, it does not really create a unit group, it just matches a unit group, which should not leak.
EDIT: 2.
  • Hashtable - Save (Key (string))
should have the same effect as
  • Hashtable - Save (key (variable))
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
4. The condition from GUI -> JASS conversion: CountUnitsInGroup(GetUnitsInRangeOfLocMatching(udg_ExplodeRange, udg_FireMovePoint:

JASS:
function GetUnitsInRangeOfLocMatching takes real radius, location whichLocation, boolexpr filter returns group
    local group g = CreateGroup()
    call GroupEnumUnitsInRangeOfLoc(g, whichLocation, radius, filter)
    call DestroyBoolExpr(filter)
    return g
endfunction
 
Level 8
Joined
Jun 30, 2010
Messages
259
4. The condition from GUI -> JASS conversion: CountUnitsInGroup(GetUnitsInRangeOfLocMatching(udg_ExplodeRange, udg_FireMovePoint:

JASS:
function GetUnitsInRangeOfLocMatching takes real radius, location whichLocation, boolexpr filter returns group
    local group g = CreateGroup()
    call GroupEnumUnitsInRangeOfLoc(g, whichLocation, radius, filter)
    call DestroyBoolExpr(filter)
    return g
endfunction

I don't do JASS, but I understand enought to see that in JASS, the condition actually picks the units.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Hashtable

Time - Elapsed game time is 0.01 seconds

- Event should be "Map Initialization".

Split Fireball Move

Number of units in (Units within ExplodeRange of FireMovePoint

- Leaks

Unit - Create 1 Fireball for (Owner of (Picked unit)) at (FireMovePoint offset by SpawnRange

- Leaks

Fireball Death

Not sure what you mean by Picked unit but I'm guessing you meant "Dying unit". Not only, but you should be using "Triggering unit" as it is faster than "Dying unit".
 
Top