1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Weave light to take you to your highest hopes - the 6th Special Effect Contest is here!
    Dismiss Notice
  5. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Rock Dance

Submitted by leonguyen112
This bundle is marked as approved. It works and satisfies the submission rules.
Rock Dance v1.5
by LeoNguyen112


Description

Creates a rock that jumps forwardly. When to rock hit the ground, it deals damage to nearby enemy units.
The rock travels for 1200 range and then jump back to where it started. Damage is dealt twice.

Level 1- 180 total damage.
Level 2 - 240 total damage.
Level 3 - 300 total damage.
Level 4 - 360 total damage.


Installing

This spell requires Unit Indexer by Bribe
  1. Open your map, open this map.
  2. Go to File -> Preferences -> Make sure you had checked Automatically create unknown variables while
    pasting trigger data
    .
  3. Install Unit Indexer to your map
  4. Copy trigger Rock Setting into your map.
  5. Copy trigger Rock Creating into your map.
  6. Copy trigger Rock Loop into your map.
  7. Create a rock dummy.
  8. Create a custom spell.
  9. Go to trigger Rock Setting, edit these actions to what you want:
    Code
    • Set RD_Dummy = Rock
    • Set RD_Effect[1] = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
    • Set RD_Effect[2] = Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
    • Set RD_Effect[3] = Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
    • Set RD_JumpHeight = 55.00
    • Set RD_JumpTimes = 4
    • Set RD_JumpDistance = 300.00
    • Set RD_DamageBase = 60
    • Set RD_DamagePerLevel = 30
    • Set RD_JumpSpeed = 20.00
    • Set RD_AOE = 175.00
  10. Changed the conditions of trigger Rock Creating into:
    Code
    • (Ability being cast) Equal to YourSpell
  11. It is installed.

Please give me credit if you use this spell in your map.

Special Thanks To

Tank-Commander for helping me with the code.

