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

Bouncing Ball v1.5

Okay so this is my second spell in MUI, i made it 1 month ago and forgot about it.
Summons a large green ball that jump from one point to another dealing damage when lands. Ball can jump in random angle and random distance between 150 and 300, and deals 100 damage and 100 bonus damage per level for ground slam. Number of jumps increases every level by 2.


  • Bouncing Ball Settings
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setting ability --------
      • Set BB_Ability = Bouncing Ball [|c0020c000B|r]
      • -------- Setting effect when ball strikes the ground --------
      • Set BB_SpecialEffect = Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
  • Bouncing Ball Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BB_Ability
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BB_Index Equal to 0
        • Then - Actions
          • Trigger - Turn on Bouncing Ball Loop <gen>
        • Else - Actions
      • Set BB_Index = (BB_Index + 1)
      • Set BB_Index2 = (BB_Index2 + 1)
      • -------- Setting caster --------
      • Set BB_Caster[BB_Index2] = (Triggering unit)
      • -------- Setting Angle --------
      • Set BB_Angle[BB_Index2] = (Random real number between 0.00 and 360.00)
      • -------- Setting Speed of ball --------
      • Set BB_Speed[BB_Index2] = 10.00
      • -------- Setting Distance --------
      • Set BB_Distance[BB_Index2] = (Random real number between 150.00 and 300.00)
      • -------- Setting Maximum Height --------
      • Set BB_MaxHeight[BB_Index2] = (Random real number between 150.00 and 300.00)
      • -------- Setting next value as counter to count when ball will finish flying --------
      • Set BB_Expire[BB_Index2] = BB_Distance[BB_Index2]
      • -------- Settings number of jumps --------
      • Set BB_Jumps[BB_Index2] = ((Level of BB_Ability for BB_Caster[BB_Index2]) x 2)
      • -------- Creating ball --------
      • Set BB_Point = (Position of BB_Caster[BB_Index2])
      • Unit - Create 1 Dummy for (Owner of BB_Caster[BB_Index2]) at BB_Point facing Default building facing degrees
      • Set BB_Dummy[BB_Index2] = (Last created unit)
      • Animation - Change BB_Dummy[BB_Index2]'s size to (300.00%, 300.00%, 300.00%) of its original size
      • Unit - Add Crow Form to BB_Dummy[BB_Index2]
      • Custom script: call RemoveLocation(udg_BB_Point)
  • Bouncing Ball Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer BB_Index3) from 1 to BB_Index2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BB_Index3 Not equal to 0
            • Then - Actions
              • Set BB_Expire[BB_Index3] = (BB_Expire[BB_Index3] - BB_Speed[BB_Index3])
              • Set BB_CurrentDistance[BB_Index3] = (BB_CurrentDistance[BB_Index3] + BB_Speed[BB_Index3])
              • -------- Crearing another variables for parabola --------
              • Set BB_Real[1] = BB_MaxHeight[BB_Index3]
              • Set BB_Real[2] = BB_Distance[BB_Index3]
              • Set BB_Real[3] = BB_CurrentDistance[BB_Index3]
              • -------- Parabola --------
              • Custom script: set udg_BB_Real[4] = ( 4 * udg_BB_Real[1] / udg_BB_Real[2]) * ( udg_BB_Real[2] - udg_BB_Real[3]) * ( udg_BB_Real[3] / udg_BB_Real[2] )
              • -------- Changing Height --------
              • Animation - Change BB_Dummy[BB_Index3] flying height to BB_Real[4] at 0.00
            • Else - Actions
          • Set BB_Point3 = (Position of BB_Dummy[BB_Index3])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BB_Expire[BB_Index3] Less than or equal to 0.00
            • Then - Actions
              • -------- Setting all settings again for next jump --------
              • Set BB_Jumps[BB_Index3] = (BB_Jumps[BB_Index3] - 1)
              • Set BB_Angle[BB_Index3] = (Random real number between 0.00 and 360.00)
              • Set BB_Distance[BB_Index3] = (Random real number between 150.00 and 300.00)
              • Set BB_Expire[BB_Index3] = BB_Distance[BB_Index3]
              • Set BB_CurrentDistance[BB_Index3] = 0.00
              • -------- Creating dummy to cast a Thunder Clap at point where ball reaches ground --------
              • Special Effect - Create a special effect at BB_Point3 using BB_SpecialEffect
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 Dummy 2 for (Owner of BB_Caster[BB_Index3]) at BB_Point3 facing Default building facing degrees
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
              • Unit - Add Bouncing Ball Dummy to (Last created unit)
              • Unit - Set level of Bouncing Ball Dummy for (Last created unit) to (Level of BB_Ability for BB_Caster[BB_Index3])
              • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BB_Jumps[BB_Index3] Equal to 0
                • Then - Actions
                  • Unit - Remove BB_Dummy[BB_Index3] from the game
                  • Set BB_Dummy[BB_Index3] = No unit
                  • Set BB_Index = (BB_Index - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BB_Index Equal to 0
                    • Then - Actions
                      • Set BB_Index2 = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
              • -------- Moving ball to next point --------
              • Set BB_Point2 = (BB_Point3 offset by BB_Speed[BB_Index3] towards BB_Angle[BB_Index3] degrees)
              • Unit - Move BB_Dummy[BB_Index3] instantly to BB_Point2
              • -------- Removing leaks --------
              • Custom script: call RemoveLocation(udg_BB_Point2)
              • Custom script: call RemoveLocation(udg_BB_Point3)
Credits for model Dummy.mdx goes to Vexorian.
I also would like to thank Berb, Dr. Boom, watermelon_1234 and Maker for help with this, and don't forget to give credits if you use this.
Also credits for parabola equation goes to moyack.
If you find something that i should fix you're free to tell as fast as you can, because i need to use this in my map and don't have time, okay i guess that's all. Enjoy)

Keywords:
Ball, rock, boulder, bounce, jump
Contents

Bouncing Ball v1.5 (Map)

Reviews
19:58, 19th Dec 2010 The_Reborn_Devil: My review. Status: Approved Rating: Useful
Level 16
Joined
May 1, 2008
Messages
1,605
Bouncing Ball v1.0

Moin moin =)

