• 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.

AoE skill

Status
Not open for further replies.
Level 17
Joined
Mar 21, 2011
Messages
1,611
hi
i want to do a spell that roots all enemies in target area (200AoE)
i did it like that:
unit starts the effect of an ability
equal to roots
pick every unit in 200 of target point of ability being cast
create 1 ROOT_DUMMY at position of picked unit
add a 3 sec expiration timer to last created unit
order last created unit to STUN_SKILL picked unit

ofc id didnt removed leaks, but thats not the problem, the problem is that i create one dummy for each unit in the AoE, thats not that good, isnt it?
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
ok ty :D , but how can i remove the location leaks, i mean at "position of picked unit", cause its changing all the time cause there are more picked units.
maybe like that?:
Set POINT = position of picked unit
create 1 ROOT_DUMMY at POINT
add a 3 sec expiration timer to last created unit
order last created unit to STUN_SKILL picked unit
Call RemoveLocation (udg_POINT)

and another question, how can i give the skill a small delay, that means it takes 1 sec until it gets activated BUT your hero can move while that
 
Level 16
Joined
May 1, 2008
Messages
1,605
Yes! You just store the location into a variable, refer to it and destroy it after.

About the other thing. Well you mean you click on the ability, and a second later the stunt appears at the current position of the hero?
- Well since you want that your hero move while "casting", you have to trigger it in a MUI way.
Or you mean the hero cast it, and a second later the stunt appears, where the hero stood when casting?
- Then you can just delay the unit cast time in the object editor.

Greetings and Peace
Dr. Boom
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
So now it looks like that:

  • Overgrowth
    • Events
      • Einheit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Overgrowth
    • Actions
      • Set Point_Overgrowth[1] = (Target point of ability being cast)
      • Set Group_Overgrowth = (Units within 200.00 of Point_Overgrowth[1] matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in Group_Overgrowth and do (Actions)
        • Loop - Actions
          • Set Point_Overgrowth[2] = (Position of (Picked unit))
          • Unit - Create 1 Roots for (Owner of (Triggering unit)) at Point_Overgrowth[2] facing Vorgabe für Gebäude-Ausrichtung degrees
          • Unit - Add a 3.00 second Standard expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Menschen-Bergkönig - 'Sturmschlag' (Picked unit)
          • Custom script: call RemoveLocation (udg_Point_Overgrowth[2])
      • Custom script: call DestroyGroup (udg_Group_Overgrowth)
      • Custom script: call RemoveLocation (udg_Point_Overgrowth[1])
 
Level 16
Joined
May 1, 2008
Messages
1,605
Well seems to be it works no? Just small things:

- It's not Unit - Create 1 Roots for (Owner of (Triggering unit)) , you need to replace (Triggering Unit)) with the variable.
- If you want use GUI and variables here, then create one for the dummy and refer to the variable. So you just use (Last created unit) just once not twice.
- Trust me make these spells in Jass and stop wasting memory for GUI and variables for instant spell.
- Scheinbar bist/verstehst du auch Deutsch. Schade aber auch, dass hier nur Englisch erlaubt ist^^

Greetings and Peace
Dr. Boom
 
Level 11
Joined
Nov 15, 2007
Messages
800
Make sure the dummy's cast point is 0 in object editor and it has movement type: none and 0 speed (that way it won't have to turn to face its target).

Also, the most efficient trigger-enhanced spell system would consist of a single dummy unit for casting "invisible" spells which is recycled, so you don't even need to constantly create and add timers to dummies. Especially since units will leak a bit of memory unavoidably even when removed from the game completely, so it's best to just create as few units as possible to begin with. It's very difficult to avoid with "visible" spells, though - i.e., abilities with custom projectiles and such.
 
Level 16
Joined
May 1, 2008
Messages
1,605
No I think he mean the following:

Just give the ability you want cast, in this case the Stormbolt, 99999 casting range.
In your trigger you create a point at the position of the spell target and at this point you can create the dummy, which cast the ability to the target.
So you just use 1 point for both situation.

Hint: Well I don't think you need 99999 casting range. The maximal casting range would be x * y of your map, but even a value like 2000 should be enough^^

Greetings and Peace
Dr. Boom
 
