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

Charge

Status
Not open for further replies.
Level 10
Joined
Apr 22, 2010
Messages
421
While i know there are charge spells on the hive, they arent what i am looking for. What i need a spell taht allows a target unit to move towards a certain point while playing a animation taht damages nearby units, kinda like shockwave, but the missle is replaced by the unit.
how do i do this?
to explain more clearly, i have listed it a a sequence:
1. unit cast a spell
2. unit is moved towards a certain point(not instant)
3a. enemies that a in the path of that unit recive damage
3b.(optinal)(if this spell can be done in gui while including this, then please add, if not, then dont)units that are damaged by this spell are stunned for a short duration
4. if the unit hits a tree/rock/anything thats like the enviorment of a pathing blocker, it stops immediatly.(if you try to use this spell to jump off a cliff, your unit stops at the edge of the cliff.

please help, and thnx in advance
 
Level 5
Joined
Nov 30, 2010
Messages
184
First trigger, event is unit casts spell. Conditions is that spell castes is charge. Action: set spellindex to itself plus one but make sure this is not above the max variable array number (8k something). Set spellcaster to casting unit, spelltarget is targeted location. Pause unit and add it to a unit group called spellgroup. Oh ya... Make a spellpoint variable too which is the point where spellcaster is. make all these arrays with the index of spellindex

Second trigger: event: every 0.5 seconds. Action: for each integer [spellinteger] between 1 and the 8k something array limit, do actions. If there is no destructible within 50 range of unit, play spellcaster's walking animation and move him instantly to spellpoint offset by 50 towards spelltarget. Now pick every unit within 50 range of spellcaster and if they don't have buff hit and is enemy, create a dummy to use storm bolt on them (the buff from storm bolt should be changed to hit) to damage and stun enemy. If spellcaster is near tree or rock, remove him from the unit group. And also unpause him. The array index for the variables here is spellinteger. This is MUI =). I don't know the cliff part, I think you should put some locust units at the cliff edges and make the trigger check for that too along with the trees
 
Level 11
Joined
May 31, 2008
Messages
698
Heres the triggers :D

  • Charge Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Charge
    • Actions
      • Unit Group - Add (Triggering unit) to ChargeGroup
      • Set TempLoc[0] = (Position of (Triggering unit))
      • Set TempLoc[1] = (Target point of ability being cast)
      • Unit - Move (Triggering unit) instantly to TempLoc[0], facing TempLoc[1]
      • Unit - Turn collision for (Triggering unit) Off
      • Animation - Play (Triggering unit)'s attack animation
      • Set MaxDist[(Player number of (Owner of (Triggering unit)))] = 500.00
      • Set Duration[(Player number of (Owner of (Triggering unit)))] = 0.75
      • Set Time[(Player number of (Owner of (Triggering unit)))] = 0.00
      • Custom script: call RemoveLocation(udg_TempLoc[0])
      • Custom script: call RemoveLocation(udg_TempLoc[1])
      • Wait 0.10 seconds
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) is in ChargeGroup) Equal to (==) True
          • Then - Actions
            • Animation - Play (Triggering unit)'s attack animation
          • Else - Actions
  • Charge
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ChargeGroup and do (Actions)
        • Loop - Actions
          • Set DoodadCount = 0
          • Set Caster = (Picked unit)
          • Set Time[(Player number of (Owner of (Picked unit)))] = (Time[(Player number of (Owner of (Picked unit)))] + 0.03)
          • Set TempLoc[0] = (Position of (Picked unit))
          • Set TempLoc[1] = (TempLoc[0] offset by (MaxDist[(Player number of (Owner of (Triggering unit)))] / (Duration[(Player number of (Owner of (Picked unit)))] / 0.03)) towards (Facing of (Picked unit)) degrees)
          • Set TempLoc[2] = (TempLoc[1] offset by 70.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Create 1 Dust Dummy for Neutral Passive at TempLoc[0] facing (Random angle) degrees
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Unit - Move (Picked unit) instantly to TempLoc[1]
          • Set TempGroup[0] = (Units within 128.00 of TempLoc[1])
          • Unit Group - Pick every unit in TempGroup[0] and do (Actions)
            • Loop - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in DamagedUnits[(Player number of (Owner of Caster))]) Equal to (==) False
                  • ((Picked unit) belongs to an enemy of (Owner of Caster)) Equal to (==) True
                • Then - Actions
                  • Unit - Cause Caster to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
                  • Unit Group - Add (Picked unit) to DamagedUnits[(Player number of (Owner of Caster))]
                • Else - Actions
          • Destructible - Pick every destructible within 85.00 of TempLoc[2] and do (Set DoodadCount = (DoodadCount + 1))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Multiple ConditionsOr - Any (Conditions) are true
                  • Conditions
                    • Time[(Player number of (Owner of (Picked unit)))] Greater than or equal to (>=) Duration[(Player number of (Owner of (Picked unit)))]
                    • (Terrain pathing at TempLoc[2] of type Walkability is off) Equal to (==) True
                    • DoodadCount Greater than (>) 0
              • Then - Actions
                • Unit Group - Remove (Picked unit) from ChargeGroup
                • Unit - Unpause (Picked unit)
                • Unit - Turn collision for (Picked unit) On
                • Unit Group - Pick every unit in DamagedUnits[(Player number of (Owner of Caster))] and do (Unit Group - Remove (Picked unit) from DamagedUnits[(Player number of (Owner of Caster))])
                • Animation - Reset (Picked unit)'s animation
              • Else - Actions
          • Custom script: call RemoveLocation(udg_TempLoc[0])
          • Custom script: call RemoveLocation(udg_TempLoc[1])
          • Custom script: call RemoveLocation(udg_TempLoc[2])
          • Custom script: call DestroyGroup(udg_TempGroup[0])
  • RemoveDust
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Dust Dummy
    • Actions
      • Unit - Remove (Triggering unit) from the game