==== My personal vote: APPROVAL 4/5 ====

First of all, I remember this spell ^^. Wasn't you the one, who posted here in Hive a problem, where the ball doesn't disappear or something?^^ Edit: Ahh I red the description, you was it ok.

Spell review:
- Triggering looks good only one thing, you should add the action in the If-Then-Else Part where you check if "BB_Jumps[BB_Index3] Equal to 0", after you kill the dummy the following line:
  • Set BB_Dummy[BB_Index3] = No unit
to clear the unit variable.

- Only to make it very very exactly: You should set the BB_Angle from 0.01 to 360.00, because 0.00 and 360.00 are the same ^^

- Else I can't see anything that miss here, only in your Triggerfolder "Bouncing Ball" you typed "Inforamtion" but I think you mean "Information" ^^

- The idea: Actually it isn't hard to create a random bouncing ball, but I don't see something like that before and I like the spell.

Edit: I saw you use a imported "dummy.mdx". Is this the one from "Vexorian"? ( I think he create one too ). If it is, then type in the description "Thanks to Vexorian for the dummy.mdx" ( just to fit the rules here ... ), if it's not - ignore this^^

Edit 2: And for those who say: "Omg why you use in the loop " BB_Index3 Not equal to 0"?". I said it to him, when he asked for help, because without this if, the spell doesn't work at all. After adding this, it works, so if you say something about this, this belongs to me then.

So all in all, this spell can get approval and I think 4/5 is ok here, -1 because it's actually very easy to create a random bouncing ball =)

Greetings and Peace
Dr. Boom
 
Not much to add, however I'm pretty sure:

  • Unit - Create 1 Dummy for (Owner of BB_Caster[BB_Index2]) at (Position of BB_Caster[BB_Index2]) facing Default building facing degrees
  • Special Effect - Create a special effect at (Position of BB_Dummy[BB_Index3]) using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
would cause a leak remember to set a variable to the point of the unit and then use that =P
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Why is this the first action in the loop? It shouldn't be.
  • Custom script: call RemoveLocation(udg_BB_Point[udg_BB_Index3])
