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

General Question About Triggers

Status
Not open for further replies.
Level 2
Joined
Jan 25, 2020
Messages
12
Hi I'm a beginner with all this and I'm just getting a handle on how everything works. I'm going through some of the tutorials here, but if someone can help me answer a few questions that would be great!

1. Am I correct to assume you can more or less bypass the editors ui menu system, setting up triggers and all that, and just script everything? My only concern with that is compatibility with future patches. I'm assuming if you go the scripting route, any changes Blizzard makes would likely break your custom scripts as opposed to routing everything through these drop down menus, which before I spend a lot of time on this, seems like the safer thing to do in the long run.

2. I tried experimenting with some basic custom abilities. I see it's easy enough to create an ability based off an existing one, and then simply modify the attributes respectively. The problem is when I setup a trigger to go off based on when that ability is used, my single trigger action completely replaced the existing ability attributes, rather than add on top of it..

This is kind of a big one I'm trying to understand, as I don't want to recreate 10-20+ trigger actions every time I want to add something "extra" to an existing ability like Chain Lightning. How do I go about adding triggers to things without "replacing" the original ability I'm setting up that it's referencing. I just want to "add" on.. and not reinvent all of this through the trigger editor.

3. I created a custom water elemental unit, and successfully changed the tint color, under the art options, but the particle emitters which I was hoping was being added outside the model by the game, didn't change color, and I can't seem to find those attributes anywhere. Am I correct in assuming this is attached to the model file, which means I need to dive into exporting/importing custom models?

I'm mostly checking to see if someone knows if the model itself is just referencing a generic water effect already in the editor somewhere, that I could change separately.

4. Is there a page somewhere I can reference to see like a consolidated list of walking through each of these triggers and explaining how of each these work?

Thanks!
 
Level 9
Joined
Jul 30, 2018
Messages
445
1. I'm not sure what you mean by UI menu system, but doing custom scripts is just fine. The GUI (making triggers normally with the Trigger Editor) still uses just the same code as you would write yourself, it is just turned for to be used more user-friendly. You can see this by just converting any GUI trigger to Custom Text: select a trigger, then Edit -> Convert to Custom Text.

2. Umm.. What kind of "extras" are you talking about?

3. By particle emitters you mean the model of the attack projectile? You can change that in the unit's attack options on the Object Editor. If you want to change color of that, and there is not a different color version of that by default, then yes, you will have to export, edit and reimport the model itself. What comes to the unit model's animation, you will probably to edit the model itself as well.

4. You mean a list explaining every single trigger action? I don't think so. But to be fair, most of them are quite self-explanatory and on the more complicated ones there's usually the gray text explaining a bit what the idea is. Rest, I think, can be discovered simply through testing them out.
 
Level 2
Joined
Jan 25, 2020
Messages
12
Hey thanks for the response!

1. Yeah I meant the trigger editor, and I better understand how this works now.. I did NOT know about the convert to custom text. That will be helpful down the road thank you!

2. Quick example on this one, I'm trying to add a stun effect to my custom chain lightning ability, but not just that, also have the hero teleport to the location of the target unit being damaged when this ability is cast (and ultimately have the hero jump to each unit, but I can deal with the logistics of that later, I just want to get a basic stun attached to the spell for now)

I figured this was a more difficult one to start with.. I'm basically just trying to understand how best to stack multiple ability effects to work together, without completely rebuilding each of these abilities from scratch in the trigger editor. I imagine this would be a very long trigger to setup, potentially... and I'm trying to find the path of least resistance by being efficient as possible and utilize what's already defined by the game. ie reference stormbolt for it's predefined debuffs and such rather than try to write this all out again for no reason, if I'm not changing the default ability (although I technically am, I would be removing the missile effect of the ability I guess, and the damage attached.. and just keeping the stun portion).

ie chain lightning spell ability already exists in the game.. I want that as my foundation. Stormbolt stun ability already exists, I assume I create a dummy stormbolt ability and add that somehow to my dummy chain lightning trigger via some reference or add action. Similarly I want to setup a modified version of the blink ability where the only thing that's different is the unit is blinking to the target unit instead of user defined location, which I would also reference from my chain lightning trigger?

I understand there are multiple approaches to doing these kinds of things.. which would all technically work in the end, but I see examples of people with triggers 5 pages long.. doing a simple thing, while other people are achieving the same goal by just referencing existing abilities and basically finding shorter paths to these goals. I'm trying to understand the right way to do these things without bogging down system resources, running into memory leak issues, and more importantly, not reinvent what already exists in the game by creating unnecessary excess requests for things.

3. By particle emitters I mean specifically the water elemental model, has like water effects surrounding it. Changing the tint of this model changes the model itself, but not the water effects applied on top of the model. I was just curious if there was a way to modify this without going down the path of doing custom models and all that.

4. I already found some good tutorials explaining a lot of this. Disregard this one.

Thanks for the help!
 
Level 9
Joined
Jul 30, 2018
Messages
445
Well, yeah, about those spells, you will need a lot of triggering for such ability. The stun is easily applied to the first target by using a dummy unit, as you thought, but the problem lies with Chain Lightning and how it chooses the next targets: basically there is no way to reliably detect to which units the lightning jumps to. Thus, you are better off triggering the whole ability yourself. And you don't need to incorporate Blink to it, as you can simply just move the unit instantly with triggers.

But in general, yeah, a lot of the WC3 abilities are very restricted and there are a lot of hard-coded stuff you can't get past, like the buffs and stuff they make. That being said, though, I don't think the spell you are trying to make would be that complicated, once one gets the hang of how things work in WC3. Still, not anything beginner-level stuff.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,496
Not too sure what you mean by #2. Your trigger replaced the existing ability? As in the ability didn't go off but the trigger did? That sounds like your trigger interrupted the casting unit. This can happen if you use "Move Unit Instantly" on the caster as this interrupts the unit's orders (It issues a "Stop" command). You have to use an alternate method to moving the unit (SetUnitX/Y) or add a small delay (Wait 0.00 seconds).

Anyway, a simple way to create the Chain Lightning/Stun spell:
1) Create a base ability based on Channel (Spells - Channel) this is going to have the spell's icon/description but won't actually do anything outside of tooltip/cooldown/manacost.

2) Create a unit ability based on Chain Lightning. The Dummy is going to cast this, not the Hero.

3) Create a unit ability based on Storm Bolt. The Dummy is going to cast this, not the Hero.

Note: Make sure the Dummy abilities have no cooldown/mana cost and have 99999 cast range. Also, make sure their Targets Allowed are setup properly.

4) Create your trigger.

Event: A unit starts the effect of an ability.

Condition: Ability being cast equal to Your Channel Ability.

Actions: Create a Dummy unit for triggering player -> Add Chain Lightning to last created unit. Add Storm bolt to last created unit. -> Order last created unit to cast Orc - Chain Lightning on Target unit of ability being cast.

5) From that point on it gets a bit more advanced. You would want to then detect whenever the Chain Lightning deals damage and have your Dummy cast Storm Bolt on the damaged units. You would also want to move the Caster to the damaged unit as well.
Edit: I uploaded an example map.
 

Attachments

  • Chain Lightning Example.w3x
    48.3 KB · Views: 28
Last edited:
Status
Not open for further replies.
Top