It also includes making dust behind him when he is charging :p and he will do attack animation while charging too.
Here's the map
 

Attachments

  • charge.w3x
    21.7 KB · Views: 103
Level 11
Joined
May 31, 2008
Messages
698
No problem :) im thinking of also uploading this to spells section since i already made it and it works good, if i do i will probly make it have levels as well and maybe other improvements. And ill give you credit for the idea of course :)
I will post the link here if i end up doing that
 
Level 10
Joined
Apr 22, 2010
Messages
421
Hey, i know i said it worked, but it was onkly in your map, for some strange reason, when i imported it into my map, the hero just stood there, and didnt play out the animation i wanted, the only thing i changed was giving the charge ability tooltip and manacost and cooldown, changed the animation from attack to a custom one, and changed the damage dealt, and added a variable that counted the level of the ability, any clues?
 
Level 11
Joined
May 31, 2008
Messages
698
Yeah it would be better if i could take a look at the map, and im not gonna steal anything lol :p

EDIT:
I'm also making a few improvements on it too, so if you give me your map, then i will just add them to that for you
 
Level 11
Joined
May 31, 2008
Messages
698
Okay i found the mistakes, sorry i had one thing as triggering unit instead of picked unit xD
I also fixed a couple other things, animation works now.

Btw, i placed a chaos contraption hero in the sentinel base so it would be easier for me to test and stuff :p so you should probly delete that guy xD
Also, when the priests and siege guys spawned they didnt seem to move, i just noticed it one time i was testing the spell lol

Alright, it wont let me upload the map..
  • Charge Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Charge
    • Actions
      • Set Charge_Level = (Level of Charge for (Triggering unit))
      • Unit Group - Add (Triggering unit) to ChargeGroup
      • Set TempLoc[0] = (Position of (Triggering unit))
      • Set TempLoc[1] = (Target point of ability being cast)
      • Set Angle[(Player number of (Triggering player))] = (Angle from TempLoc[0] to TempLoc[1])
      • Unit - Turn collision for (Triggering unit) Off
      • Unit - Pause (Triggering unit)
      • Set MaxDist[(Player number of (Owner of (Triggering unit)))] = 500.00
      • Set Duration[(Player number of (Owner of (Triggering unit)))] = 0.75
      • Set Time[(Player number of (Owner of (Triggering unit)))] = 0.00
      • Set AnimBool[(Player number of (Owner of (Triggering unit)))] = False
      • Custom script: call RemoveLocation(udg_TempLoc[0])
      • Custom script: call RemoveLocation(udg_TempLoc[1])
Changes:

Add:

  • Set Angle[(Player number of (Triggering player))] = (Angle from TempLoc[0] to TempLoc[1])
  • Unit - Pause (Triggering unit)
  • Set AnimBool[(Player number of (Owner of (Triggering unit)))] = False