This location is not removed:
  • Set BB_Point[BB_Index3] = (Position of BB_Dummy[BB_Index3])
Additional leak:
  • Set BB_Point2[BB_Index3] = ((Position of BB_Dummy[BB_Index3]) offset by 10.00 towards BB_Angle[BB_Index3] degrees)
This
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • BB_Index Equal to 0
    • Then - Actions
      • Set BB_Index2 = 0
      • Trigger - Turn off (This trigger)
    • Else - Actions
should be right after this:
  • Set BB_Index = (BB_Index - 1)
These can be executed even if the unis is set to null:
  • -------- Moving ball to next point --------
  • Set BB_Point2[BB_Index3] = ((Position of BB_Dummy[BB_Index3]) offset by 10.00 towards BB_Angle[BB_Index3] degrees)
  • Unit - Move BB_Dummy[BB_Index3] instantly to BB_Point2[BB_Index3]
  • -------- Removing leaks --------
  • Custom script: call RemoveLocation(udg_BB_Point2[udg_BB_Index3])
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • BB_Index Equal to 0
    • Then - Actions
      • Set BB_Index2 = 0
      • Trigger - Turn off (This trigger)
    • Else - Actions
You should save the level to a variable, since the caster can level it up while the ball is bouncing:
  • Unit - Set level of Bouncing Ball Dummy for (Last created unit) to (Level of Bouncing Ball [|c0020c000B|r] for BB_Caster[BB_Index3])
I like the spell, but you should make the flight more smooth. Use a parabola equation.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
I don't really have anything to add to this except to point out some petty stuff along with location leaks. :p

    • Set BB_Ability = Bouncing Ball [|c0020c000B|r]
    I would probably do this in a map initialization trigger because you probably don't need to keep doing this whenever the spell is cast.
    • Set BB_Angle[BB_Index2] = (Random real number between 0.01 and 360.00)
    Why 0.01? 0 is fine as you can tell when you do the second trigger.
    • Unit - Create 1 Dummy for (Owner of BB_Caster[BB_Index2]) at (Position of BB_Caster[BB_Index2]) facing Default building facing degrees
    Location leak.
  • Hm, I don't think there's any real point with using the BB_Reals when you set the parabola.
    • Special Effect - Create a special effect at (Position of BB_Dummy[BB_Index3]) using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
    • Set BB_Point2[BB_Index3] = ((Position of BB_Dummy[BB_Index3]) offset by BB_Speed[BB_Index3] towards BB_Angle[BB_Index3] degrees)
    Both these location leaks can be removed if you do
    • Set BB_Point[BB_Index3] = (Position of BB_Dummy[BB_Index3])
    earlier. Note that this should be done outside the if structure otherwise the ball might not move correctly.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Moderator Review:


You need to give credits to moyack for the parabola equation you're using. Other than that the triggering looks okay. However, in the trigger Bouncing Ball loop, you should put this outside the if-statement:
  • Set BB_Point3[BB_Index3] = (Position of BB_Dummy[BB_Index3])
Or else this might not work:
  • Set BB_Point2[BB_Index3] = (BB_Point3[BB_Index3] offset by BB_Speed[BB_Index3] towards BB_Angle[BB_Index3] degrees)
You also do not need this:
  • Custom script: call RemoveLocation(udg_BB_Point[udg_BB_Index3])
As the location BB_Point is only set one time, and that is in Bouncing Ball Cast, and you are already destroying it there.


Second review:

The triggers look okay now.
 
Last edited:
  • Like
Reactions: sPy
Level 29
Joined
Mar 10, 2009
Messages
5,016
isnt this trigger...

  • Unit - Create 1 Dummy for (Owner of BB_Caster[BB_Index2]) at BB_Point[1] facing Default building facing (270.0) degrees
suppose to be...

BB_Point[BB_Index2]

and this one...

  • Set BB_Expire[BB_Index3] = (BB_Expire[BB_Index3] - BB_Speed[BB_Index3])
suppose to be...

  • Set BB_Expire[BB_Index3] = (BB_Expire[BB_Index3] - 0.03)
 
Last edited:
Level 12
Joined
Apr 16, 2010
Messages
584
isnt this trigger...

