[Trigger] OE/GUI "Charge" ability

Status
Not open for further replies.
Level 48
Joined
Jul 29, 2008
Messages
9,823
The eternal question:

I'm looking to make a simple "Charge" ability (technically called "Bullrush" for important reasons). Specifically, I want my Hero to:
- Select a Target
- Run (at increased speed & through other units, with Walk Fast animation) towards the Target
- Do Something* to/once at the Target
- Making Noise & having a Buff would be pluses.

I'm trying to do this as simply as possible, relying on a combination of Object Editor witchcraft + just enough GUI to get the job done. Specifically, relying on existing abilities. No (v)JASS solutions, if you please.
*"Something" is intentionally vague; I'm not actually 100% sure yet what I want to happen. Classics would be "dealt damage" and/or "Stunned", but I'm also considering "AoE Damage" or "some random status ailment" & other stuff. Basically I just need a 'catch-able' event to fire off at the terminus of the spell; I can take it from there.

Here's what I have so far:

=OE=
Two abilities:
- "Bullrush": Hero ability, modified Storm Bolt (orderID: thunderbolt) with a 100 cast range (& some other minor changes)
- "DUMMY - Bullrush - Speed & Walkthrough": Dummy ability, modified Wind Walk, with higher Movement Speed Increase (1.00 from 0.10) and modified Transition Time (-1.00 from 0.60)

=TE=
  • Bullrush
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(thunderbolt))
    • Actions
      • Animation - Add the fast animation tag to (Triggering unit)
      • Unit - Add DUMMY - Bullrush - Speed & Walkthrough to (Triggering unit)
      • Unit - Order (Triggering unit) to Orc Blademaster - Wind Walk
      • Unit - Remove DUMMY - Bullrush - Speed & Walkthrough from (Triggering unit)
  • Bullrush Slow Down
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bullrush
    • Actions
      • Animation - Remove the fast animation tag to (Triggering unit)
Nominally it works; when ordered to Bullrush the Hero immediately gains-casts-loses the Dummy WW (plays the sound, gives the buff, buffs the speed, walks through units), also using Walk Fast. When this is done against a single, lone target, it even gets rid of the Walk Fast.

However, when done again & again, or with a group of enemies around him, he seems to keep Walking Fast, even after it's done. I dived a bit into this & found he wasn't even casting the ability; he gets within range of the target Starts Casting (event registered & displayed via triggers), but never Finishes Casting the Bullrush spell (specifically, I get "Start" and "Finish" instantly (WW), then a "Start" when it reaches the target & the animation begins, but no "Finish" (& no effect).

Also, when Bullrushing out of a group of attacking enemy units, he can't seem to do it at all; he gets-casts-loses the Dummy WW, but gets... 'distracted'? By the attacking & calls it off, turning back to attack them back.

~~~

This is rather frustrating since it seems like it should be rather simple. I'd really like to keep using WW if possible (fortuitously it doesn't seem to interrupt current orders (*??)), since it solves several problems (sound, buff, MS, *walkthru*). I tried Finger of Death before Storm Bolt & no dice.

Help is greatly appreciated!

//EDIT// - My hope is for the spell to 'happen' (i.e. mana used & cooldown activate) when it is cast. Also, since I design spells that are meant to "fit in" with the rest of the spells in Warcraft, everything must be MUI and MPI (just like the regular spells).
 
Last edited:
Level 16
Joined
Mar 25, 2016
Messages
1,327
I have a few questions, how your spell shoul work.

While he is running towards the target, should you be able to cancel the spell?

When should the actual skill be casted (mana and cooldown):
When he attacks the target or when he starts running towards the unit?

Edit:
You could try to add this at the end of your Bullrush trigger.
  • Trigger - Turn off (This trigger)
  • Unit - Order (Triggering unit) to Human Mountain King - Storm Bolt (Target unit of issued order)
  • Trigger - Turn on (This trigger)
Units in wind walk act a little bit differently. It is true that wind walk does not interrupt orders and the unit will just continue its order. But if the order given was a invisiblity-breaking order the caster will not do this order after wind walking (storm bolt would break his invisiblity so he will not use it automatically). You must give these orders again after wind walking.

The trigger turn of/on actions are to avoid infinite loops.
 
Last edited:
Level 48
Joined
Jul 29, 2008
Messages
9,823
ALRIGHT, so I took my time getting back but I did not forget.

