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

[Trigger] multy unit knock back

Status
Not open for further replies.
Level 19
Joined
May 1, 2008
Messages
1,130
hey there i have a problem with this simple trigger, its like a war stump that knocks back units. Well it works if i use a targeted spell on a single unit but it doesn't work for multiple units, anyways here is my trigger and hope u tell me whats wrong with it :p.

basic
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to my stomp (Neutral Hostile 1)
Actions
Set caster = (Casting unit)
Set targetgroup = (Units within 300.00 of (Position of caster))
Wait 0.40 seconds
Unit Group - Remove caster from targetgroup
Unit Group - Pick every unit in targetgroup and do (Actions)
Loop - Actions
Unit - Pause (Picked unit)
Wait 1.00 seconds
Trigger - Turn on basic slide <gen>
Trigger - Run basic slide <gen> (ignoring conditions)
Wait 1.50 seconds
Trigger - Turn off basic slide <gen>
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
Unit - Unpause (Picked unit)[/SIZE][/SIZE][/SIZE]


and second trigger:

basic slide
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
Set targetpoint1 = (Position of (Picked unit))
Set targetpoint2 = (targetpoint1 offset by 8.00 towards (Angle from (Position of caster) to (Position of (Picked unit))) degrees)
Unit - Move (Picked unit) instantly to targetpoint

and Evrika!!! it doesn't work :hohum:
Can some1 post a working trigger to enlighten me?
 
  • basic
  • Events
  • Unit - A unit Begins casting an ability
  • Conditions
  • (Ability being cast) Equal to my stomp (Neutral Hostile 1)
  • Actions
  • Set caster = (Casting unit)
  • Set targetgroup = (Units within 300.00 of (Position of caster))
  • Wait 0.40 seconds
  • Unit Group - Remove caster from targetgroup
  • Unit Group - Pick every unit in targetgroup and do (Actions)
  • Loop - Actions
  • Unit - Pause (Picked unit)
  • Wait 1.00 seconds
  • Trigger - Turn on basic slide <gen>
  • Trigger - Run basic slide <gen> (ignoring conditions)
  • Wait 1.50 seconds
  • Trigger - Turn off basic slide <gen>
  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
  • Unit - Unpause (Picked unit)
  • basic slide
  • Events
  • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
  • Set targetpoint1 = (Position of (Picked unit))
  • Set targetpoint2 = (targetpoint1 offset by 8.00 towards (Angle from (Position of caster) to (Position of (Picked unit))) degrees)
  • Unit - Move (Picked unit) instantly to targetpoint
this makes things clearer :)

If no one else will respond ill try to make you a trigger, im off to bed now :S
 
Level 13
Joined
Jun 5, 2008
Messages
504
Well if you only want to make it working, my eyes say that there aint targetpoint variable created. If that is just some mistake, then ill look that trigger closer later.

Unit - Move (Picked unit) instantly to targetpoint

and as for trigger othwerwise. It has leaks and useless actions.
*edit* And that picked unit wont work. if its on differend trigger + 0,01 seconds would bug --> put it 0,04
so the trigger is pretty much fucked up in every aspect.

I think helpers.net had some gui knockback system and atleast it has some tutorials for gui periodic/mui events. If you dont want it to be mui that would of course make things lot easier.
 
Level 19
Joined
May 1, 2008
Messages
1,130
its not that i want to use it in any fancy spells, i just want to know how to make it work (so that i can further refine it later), and for useless actions, i think this is the simplest u can ever get.
 
  • Set targetpoint1 = (Position of (Picked unit))
  • Set targetpoint2 = (targetpoint1 offset by 8.00 towards (Angle from (Position of caster) to (Position of (Picked unit))) degrees)
  • Unit - Move (Picked unit) instantly to targetpoint
Unless I am mistaken the second trigger has no idea what (Picked unit) and (caster) are as the scope of these Event Response variables apply only to the trigger who's event was repsonded too >.< sounds funny

The second trigger doesnt have the same event responses as the first one. This could be easily fixable in Jass by turning the second trigger into a function withing the first trigger and makeing like this

JASS:
function basic slide takes unit target, unit caster returns boolean
then just convert your actions and use the unit, which would be something like BJGetCaster() and replace it with caster. Maybe tomorrow, zzz too tired for typos, I could write ya up a jass trigger, but unless you know jass you would have trouble editing it...
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
  • basic
  • Events
  • Unit - A unit Begins casting an ability
  • Conditions
  • (Ability being cast) Equal to my stomp (Neutral Hostile 1)
  • Actions
  • Set caster = (Casting unit)
  • Set targetgroup = (Units within 300.00 of (Position of caster))
  • Wait 0.40 seconds
  • Unit Group - Remove caster from targetgroup
  • Unit Group - Pick every unit in targetgroup and do (Actions)
  • Loop - Actions
  • Unit - Pause (Picked unit)
  • Wait 1.00 seconds
  • Trigger - Turn on basic slide <gen>
  • Trigger - Run basic slide <gen> (ignoring conditions)
  • Wait 1.50 seconds
  • Trigger - Turn off basic slide <gen>
  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
  • Unit - Unpause (Picked unit)
  • basic slide
  • Events
  • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
  • Set targetpoint1 = (Position of (Picked unit))
  • Set targetpoint2 = (targetpoint1 offset by 8.00 towards (Angle from (Position of caster) to (Position of (Picked unit))) degrees)
  • Unit - Move (Picked unit) instantly to targetpoint
this makes things clearer :)

If no one else will respond ill try to make you a trigger, im off to bed now :S

Wow! I need that kind of GUI knockback. Could you do that for me maybe even with less triggers. The idea of the spell is:

Here is the idea of my spell,

  • Sonic Disrupter
  • Events
  • Unit - A unit starts the effect of an ability
  • Conditions
  • Ability being cast equal to Cluster Rockets
  • Actions:
  • Set SonicDisrupterArea = Units within 400 of target point of Ability Being cast
Then how can I do the units in that area to be pushed away from that area after the ability is cast and the missile reaches the place? By the way this has to be for a Unit ABility, which means no hero levels and Just 1 level.

Should I create another trigger to slide the units away (all units to be pushed in 1 direction, away from the point and in the same line as the direction of the missiles) and if so, what are the triggers, could you please do the remaining for me? Distance can be equal to the 1500 war3 distance (1500 range, that far distance to be pushed away). And casting range of Cluster Rockets -> 1000. I would really appreciate it + reps and your name will be included in the Credits already made in my map
 
Level 19
Joined
May 1, 2008
Messages
1,130
well this trigger works if i replace group units with a single unit (using the same trigger d'ohh), and the second trigger knows who is caster and who is target(target this time is a variable for the single unit that use) so i ask for someone to make a multy unit knockback trigger that works and post it. I know i made a trigger like this with GUI using the same technique and it worked but i can't remember how i done it. It's something to do with pick all units in targetgroup thingy.
PS: i want to make like a ball that steadily grows in size (using trigger animation-change unit's size), and i want to use it in a periodic event like every 0.4 sec of game thingy and i was wondering can i set a variable as the balls current size and than using animation-change unit's size to "variable"+1 to make it grow? (1. i use a integer base variable but i only find flying altitude, movement speed but not units size)
 
Last edited:
Status
Not open for further replies.
Top