Unit - Create 1 Dummy for (Owner of BB_Caster[BB_Index2]) at BB_Point[1] facing Default building facing (270.0) degrees

suppose to be...

BB_Point[BB_Index2]
yep, didn't see that, thanks.

and this one...

Set BB_Expire[BB_Index3] = (BB_Expire[BB_Index3] - BB_Speed[BB_Index3])

suppose to be...

Set BB_Expire[BB_Index3] = (BB_Expire[BB_Index3] - 0.03)
nope, i need to subtract speed here so it would be right.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The bounce looks a lot better than when I first tested the spell. Good job.

Still some things to improve. Try to make the tooltip a bit more like standard Blizzard ability. Look how damage is listed in the research tooltip for example. You could list the cooldown too.

These could be set at initialization trigger, somewhere it only runs once. The BBIndex4 check will run every time the spell is cast.
  • Set BB_Ability = Bouncing Ball [|c0020c000B|r]
    • Set BB_SpecialEffect = Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
You are not recycling BBIndex4. So the max cast count is 8191. After the no casts can be made.

Why not 0 and 360?
  • Set BB_Angle[BB_Index2] = (Random real number between 1.00 and 360.00)
None of the point variables should be arrays, since you are not storing the data to be used at a later loop. Now they being arrays just slow things down, without any benefit.

This is not needed:
  • Unit - Remove Crow Form from BB_Dummy[BB_Index3]
You could have these at the very last else:
  • Set BB_Point3[BB_Index3] = (Position of BB_Dummy[BB_Index3])
  • -------- Moving ball to next point --------
  • Set BB_Point2[BB_Index3] = (BB_Point3[BB_Index3] offset by BB_Speed[BB_Index3] towards BB_Angle[BB_Index3] degrees)
  • Unit - Move BB_Dummy[BB_Index3] instantly to BB_Point2[BB_Index3]
  • -------- Removing leaks --------
  • Custom script: call RemoveLocation(udg_BB_Point2[udg_BB_Index3])
  • Custom script: call RemoveLocation(udg_BB_Point3[udg_BB_Index3])
Set the food cost of the dummies to 0, and why not point value also.
 
Level 12
Joined
Apr 16, 2010
Messages
584
Hmmm, i know what you're saying.
These could be set at initialization trigger, somewhere it only runs once. The BBIndex4 check will run every time the spell is cast.
Set BB_Ability = Bouncing Ball [|c0020c000B|r]
Set BB_SpecialEffect = Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
In previous version i typed that those action should be in init trigger, but now i created another index, so yes i need to recycle it, i would better create init trigger with those actions, instead of recycling.

Why not 0 and 360?
Set BB_Angle[BB_Index2] = (Random real number between 1.00 and 360.00)
I don't remember but someone told that there's no point settings it zero because it will be same angle as 360, maybe he was right, but okay, i'll set it to 0.

This is not needed:
Unit - Remove Crow Form from BB_Dummy[BB_Index3]
Yeas, i guess so.

You could have these at the very last else:
Set BB_Point3[BB_Index3] = (Position of BB_Dummy[BB_Index3])
-------- Moving ball to next point --------
Set BB_Point2[BB_Index3] = (BB_Point3[BB_Index3] offset by BB_Speed[BB_Index3] towards BB_Angle[BB_Index3] degrees)
Unit - Move BB_Dummy[BB_Index3] instantly to BB_Point2[BB_Index3]
-------- Removing leaks --------
Custom script: call RemoveLocation(udg_BB_Point2[udg_BB_Index3])
Custom script: call RemoveLocation(udg_BB_Point3[udg_BB_Index3])
It won't make any difference at all anyway.

Set the food cost of the dummies to 0,
Oh i forgot about that.

and why not point value also.
So you say that i should set point-vaue to zero too, but i have a question, what point-value is used for anyway?

Edit: Updating...
 
Level 12
Joined
Apr 16, 2010
Messages
584
Updated.
Made all changes like you said except for description of spell, because every map has its unique description of spells, i didn't do it, and what's the point of typing cooldown when it's zero.
So my point is that everyone should make their own description, like me (i don't make it in my spells).
Thanks for tips Maker.
 
Top