Abovegame, thank you for your feedback.
Jampion, thank you for your feedback, and a special thank you because IT WORKED. That's what I needed. : ) Apparently it was ignoring the first cast because it was now Wind Walking & didn't want to break it's invisibility (which wasn't there due to the negative Transition Time, which I thought the game 'knew' because it wasn't doing the Backstab Damage which it only does if he's fully invisible but WHAT THE HECK, why not Blizzard).

Now it works perfectly*, so I really appreciate it!

~~~

*By 'perfectly', I mean 'it works as intended, as long as the player doesn't mess anything up (or intentionally try to break it)'. Which, unfortunately, I kinda have to worry about.

The biggest issue is rooted in the questions you were asking, Jampion, about "when it's cast" and cooldown & mana-usage & all that. So I didn't really care, but it turns out that all that (cooldown/used mana/etc) happens only when the modified Storm Bolt (actual "Bullrush" ability on the hero) is actually cast, not when it's Ordered (which is how the rest of the trigger/ability is activated). This means that, if a player were somehow able to stop him mid-charge, he wouldn't have actually cast the ability (& thus be able to cast it again immediately).

Well guess what? They can. And the obvious solution (adding Locust during the Bullrush) doesn't work because adding/removing Locust is fraught with peril & permanent errors (did a lot of research, though I may be wrong).
So I have a sort of poor-man's Unselectability going; when the spell starts it Deselects him, and if a player (have to figure out how to make it 'any player' instead of 'player 1 Red'...) selects him, it deselects him.

So problem solved!... Except not really, because the deselect doesn't happen fast enough to stop a dedicated player. Heck, I'm not even a high-APM guy & I got him to stop mid-run. That, plus hotkeys; definitely a problem.

So I guess the next question is: 'How much do I need to care?' It essentially works perfectly under ideal conditions (with some 'reset' triggers to get rid of the fast-walk animation for those edge cases). Most players will only hurt themselves with the bug (i.e. stop the guy mid-Bullrush, he's stuck there unselectable until the WW-buff naturally fades away), but a select few might be able to take advantage (i.e. stop the guy right as he reaches his target, then select another target to run even further. Or endlessly chase a guy down).
If there's a better way to force deselect, I'm all ears. If there's a better way to mitigate bad orders (I tried to look into the whole "catch any other order & replace with the original", but the original is either a spell or an attack which is targetted, meaning I'd have to remember the target somehow between triggers, for each unit of each player (even if, as a hero, there should only be one).

Lotta words. I understand if they scare you off. But I appreciate your time, and possibly your help. : ) Thanks again for getting me this far; hopefully I can whip up a GIF to show off how cool it looks. : )

//EDIT// - Just thought of a possible pseudo-partial-fix... A big problem would be an advanced player 'extending' the Bullrush indefinitely through careful timing & a long string of enemies (i.e. start Bullrushing, but can re-cast the ability again & again while Charging to go on forever). If I add a check in the original trigger for not having the Bullrush (WW) buff (i.e. "Condition: Ordered unit does not have Bullrush buff"), that might solve that problem...
 
Last edited:
Level 16
Joined
Mar 25, 2016
Messages
1,327
First of all think it's generally bad if you make spells that use their effect when they are issued. Because you can use them at any range and they don't cost mana/cooldown once issued. I would try to make a spell that is activated by casting an ability. This way no one can abuse it, because it always costs mana. This works only if it is ok for you if the caster casts a spell (plays his casting animation) before running towards the target. You could also set cast point to 0, but that's probably not what you want.

Edit: Map uploaded. I used cripple as a base spell. You can of course use a different base spell. I used Weep's GDD to detect when the caster attacks. You might want to check, if the damage comes from an attack and not from other sources.
 

Attachments

  • Test5.w3x
    25.6 KB · Views: 85
Last edited:
Level 48
Joined
Jul 29, 2008
Messages
9,823
MAN this is getting frustrating.

~~~

Those are some good points; the way it is now, the player can use this to zoom across the map without any investiture of mana or cooldown (since it procs on "issued spell order").

I greatly appreciate you taking the time to set up a test map for me, and it appears to work... But (& I should've said this in the first post), I'm looking to concoct a solution with solely the OE & TE, no outside systems.

That being said, you opened my eyes to the reality that I'm just going to have to trigger more of this than I thought; essentially all of it (the spell's actual effects, the running, the animation, etc). "But that's ok", thought I, "shouldn't be more than an annoyance".

