• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

"Storm Attack"

Status
Not open for further replies.
Level 13
Joined
Oct 28, 2019
Messages
523
Anyone has played Knights and Merchants? In that old game, if a melee unit start fight with an enemy, the player looses the control of it, until the fight is over and there´s no one enemies near.
This already done.

But other issue, when a swordman (footman) is ordered to "storm attack" it gains 100% speed movement and runs to the front (the player cant control the unit for some seconds, it turns to a other player)

any idea how this can be do?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Bloodlust can increase a unit's movement speed by a %. So can an aura like Endurance Aura or Unholy Aura.

You can have a Dummy unit cast Bloodlust on your footman when it casts Storm Attack. Or simply Add one of these Auras to the unit in response. The aura option is nice if you don't want the buff to be dispellable.

To order the unit to the front we would need to know where the front is. Maybe you just want the footman to find a nearby enemy unit and try to attack it? It could also be told to find the closest nearby enemy unit instead. If your map is simple enough like top vs bottom you could determine which direction to attack towards based on the team of the footman.

But I don't fully understand what you want to be honest.
 
Last edited:
Level 13
Joined
Oct 28, 2019
Messages
523
Bloodlust can increase a unit's movement speed by a %. So can an aura like Endurance Aura or Unholy Aura.

You can have a Dummy unit cast Bloodlust on your footman when it casts Storm Attack. Or simply Add one of these Auras to the unit in response. The aura option is nice if you don't want the buff to be dispellable.

To order the unit to the front we would need to know where the front is. Maybe you just want the footman to find a nearby enemy unit and try to attack it? It could also be told to find the closest nearby enemy unit instead. If your map is simple enough like top vs bottom you could determine which direction to attack towards based on the team of the footman.

But I don't fully understand what you want to be honest.
OK ty, let me explain better. For ex 1 footman, it is facing angle to 90º... if I cast "storm attack" it runs with speed bonus to the original facing angle and runs for 5 seconds, in this time it turns to another player, making him incontrolable....

The storm attack, make the unit runs to his actual facing angle....

the part of incontrolable unit, let to other time, how do a trigger that storm attack make the unit runs for x seconds to the location of actual facing angle?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Storm Attack
  • Actions
    • Custom script: local unit udg_TempCaster = GetTriggerUnit()
    • Custom script: local player udg_TempPlayer = GetOwningPlayer(udg_TempCaster)
    • Set Variable TempPoint1 = Position of TempCaster
    • Set Variable TempPoint2 = (TempPoint1 offset by 3000.00 towards (Facing of TempCaster) degrees)
    • Unit - Change ownership of TempCaster to Computer X
    • Unit - Order TempCaster to Attack-Move to TempPoint2
    • Unit - Create 1 Dummy unit at TempPoint1...
    • Unit - Add a 0.25 second Expiration Timer to (Last created unit)
    • Unit - Add Storm Attack (Bloodlust) to (Last created unit)
    • Unit - Order (Last created unit) to Orc - Bloodlust TempCaster
    • Custom script: call RemoveLocation(udg_TempPoint1
    • Custom script: call RemoveLocation(udg_TempPoint2
    • Wait 5.00 game-time seconds
    • Unit - Order TempCaster to Stop
    • Unit - Change ownership of TempCaster to TempPlayer
    • Custom script: set udg_TempCaster = null
    • Custom script: set udg_TempPlayer = null
This trigger requires four variables, TempCaster, TempPlayer, TempPoint1, and TempPoint2.

The local Custom Script stuff can be read about here: local udg_

Ideally, you would use a Timer since Waits are imprecise and you would already have the Computer Player / User Player linked to the Footman using something like Unit Indexing or a Hashtable so you wouldn't need TempPlayer.

For example:
  • Unit - Changer ownership of TempCaster to OwnerComputer[(Custom value of TempCaster)]
  • // wait 5.00 seconds
  • Unit - Changer ownership of TempCaster to OwnerUser[(Custom value of TempCaster)]
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
okk i dont know how put position of (tempcaster) here has only casting unit.... and this works to a unit group?
Quoting my last post: This trigger requires four variables, TempCaster, TempPlayer, TempPoint1, and TempPoint2.

You have to create these variables yourself or else they won't exist. You can rename these variables or use your own versions of them if you'd like. Just remember to update the Custom Script to match the changes.

Also, I don't exactly know what you mean about a Unit Group. Are you asking if it will work for multiple units at the same time (MUI)? If so, yes, that's thanks to the local variables. If you want it to Pick through a Unit Group when you cast the spell then that's a little different.

Just to clarify, a Unit Group is a variable which is used to contain and track multiple units at a time. You would use it with the Pick Every Unit action.
 
Level 13
Joined
Oct 28, 2019
Messages
523
Quoting my last post: This trigger requires four variables, TempCaster, TempPlayer, TempPoint1, and TempPoint2.

You have to create these variables yourself or else they won't exist. You can rename these variables or use your own versions of them if you'd like. Just remember to update the Custom Script to match the changes.

Also, I don't exactly know what you mean about a Unit Group. Are you asking if it will work for multiple units at the same time (MUI)? If so, yes, that's thanks to the local variables. If you want it to Pick through a Unit Group when you cast the spell then that's a little different.

Just to clarify, a Unit Group is a variable which is used to contain and track multiple units at a time. You would use it with the Pick Every Unit action.
Ok If select 12 footmans and cast storm attack, the 12 footmans must do that trigger

other question, what kind of variable is the (tempcaster) If I put unit, dont appear to change position of (tempcaster)

1679444427123.png
 
Status
Not open for further replies.
Top