Remove:

  • Unit - Move (Triggering unit) instantly to TempLoc[0], facing TempLoc[1]
  • Animation - Play (Triggering unit)'s Spell Slam - Drift animation
  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Triggering unit) is in ChargeGroup) Equal to (==) True
    • Then - Actions
      • Animation - Play (Triggering unit)'s attack animation
    • Else - Actions
  • Charge
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ChargeGroup and do (Actions)
        • Loop - Actions
          • Set DoodadCount = 0
          • Set Caster = (Picked unit)
          • Set Time[(Player number of (Owner of (Picked unit)))] = (Time[(Player number of (Owner of (Picked unit)))] + 0.03)
          • Set TempLoc[0] = (Position of (Picked unit))
          • Set TempLoc[1] = (TempLoc[0] offset by (MaxDist[(Player number of (Owner of (Picked unit)))] / (Duration[(Player number of (Owner of (Picked unit)))] / 0.03)) towards Angle[(Player number of (Owner of (Picked unit)))] degrees)
          • Set TempLoc[2] = (TempLoc[1] offset by 70.00 towards Angle[(Player number of (Owner of (Picked unit)))] degrees)
          • Unit - Create 1 Dust Dummy for Neutral Passive at TempLoc[0] facing (Random angle) degrees
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Unit - Move (Picked unit) instantly to TempLoc[1]
          • Set TempGroup[0] = (Units within 128.00 of TempLoc[1])
          • Unit Group - Pick every unit in TempGroup[0] and do (Actions)
            • Loop - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in DamagedUnits[(Player number of (Owner of Caster))]) Equal to (==) False
                  • ((Picked unit) belongs to an enemy of (Owner of Caster)) Equal to (==) True
                • Then - Actions
                  • Unit - Cause Caster to damage (Picked unit), dealing (50.00 x (Real(Charge_Level))) damage of attack type Spells and damage type Normal
                  • Unit Group - Add (Picked unit) to DamagedUnits[(Player number of (Owner of Caster))]
                • Else - Actions
          • Destructible - Pick every destructible within 85.00 of TempLoc[2] and do (Set DoodadCount = (DoodadCount + 1))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Multiple ConditionsOr - Any (Conditions) are true
                  • Conditions
                    • Time[(Player number of (Owner of (Picked unit)))] Greater than or equal to (>=) Duration[(Player number of (Owner of (Picked unit)))]
                    • (Terrain pathing at TempLoc[2] of type Walkability is off) Equal to (==) True
                    • DoodadCount Greater than (>) 0
              • Then - Actions
                • Unit Group - Remove (Picked unit) from ChargeGroup
                • Unit - Unpause (Picked unit)
                • Unit - Turn collision for (Picked unit) On
                • Unit Group - Pick every unit in DamagedUnits[(Player number of (Owner of Caster))] and do (Unit Group - Remove (Picked unit) from DamagedUnits[(Player number of (Owner of Caster))])
                • Animation - Reset (Picked unit)'s animation
              • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • AnimBool[(Player number of (Owner of (Picked unit)))] Equal to (==) False
              • Then - Actions
                • Animation - Play (Picked unit)'s Spell Slam - Drift animation
                • Set AnimBool[(Player number of (Owner of (Picked unit)))] = True
              • Else - Actions
          • Custom script: call RemoveLocation(udg_TempLoc[0])
          • Custom script: call RemoveLocation(udg_TempLoc[1])
          • Custom script: call RemoveLocation(udg_TempLoc[2])
          • Custom script: call DestroyGroup(udg_TempGroup[0])
*Change:
From:
  • Set TempLoc[1] = (TempLoc[0] offset by (MaxDist[(Player number of (Owner of (**Triggering unit**)))] / (Duration[(Player number of (Owner of (Picked unit)))] / 0.03)) towards (Facing of (Picked unit)) degrees)
To:
  • Set TempLoc[1] = (TempLoc[0] offset by (MaxDist[(Player number of (Owner of (**Picked unit**)))] / (Duration[(Player number of (Owner of (Picked unit)))] / 0.03)) towards Angle[(Player number of (Owner of (Picked unit)))] degrees)
Add:

  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • AnimBool[(Player number of (Owner of (Picked unit)))] Equal to (==) False
    • Then - Actions
      • Animation - Play (Picked unit)'s Spell Slam - Drift animation
      • Set AnimBool[(Player number of (Owner of (Picked unit)))] = True
    • Else - Actions
There, note all the changes, especially the *Change in second trigger
Just make sure with the changes, just in case i forgot to mention it xD

Also, you have to make a couple new variables

And i think it looks good :) the animation is great

Btw, the map looks pretty cool, some of the tooltips just need better grammar :p
 
Level 10
Joined
Apr 22, 2010
Messages
421
hey, thnx, but while i was waiting, i made a new spell using your spell's concepts and it works!
Im still adding you in my credits for the help, though!
also, for some strange reason, i cannot host my map on eurobattle.net, i can make a room, but whenevery someone tries to join, it dont work, and the room dosent appear on the list, can you try hosting this map and see if it works?
i just wanna see if its my map or my computer that is the problem
 
Status
Not open for further replies.
Top