Level 16
Joined
May 1, 2008
Messages
1,605
Uhh come on.. at your first trigger you use (situation 1) a location for picking up all targets into a group and (situation 2) another location to store the position of the picked unit.
Now you use just one location for (situation 1) and (situation 2). NVM! just post the trigger =D
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
y as i said "NOW" i use only 1 location


  • Overgrowth
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Overgrowth
    • Aktionen
      • Set Point_Overgrowth = (Target point of ability being cast)
      • Set Group_Overgrowth = (Units within 155.00 of Point_Overgrowth matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Gleich True) and (((Matching unit) is alive) Gleich True)))
      • Einheit - Create 1 Roots for (Owner of (Triggering unit)) at Point_Overgrowth facing Vorgabe für Gebäude-Ausrichtung degrees
      • Einheit - Add a 3.00 second Standard expiration timer to (Last created unit)
      • Einheitengruppe - Pick every unit in Group_Overgrowth and do (Actions)
        • Schleifen - Aktionen
          • Einheit - Order (Last created unit) to Menschen-Bergkönig - 'Sturmschlag' (Picked unit)
          • Einheit - Cause (Triggering unit) to damage (Picked unit), dealing (50.00 + (50.00 x (Real((Level of Overgrowth for (Triggering unit)))))) damage of attack type Zaubersprüche and damage type Magie
      • Custom script: call DestroyGroup (udg_Group_Overgrowth)
      • Custom script: call RemoveLocation (udg_Point_Overgrowth)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
A unit has their own casting time , you can't order 1 unit to cast spell to like, 50 units in that area at once.

You can only optimize the trigger to only use 1 Locations (put all dummy units in 1 location, be sure their collision size is 0 - Object Editor) instead creating them at each Picked Unit's location, that's all

But unit creation still must be created = number of units in that area
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I tried in GUI having that dummy an instant cast time
Well, it looks like its max speed for cast is 2 per units (via trigger)

If I use Queue Order Command (controls-related (SHIFT + Order Ability)), the unit can perform all abilities an instant (well, the time delay would have been 0.01 I guess) = JASS system
I think that JASS uses Queue Command ?
 
Level 11
Joined
Nov 15, 2007
Messages
800
A unit has their own casting time , you can't order 1 unit to cast spell to like, 50 units in that area at once.

You can only optimize the trigger to only use 1 Locations (put all dummy units in 1 location, be sure their collision size is 0 - Object Editor) instead creating them at each Picked Unit's location, that's all

But unit creation still must be created = number of units in that area

Incorrect. One dummy unit is all that's required on the entire map for every single instant ability, and it's most efficient to do it this way.

The "trick" to getting a single dummy to instantly cast infinite amount of times is to remove its movement. Units that are capable of moving are required to turn and face their target before an ability can be cast. If a unit has a cast point of 0 and no movement, the time it takes to cast an ability is 0.

Proof of concept map attached.
 

Attachments

  • dummytest.w3x
    18.9 KB · Views: 170
Level 11
Joined
Nov 15, 2007
Messages
800
So I have found out the problem is

It's the Movement - Speed Base of the unit on Object Editor

If the setting is set to 0, the dummy will cast the ability instantly to all units

If it has at least 1 movement speed, it will not cast instantly to all units

What a discovery :crazz:
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I'm not satisfied with your dummy, that's why I made a comparison between my dummy and yours, well the discovery is yours too for setting the movement speed to 0 :)

I don't usually set my dummy to 0 because it does not update its animation with SetUnitX/Y function (but the unit is actually moving, but the model is not) and this is why I prevent myself from setting it to 0, what a wonder

I also don't know 1 dummy can cast to multiple of units at once, it will be more efficient from now on I think

EDIT:
Or are you being sarcastic, LOL...
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Nonono, it's not actually "animated", it's what what the dummy represents

Okay, create a dummy with 0 MS and use a Peasant model and use the function SetUnitX/Y

You will notice that only the shadow of that unit is moving, while the model itself, stuck on the initial position.

This is not useful if we are to create a shockwave-type spell that requires a dummy to become the shockwave itself (or missile perhaps)
 
Level 11
Joined
Nov 15, 2007
Messages
800
That's one of the reasons this is only useful for instant spells. You can still make more efficient projectiles/dummy effects/etc. by storing the units to variables and hiding them when they aren't needed, rather than creating them with expiration timers or removing them, but it's generally a lot more work for a minor decrease in memory usage.
 
Status
Not open for further replies.
Top