So this has a little bit of a data element to it, but not much, is mostly all triggers and me showcasing my talent to use them poorly. Before I show what I've been attempting to use, will explain what I'm wanting to do.
I want a unit to attack with a dummy effect, which gets spotted by a trigger, which in turn sets a custom damage effect to 10 damage, and applies that damage to the target. Really complicated way of making a guy do 10 damage I know, but the idea is to be able to give his target dodge/block/riposte chance and that sort of good thing in the future to decide the outcome of that attack.
Took a raynor marine, gave his weapon an Effect: Apply Behavior which does absolutely nothing, is just a dummy effect for the trigger editor to spot. My favorite dummies are Larry, Curly, and Moe, so we will just call this effect Larry. From there I have what is detailed in the picture below: (Curly is my damage effect, and no don't use Moe...)
I have tried to use some older forum posts to tackle this to no avail, linked below
You need a dummy damage effect and use the Catalog Field Set function. Here's an example from my map where I want to reflect damage back at the attacker. ReflectiveArmor is the dummy damage effect and the variable Reflective is how many levels of that ability the hero has.
It's exactly the same path used to reference data fields in text objects (via the <d> tag.) The best way to find out a path is to extract the raw XML files because sometimes the field names don't match whats in the editor. As a rule of thumb it's <Type>,<Identifier>,<Field>. Fields in structs are separated with a period and values in arrays are in square brackets. For example:
Behavior,MyBehavior,DamageResponse.Chance
Effect,MyDamageEffect,AttributeBonus[Armored]
When using the set catalog field of course you don't need to include the first part (the type) as that's a separate parameter.
I'm sure it is something simple I'm doing wrong, just can't seem to figure it out....
Since patch 1.2? there is a trigger function called UnitDamage to cause damage to a target unit, you don't need the catalog stuff. You can specify an amount and a damage effect. The effect sets all the other settings, however the damage amount of the effect will either be ignored, or the trigger amount will be added, not sure.
Also, I usually use an empty set effect instead of an apply behavior; just because :D
Found the UnitDamage function you were talking about, tried it with Curly and Larry, I changed Larry to be a set effect just to be certain, still nothing. It isn't giving me the error now at least, but it isn't doing anything to the unit I am shooting.
To be a little more exact:
Deal damage using Curly on (Damaging unit) from (Triggering Unit) with 12.0 extra damage.
Ah, duh, my bad on that. Assumed attacking/damaging since the effect is coming from a weapon. Got that working now at least, apparently my case statement is broken though, had to move it out of there for it to work. Any thoughts on what I goofed on that? Is the same as in the picture above.
Thanks a ton for the help so far!
Edit: Nevermind, it is the same issue, I was doing the attacking unit again instead of the source... /facepalm, this should really free me up to design the combat system how I want it now however, thanks!
So this has a little bit of a data element to it, but not much, is mostly all triggers and me showcasing my talent to use them poorly. Before I show what I've been attempting to use, will explain what I'm wanting to do.
I want a unit to attack with a dummy effect, which gets spotted by a trigger, which in turn sets a custom damage effect to 10 damage, and applies that damage to the target. Really complicated way of making a guy do 10 damage I know, but the idea is to be able to give his target dodge/block/riposte chance and that sort of good thing in the future to decide the outcome of that attack.
Took a raynor marine, gave his weapon an Effect: Apply Behavior which does absolutely nothing, is just a dummy effect for the trigger editor to spot. My favorite dummies are Larry, Curly, and Moe, so we will just call this effect Larry. From there I have what is detailed in the picture below: (Curly is my damage effect, and no don't use Moe...)
I have tried to use some older forum posts to tackle this to no avail, linked below
I'm sure it is something simple I'm doing wrong, just can't seem to figure it out....
Since patch 1.2? there is a trigger function called UnitDamage to cause damage to a target unit, you don't need the catalog stuff. You can specify an amount and a damage effect. The effect sets all the other settings, however the damage amount of the effect will either be ignored, or the trigger amount will be added, not sure.
Also, I usually use an empty set effect instead of an apply behavior; just because :D
@Kueken531: Go
Found the UnitDamage function you were talking about, tried it with Curly and Larry, I changed Larry to be a set effect just to be certain, still nothing. It isn't giving me the error now at least, but it isn't doing anything to the unit I am shooting.
To be a little more exact:
Deal damage using Curly on (Damaging unit) from (Triggering Unit) with 12.0 extra damage.
You are reacting to a Unit executes effect event, not a Unit takes damage one. You need to use Effect Unit -> Source or Target
@Kueken531: Go
Ah, duh, my bad on that. Assumed attacking/damaging since the effect is coming from a weapon. Got that working now at least, apparently my case statement is broken though, had to move it out of there for it to work. Any thoughts on what I goofed on that? Is the same as in the picture above.
Thanks a ton for the help so far!
Edit: Nevermind, it is the same issue, I was doing the attacking unit again instead of the source... /facepalm, this should really free me up to design the combat system how I want it now however, thanks!