...

It doesn't work. Like, entirely. I have used the modified Finger of Death & modified Cripple (per your suggestion), both given a loooong Cast Range so they happen immediately. Then a trigger to catch "starts effect of spell" (also "finishes casting", which also didn't work). In the trigger, simply make him 'fast', *Order him to Attack the spell target* (later simply *Order him to Move to Spell target*), give-cast-remove modified Wind Walk, and a repeat of the Order for good measure.

And it doesn't work. Like, at all. No motion whatsoever. It's like even with triggers I can't tell this guy to move.

Specifically, even outside of combat (i.e. distractions), I press the ability & choose a target, he moves within range, then does his spell anim... Then sits there. Debug messages tell me he does:
- cripple
- Started
- move
- wind walk
- Started
- Finished

This proves he is given the 'move' order, yet he does not move. (when I do "finishes casting", I receive an extra "Finished" (cripple finishes) in place of the "move"; he doesn't receive either of the two 'move' orders).

~

I'm close to wit's end with this one; I've tested nearly a dozen little permutations & changes. Thoughts?
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
So you don't like it, because of the damage detection system? The damage detection system is also only Trigger Editor. But if you don't like it, you can use the attacks a unit event and trigger the attack by animation.

If you could post your triggers, maybe I can see why they are not working?
Since I don't know your triggers I can only assume. I used in my map a trigger "cancel" that triggers when the caster is issued an order and stops the spell. Maybe you have a similar trigger that triggers when you order your unit to move in your trigger?
Maybe you are using waits in your triggers and some variables are overriden?

I would also like to know what exactly you don't like about the test map I made.
 
Level 48
Joined
Jul 29, 2008
Messages
9,823
So you don't like it, because of the damage detection system? The damage detection system is also only Trigger Editor. But if you don't like it, you can use the attacks a unit event and trigger the attack by animation.
It's not that I 'don't like it'; I was saying it wasn't quite what I was looking for, due entirely to my omission of "avoiding scripts/systems" in the first post.

Yeah, I probably would use "unit is attacked". I have trouble triggering animations, though.

Jampion said:
If you could post your triggers, maybe I can see why they are not working?
Since I don't know your triggers I can only assume. I used in my map a trigger "cancel" that triggers when the caster is issued an order and stops the spell. Maybe you have a similar trigger that triggers when you order your unit to move in your trigger?
Maybe you are using waits in your triggers and some variables are overriden?
I never use Waits, so that's not it.
I turned off all the other triggers but the one & it still wasn't working.

Yes, I apologize; I've been answering some posts from my mobile phone, so I haven't always had access to the test map. Lemme grab those & post them (will Edit).

Jampion said:
I would also like to know what exactly you don't like about the test map I made.
I'm sorry if something about what I said upset you. It was unintentional. I did not dislike your test map. To be fair, I saw the system & tried it once, then just skimmed over the rest. It might work perfectly well; I'm going to test it again here soon.

we have multiple such charge abilities on the hive, simply use one of them.
I appreciate the thought, but for one, my experience is that submitted spells tend to have systems associated with them or be entirely coded from the ground up (where what I am looking to accomplish is a mixing of OE & TE influences, leaning heavily on the OE). Also, what fun is that? I'm trying to learn skillz, man. : )
 
Level 48
Joined
Jul 29, 2008
Messages
9,823
Jampion, I'm sorry, but my computer froze & I lost all the work I had done trying to make the Charge ability work again (in fact, it went further back to stuff that was making the original work). I will try to recreate it, but it will be a bit, because it's very late for me. I've got to get some sleep.

Basically, though, I just copy/pasted the old triggers over & changed it from "thunderbolt" to "fingerofdeath" and instead of "issued order" it was "on cast". Also instead of ordering it to cast something, I ordered an attack (and finally, desperately, just a move command). All wrapped on either side of the standard "add fast/add-cast-remove WW", etc.

you could move the unit by trigger. you can make the amount moved based on it's 'proper' movement speed.
Yeaaaah... But then I might as well trigger the whole thing. I am not impressed by trigger-ordered movement (sorry Eagle XI; my main problem with the Charge spell on your Human Knights); my whole goal here was to use the in-game abilities to sorta work with existing stuff (their regular Move, their regular Attack, etc).
 
Level 25
Joined
Oct 18, 2008
Messages
945
I suppose you could drop the wind walk as a rune.

--

also I remember some trouble with giving orders to units in triggers that relate to other orders. I always do like this though I don't remember what exactly was the issue it was meant to fix. might have been same as yours.

pause unit
tell unit to stop
unpause unit

try with that, either replacing the stop order with your actual order or just stopping it before giving yours.
 
Last edited:
Level 16
Joined
Mar 25, 2016
Messages
1,327
I was not upset. Sorry if it sounded like this. I just wanted to know if the spell in the test map works like you want your spell to work. Because its important for me to understand how your spell should be like in order to help.

The animation thing would be something like this:

if unit is attacked by caster

pause caster
play attack animation of caster
wait caster's damage point

do your actions:
trigger the damage from the attack + the bonus effect from the spell

wait caster's backswing point

reset animation
unpause unit

Waits will be replaced by timers.
The problem with unit is attacked compared to unit is damaged(from DDS) is that you need to trigger the damage from your attack.
You can of course say, that attacks with this spell deal 100 damage, but that would ignore damage modifying effects (items, auras, cripple, roar, ....).

In the end if you want to have damage modifying effects on your attack you need a DDS.
(except you make a lot of ifs to check which buffs/items the hero has)

One question: Does the spell need to be MUI?

I will now try to add the animation thing to my map.
 
Level 48
Joined
Jul 29, 2008
Messages
9,823
I will look into what you have written. However, you reminded me of a few things:

1) I looked deeper into your triggers & see that yes, the DDS was simply to avoid "unit is attacked" and give you greater control (which I am fine relinquishing).