Code
  • Rock Setting
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set RD_Dummy = Rock
      • Set RD_Effect[1] = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Set RD_Effect[2] = Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
      • Set RD_Effect[3] = Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
      • Set RD_JumpHeight = 55.00
      • Set RD_JumpTimes = 4
      • Set RD_JumpDistance = 300.00
      • Set RD_DamageBase = 60.00
      • Set RD_DamagePerLevel = 30.00
      • Set RD_JumpSpeed = 20.00
      • Set RD_AOE = 175.00


  • Rock Creating
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rock Dance
    • Actions
      • Set RD_Caster[0] = (Triggering unit)
      • Set RD_Point[1] = (Position of RD_Caster[0])
      • Set RD_Point[2] = (Target point of ability being cast)
      • Unit - Create 1 RD_Dummy for (Owner of RD_Caster[0]) at RD_Point[1] facing (Angle from RD_Point[1] to RD_Point[2]) degrees
      • Set RD_ID = (Custom value of (Last created unit))
      • Unit Group - Add (Last created unit) to RD_DummyGroup
      • Unit - Add Crow Form to (Last created unit)
      • Unit - Remove Crow Form from (Last created unit)
      • Animation - Play (Last created unit)'s birth animation
      • Set RD_CasterPoint[RD_ID] = (Position of RD_Caster[0])
      • Set RD_TargetPoint[RD_ID] = (RD_Point[1] offset by (RD_JumpDistance x (Real(RD_JumpTimes))) towards (Angle from RD_Point[1] to RD_Point[2]) degrees)
      • Set RD_TempPoint[RD_ID] = (RD_Point[1] offset by RD_JumpDistance towards (Angle from RD_Point[1] to RD_TargetPoint[RD_ID]) degrees)
      • Set RD_Damage[RD_ID] = (RD_DamageBase + (RD_DamagePerLevel x (Real((Level of (Ability being cast) for RD_Caster[0])))))
      • Set RD_Caster[RD_ID] = RD_Caster[0]
      • Set RD_Check[RD_ID] = False
      • Custom script: call RemoveLocation(udg_RD_Point[1])
      • Custom script: call RemoveLocation(udg_RD_Point[2])
      • Trigger - Turn on Rock Loop <gen>


  • Rock Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in RD_DummyGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in RD_DummyGroup and do (Actions)
            • Loop - Actions
              • Set RD_TempUnit = (Picked unit)
              • Set RD_Index = (Custom value of RD_TempUnit)
              • Set RD_Point[1] = (Position of RD_TempUnit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between RD_Point[1] and RD_CasterPoint[RD_Index]) Less than or equal to (RD_JumpSpeed / 2.00)
                  • RD_Check[RD_Index] Equal to True
                • Then - Actions
                  • For each (Integer A) from 1 to 20, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RD_Effect[(Integer A)] Not equal to Empty String
                        • Then - Actions
                          • Special Effect - Create a special effect at RD_Point[1] using RD_Effect[(Integer A)]
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                  • Custom script: call RemoveLocation(udg_RD_TargetPoint[udg_RD_Index])
                  • Custom script: call RemoveLocation(udg_RD_TempPoint[udg_RD_Index])
                  • Custom script: call RemoveLocation(udg_RD_CasterPoint[udg_RD_Index])
                  • Custom script: call RemoveLocation(udg_RD_Point[1])
                  • Unit - Remove RD_TempUnit from the game
                • Else - Actions
                  • Set RD_Point[0] = (RD_TempPoint[RD_Index] offset by (RD_JumpDistance / 2.00) towards (Angle from RD_TempPoint[RD_Index] to RD_Point[1]) degrees)
                  • Set RD_Height = (((Distance between RD_Point[1] and RD_Point[0]) / (RD_JumpDistance / 2.00)) x RD_JumpHeight)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between RD_Point[1] and RD_TempPoint[RD_Index]) Greater than or equal to (RD_JumpDistance / 2.00)
                    • Then - Actions
                      • Animation - Change RD_TempUnit flying height to ((Current flying height of RD_TempUnit) + RD_Height) at 0.00
                    • Else - Actions
                      • Animation - Change RD_TempUnit flying height to ((Current flying height of RD_TempUnit) - RD_Height) at 0.00
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between RD_Point[1] and RD_TargetPoint[RD_Index]) Less than (RD_JumpSpeed / 2.00)
                      • RD_Check[RD_Index] Equal to False
                    • Then - Actions
                      • Custom script: call RemoveLocation(udg_RD_TargetPoint[udg_RD_Index])
                      • Set RD_TargetPoint[RD_Index] = RD_CasterPoint[RD_Index]
                      • Set RD_Check[RD_Index] = True
                      • Unit - Make RD_TempUnit face RD_TargetPoint[RD_Index] over 0.00 seconds
                      • Unit Group - Remove all units from RD_TargetGroup[RD_Index]
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between RD_Point[1] and RD_TempPoint[RD_Index]) Less than (RD_JumpSpeed / 2.00)
                    • Then - Actions
                      • Set RD_TempPoint[RD_Index] = (RD_Point[1] offset by RD_JumpDistance towards (Angle from RD_Point[1] to RD_TargetPoint[RD_Index]) degrees)
                      • For each (Integer A) from 1 to 20, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RD_Effect[(Integer A)] Not equal to Empty String
                            • Then - Actions
                              • Special Effect - Create a special effect at RD_Point[1] using RD_Effect[(Integer A)]
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                      • Set RD_TargetGroup[0] = (Units within RD_AOE of RD_Point[1])
                      • Unit Group - Pick every unit in RD_TargetGroup[0] and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((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
                              • ((Picked unit) belongs to an enemy of (Owner of RD_Caster[RD_Index])) Equal to True
                              • ((Picked unit) is in RD_TargetGroup[RD_Index]) Equal to False
                            • Then - Actions
                              • Unit - Cause RD_Caster[RD_Index] to damage (Picked unit), dealing RD_Damage[RD_Index] damage of attack type Magic and damage type Magic
                              • Unit Group - Add (Picked unit) to RD_TargetGroup[RD_Index]
                            • Else - Actions
                      • Custom script: call DestroyGroup(udg_RD_TargetGroup[0])
                    • Else - Actions
                  • Set RD_Point[2] = (RD_Point[1] offset by RD_JumpSpeed towards (Angle from RD_Point[1] to RD_TempPoint[RD_Index]) degrees)
                  • Unit - Move RD_TempUnit instantly to RD_Point[2]
                  • Custom script: call RemoveLocation(udg_RD_Point[0])
                  • Custom script: call RemoveLocation(udg_RD_Point[1])
                  • Custom script: call RemoveLocation(udg_RD_Point[2])


Changelog

Ver1.0

- First upload spell.

Ver 1.1

- Remake allmost code.
- Edit special effect (add volcano effect).

Ver 1.2

- Rewrited description.
- Fixed bug the jumped rock occasionally isn't removed.
- Improved jump code, from now the rock jump smoother.
- Used variable RD_Loop instead of Integer A
- Added turn off code to turn off loop trigger when there is no rock.
- Added volcano missile effect.
- Increased slam AoE from 150 to 175.

Ver 1.3

- From now, user can customize this spell by editting trigger
Rock Setting, there are editable values:
  • Model of the rock
  • Damage
  • Area of effect
  • Special effect (max is 20 effect)
  • Jump speed
  • Jump height
  • Number of jump times
  • Range of each jump
- Changed type of variable RD_Off from Integer to Boolean.

Ver 1.4

- Used 2 variables to set damage instead of 1.
- Used RD_Caster[0] instead of Triggering Unit.

Ver 1.5
- Changed the way of making it MUI by using Unit Indexer.


Keywords:
rock, dance, earth, stone, jump, orc, leonguyen112, bounce
Contents

Spell - Rock Dance (Map)

Reviews
Moderator
Magtheridon96: Approved. Your current handling of the locations is pretty ugly :/ Still, I read through it and found no leaks. The triggers are okay. Just a tip, in the cast trigger, since you're repeating the angle calculation, you might as...
  1. Magtheridon96:
    Approved.

    Your current handling of the locations is pretty ugly :/
    Still, I read through it and found no leaks.
    The triggers are okay.

    Just a tip, in the cast trigger, since you're repeating the angle calculation, you might as well cache it into a variable and reuse it.
    Also, instead of using those location arrays, use normal variables.

    Also, use Map initialization instead of the 0 second game time event.

    Old reviews
    [​IMG]

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

    Review
    Fix your indexing. Use Hanky's or Bribe's templates, located here, in the Spells section.

    Older Reviews
    29 Oct 2011
    Bribe: Use Hanky's Dynamic Indexing. Looping 1-50 is "MUI" but the logic you're using via that method is absolutely terrible and the load on the CPU is way higher than necessary.

    http://www.hiveworkshop.com/forums/spells-569/gui-dynamic-indexing-template-144325
     
  2. Nightmare Moon

    Nightmare Moon

    Joined:
    Apr 16, 2010
    Messages:
    575
    Resources:
    9
    Icons:
    2
    Spells:
    7
    Resources:
    9
    Suggestions

    - don't use Unit - A unit Begins casting an ability, instead of that use
    Unit - A unit Starts the effect of an ability;
    - don't use custom value of unit;
    - the way you make it MUI isn't to good (use better indexing system), also the loop trigger is always on;
    - instead of Casting unit use Triggering unit;
    - remove Point Value from dummy in OE;
    - create another variable for Target point of ability being cast;
    - you don't remove TempPoint2 in Rock Dance;
    - use parabola equation to make the flying of ball smooth;
    - in action where you change Height you use 1000000000.00 value use 0;
    - in second trigger in TempGroup you pick dead units;
    - tutorial how to improve your spell: MUI
    - when the ball must die you first remove him then kill, why? Better kill him;
    - i also don't understand what is with that RD_TargetGroup and you never destroy it;
    - why you use those actions
    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Distance between TempPoint and RD_TargetPoint[TempValue]) Less than or equal to (<=) 10.00
      • Then - Actions
        • Set RD_TargetPoint[TempValue] = RD_CasterPoint[TempValue]
        • Unit Group - Remove all units from RD_TargetGroup[TempValue]
      • Else - Actions

    if you already have same action at beginning of loop? Just clear the RD_TargetGroup in first If/Then/Else, where you should turn off loop.

    I guess that's all, and btw this spell is very similar to mine... So you could something that mine doesn't have so it would be more original idea.
    Voting

    3/5 Haven't decided for what to vote, for now
     
  3. leonguyen112

    leonguyen112

    Joined:
    Dec 20, 2010
    Messages:
    53
    Resources:
    7
    Maps:
    2
    Spells:
    3
    Template:
    2
    Resources:
    7
    Ah, my bad, I have fixed it. But somethings you said I don't understand (sorry because my bad English, I'm VietNamese) I'll keep learning, thanks for your help. :)
     
  4. Klingo

    Klingo

    Joined:
    Dec 19, 2009
    Messages:
    246
    Resources:
    5
    Spells:
    5
    Resources:
    5
    RD_Group don't leak because you haven't set it... so you don't need to destroy it.

    in "Rock Dance Move" trigger, would be nice if you could put "picked unit" into a variable.

    In the first trigger , you set two times the positions of triggering unit when only one could do the job

    In the first trigger , you set this but you never use it...
    • Set RD_Unit[MUI] = (Last created unit)
     
  5. 88WaRCraFT3

    88WaRCraFT3

    Joined:
    Jun 9, 2009
    Messages:
    1,137
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Suggestions
    It would be better if you make the rock follow you! Jumps whole time until reachs you, cause it jumps 3 times to target point, and then back to variable Position of Caster... :D gl
    Cool spell anyway, it can be used like system too. 5/5 +rep
     
  6. tjordell

    tjordell

    Joined:
    Jan 25, 2009
    Messages:
    554
    Resources:
    5
    Icons:
    1
    Spells:
    4
    Resources:
    5
    The first thing I see in your code that can be better is the RD_TempPoint1/2/3. To make your spell as small in bytes as possible, you should make the RD_TempPoint into one variable with Array to store the Locafions into. Also, it's easier to work with less Triggers if you or someone else want to modify it in the future.

    Secondly, you shall avoid changing Custom Values of units because thats not the right way to handle with a 'bunch' of units. Instead of using this Custom Value you should create another Variable (Integer) and do as other people do it MUI.

    Now I cant see anything more than that u should place every action in all the (If/Then/Else) with the condition "If Distace between 'variable1' and 'variable2' is less than or equal to 10.00" into ONE (If/Then/Else). Otherwise you check the same thing over and over again when u dont need to.

    Now I'm dine here. I wrote all this from my iPhone 4 so I hope that you really appreciate it. Have a good day/night fella'!
     
  7. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,765
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    An array variable would take more space than 3 non-array, since they have a default size of 8192, which needs to be initialized in the main script when the map loads.
     
  8. tjordell

    tjordell

    Joined:
    Jan 25, 2009
    Messages:
    554
    Resources:
    5
    Icons:
    1
    Spells:
    4
    Resources:
    5
    Are you really sure of that? I heard it from a person with super high reputation that array is less space...
     
  9. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,765
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    My spell was rejected because of using an array for 3 points instead of using 3 separate variables.
    Yes I'm pretty sure it is better.
     
  10. leonguyen112

    leonguyen112

    Joined:
    Dec 20, 2010
    Messages:
    53
    Resources:
    7
    Maps:
    2
    Spells:
    3
    Template:
    2
    Resources:
    7
    Thanks all, now I have some great experiences for my next spell
     
  11. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    Make this use dynamic indexing... so that it would be able to support more than 50 rocks (by utilizing all the possible indexes)...
     
  12. vuongkkk

    vuongkkk

    Joined:
    Oct 13, 2010
    Messages:
    78
    Resources:
    2
    Maps:
    1
    JASS:
    1
    Resources:
    2
    An array variable would take more space than 3 non-array?

    @MortAr; tjordell:
    GUI array allows you change the size. But this size is used for initiating default values. In the fact, the array of variable RD_TempPoint is still 8192
    ~ Then the answer is YES.

    jass array is a other situation, if creating like this: udg_RD_TempPoint[3]
    ~ Then the answer is that they are no different. They take the same space

    You should know that even you not use, it will take some space after the initiation
     
  13. RakEnRoL

    RakEnRoL

    Joined:
    Sep 2, 2011
    Messages:
    316
    Resources:
    0
    Resources:
    0
    I like the spell but something tells me that it lacks something.
     
  14. leonguyen112

    leonguyen112

    Joined:
    Dec 20, 2010
    Messages:
    53
    Resources:
    7
    Maps:
    2
    Spells:
    3
    Template:
    2
    Resources:
    7
    What is lack? Can you tell me?
     
  15. xIceShotx

    xIceShotx

    Joined:
    Aug 31, 2011
    Messages:
    115
    Resources:
    1
    Spells:
    1
    Resources:
    1
    It means something bad is happening and it needs to be kind of improved:
    Online Dictionary:
    Deficiency or absence of something needed, desirable, or customary.
    2:
    Something missing or needed.
    :p hope that helps
     
  16. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    I think the posts above already told you what was lacking in this spell...
     
  17. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,538
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    This spell really needs a proper configuration, Atm it's rather difficult to modify for /anyone/ considering you have to go through all the triggers to change stuff, also you should use variables for the dummy unit/spell/effects.
     
  18. leonguyen112

    leonguyen112

    Joined:
    Dec 20, 2010
    Messages:
    53
    Resources:
    7
    Maps:
    2
    Spells:
    3
    Template:
    2
    Resources:
    7
    ^
    I fixed and updated, thanks you for your advices.
     
  19. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,538
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    Your jump damage modification in the config won't actually work for levelling, considering it'll be set once (i.e. the level of the ability of triggering unit == 0) and thus regardless of if the ability is level 3 it'll be the same strength as level 1 (60 damage) even though level 1 should deal 90 and level 3 should deal 150
    I'd suggest having two variables of the each configurable: One for BASE stat, and one for PER LEVEL stats, I.e. Jump_Damage_Base = 60, Jump_Damage_Per_Level = 30 and then do the calculation for it at the start of the spell being run:
    • Set RD_Damage[RD_MUI] = RD_Jump_Damage_Base + (Jump_Damage_Per_Level * (Level of Ability for (Triggering unit)))


    Repeat the process for all the other configurables as well (even if the Per_Level version is 0.00/0 so that it gives a greater freedom to all the users of the spell, this'd be in your case, AOE, Jump Times and prehaps jump speed) as the others there is no purpose in having them change per level to increase/decrease the overall power of the spell.

    EDIT: you should also use that Caster Variable in your casting trigger to replace all the (Triggering Unit) brackets which'll appear if you do that formula I gave above for all your configurations