So then looking at the rest of your code... I'm seeing a lot of Timers. I've never honestly used Timers. They seem to work (the spell effect is correct AFAIK, good job/thanks), but my next question is are they MUI/MPI?

2) This answers your last question: Yes, I definitely need these to be both MUI & MPI. I don't know if that means making variable arrays for all 12 players, or instead making them local variables with custom script, or something else entirely.

I design spells that are meant to "fit in" with the rest of the spells in Warcraft; I do 5th-race/neutral tavern 'additions'. So I have to avoid the dreaded Buff Stacking, I generally don't re-make stuff in the game (except for certain circumstances), and everything must be MUI and MPI (just like the regular spells). Something else I should've put in the first post; sorry.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
For now it is not MUI but I think I should be able to do it. Ok I see now why want as few triggereing as possible. I think that in this case a DDS is better than attacked unit. The user won't see that there is a DDS behind the spell and it will fit. However using attacked unit and pausing unit with animation would feel a bit weird, because casting units are not paused in standard Warcraft.

The timers are just to wait, so the unit has time to do orders I give them. In spells you should never use waits, because the are inaccurate and cause problems in multiplayer games.

Mentioning that it has to be MUI is not as important. You first try to make the spell work for one unit then you can make the next step.

I will try to make it MUI.

Edit: MUI now -> Attached Map

Base spell notice:
It appears you can have cripple as a base spell as long as you don't modfiy the data(movement speed reduction, attack damage reduction, buff). Set your duration to 0.01. If you cast Bullrush on a crippled unit cripple will stay, because buff and data are the same and its duration is longer than the duarion of your modified cripple.
 

Attachments

  • BullrushMUI.w3x
    29.2 KB · Views: 119
Last edited:
Level 16
Joined
Mar 25, 2016
Messages
1,327
I noticed that I did not need any timers. But if you want a Spell to be MUI you need also different timers. So they would make it harder. I just edited my post above the MUI verision is finished.
Instructions are included you should be able to easily copy it to your map.
 
Level 11
Joined
May 16, 2016
Messages
730
I'm looking to make a simple "Charge" ability
Very easy. You need:
1) set paramters in USE ABILITY trigger (where ability being cast is Charge)
2) find a walking animation index for your model (for example walking animation index for mountain king is 7). You can use command -anim xx to find the suitable index of selected units. If you find it then find in USE ABILITY paragraph ANIMATION INDEX and change Set integet = xx.
3)Make fun.
 

Attachments

  • CHARGE.w3x
    19.6 KB · Views: 125
Last edited:
Status
Not open for further replies.
Top