Okay, implementing scrolling combat text is simple enough. Create a Unit is Damaged trigger and then make a text tag over the unit with the Triggering Damage Amount.
Until you start playing with Damage Response behaviors that modify the damage amount, and then you realize that the trigger is fired before any damage responses occur, so things like critical strikes don't register correctly.
I've considered using a Unit HP Changes trigger, and my workaround is to use a unit custom value to store the old HP of each unit, and whenever it changes if the difference is greater than a threshold (typically 1.0) I create the text tag. There are some problems with this approach though, specifically that I really want to be able to know the player and unit that caused the change.
So has anyone implemented a robust combat text tag system that works properly with damage response behaviors?
Haven't made one but if your map doesn't have .. like... total attack spammage you could go like that:
Have the custom value save the old HP
make a Unit is Damaged trigger:
Actions:
(get all the stats)
- Set player = Owner of damaging unit
- Set unit = Damaging unit
- Set amount = amount of damage
- Wait 0.01 second of game time
- Make a text tab with the text of UnitValue - amount
That is not too bright if there's a high possibility of getting hit several times in an extremely short time span, obviously.
Until you start playing with Damage Response behaviors that modify the damage amount, and then you realize that the trigger is fired before any damage responses occur, so things like critical strikes don't register correctly.
I did not, I mean do not "realise" this.
Well let's see when the trigger actually occurs.
TEST:
Make a simple trigger.
Make 10min/40max hp unit
Unit takes damage
Condition 'damage' > 10
add 'damage' hp
RESULT: Unit is killed before receiving additional hp
CONCLUSION: unit takes damage event take place after or exact moment an unit takes damage -> i.e. not before
Fact:
Behavior Damage Response occurs before any damage hits the unit (i.e. responding to a damage occurred before it is applied to the unit)
and then you realize that the trigger is fired before any damage responses occur, so things like critical strikes don't register correctly.
So a trigger (occurs after or at the moment damage take place) fired before damage response (occurs before the damage take place)?
What we have here is a spear that can pierce through any shield, and a shield that cannot be pierced by any spear.
Only thing I "realise" is the fact, a real variable called "triggering damage amount" does not calculate the damage modified by damage response at all. I'm guessing Blizzard simply forgot about it when programing the return value "triggering damage amount".
Now that I told you know this fact everything should be easy.
simply add a permanent dummy behavior to the unit when damage handle occurs
if the unit has that behavior calculate the new triggering damage amount and remove the behavior.
I added an example map, just because I can. ^ ^
That's not very helpful. Needing to manually calculate the damage amount in a trigger is not really feasible when you have dozens and dozens of behaviors which can modify damage in various ways.
That's not very helpful. Needing to manually calculate the damage amount in a trigger is not really feasible when you have dozens and dozens of behaviors which can modify damage in various ways.
Blizzard failed to implement correct damage occurred. They need to fix that. Until then, this is a good solution.
Also I just did it quickly to show you an example. I'm not going to spoon feed you.
I'll give you a hint though "get catalog and set catalog".
Unhelpful *and* condescending. A nice combination.
Seriously? First you assume that damage trigger happens before the damage response happens, so you think it's too hard. Now that I told you how it really works, that's not helpful? I even gave you an example map, it works for one behavior, using catalog it can be used for other behaviors. You for real?
That's not very helpful. Needing to manually calculate the damage amount in a trigger is not really feasible when you have dozens and dozens of behaviors which can modify damage in various ways.
There aren't thousands fields for damage response. Ones you need to calculate are modify damage, ignore, limit fraction and clamp. You really want other people to do that for you?
Na no fighting. I just don't like people who don't want to answer 1 + 1 + 1 after they are taught what 1 + 1 is. Nothing personal.
Honestly you were acting like a douche from the very first post you made on this thread. You may *think* you are god's gift to galaxy edit but really you are not. Learn some humility.
Okay, implementing scrolling combat text is simple enough. Create a Unit is Damaged trigger and then make a text tag over the unit with the Triggering Damage Amount.
Until you start playing with Damage Response behaviors that modify the damage amount, and then you realize that the trigger is fired before any damage responses occur, so things like critical strikes don't register correctly.
I've considered using a Unit HP Changes trigger, and my workaround is to use a unit custom value to store the old HP of each unit, and whenever it changes if the difference is greater than a threshold (typically 1.0) I create the text tag. There are some problems with this approach though, specifically that I really want to be able to know the player and unit that caused the change.
So has anyone implemented a robust combat text tag system that works properly with damage response behaviors?
@RileyStarcraft: Go
Haven't made one but if your map doesn't have .. like... total attack spammage you could go like that:
Have the custom value save the old HP
make a Unit is Damaged trigger:
Actions:
(get all the stats)
- Set player = Owner of damaging unit
- Set unit = Damaging unit
- Set amount = amount of damage
- Wait 0.01 second of game time
- Make a text tab with the text of UnitValue - amount
That is not too bright if there's a high possibility of getting hit several times in an extremely short time span, obviously.
I did not, I mean do not "realise" this.
Well let's see when the trigger actually occurs.
TEST:
Make a simple trigger.
Make 10min/40max hp unit
Unit takes damage
Condition 'damage' > 10
add 'damage' hp
RESULT: Unit is killed before receiving additional hp
CONCLUSION: unit takes damage event take place after or exact moment an unit takes damage -> i.e. not before
Fact:
Behavior Damage Response occurs before any damage hits the unit (i.e. responding to a damage occurred before it is applied to the unit)
So a trigger (occurs after or at the moment damage take place) fired before damage response (occurs before the damage take place)?
What we have here is a spear that can pierce through any shield, and a shield that cannot be pierced by any spear.
Only thing I "realise" is the fact, a real variable called "triggering damage amount" does not calculate the damage modified by damage response at all. I'm guessing Blizzard simply forgot about it when programing the return value "triggering damage amount".
Now that I told you know this fact everything should be easy.
simply add a permanent dummy behavior to the unit when damage handle occurs
if the unit has that behavior calculate the new triggering damage amount and remove the behavior.
I added an example map, just because I can. ^ ^
@zifoon: Go
That's not very helpful. Needing to manually calculate the damage amount in a trigger is not really feasible when you have dozens and dozens of behaviors which can modify damage in various ways.
Blizzard failed to implement correct damage occurred. They need to fix that. Until then, this is a good solution.
Also I just did it quickly to show you an example. I'm not going to spoon feed you.
I'll give you a hint though "get catalog and set catalog".
Unhelpful *and* condescending. A nice combination.
Seriously? First you assume that damage trigger happens before the damage response happens, so you think it's too hard. Now that I told you how it really works, that's not helpful? I even gave you an example map, it works for one behavior, using catalog it can be used for other behaviors. You for real?
There aren't thousands fields for damage response. Ones you need to calculate are modify damage, ignore, limit fraction and clamp. You really want other people to do that for you?
starts chanting, "fight, fight, FIGHT!!!"
and motions for all the others to gather round!
Na no fighting. I just don't like people who don't want to answer 1 + 1 + 1 after they are taught what 1 + 1 is. Nothing personal.
Honestly you were acting like a douche from the very first post you made on this thread. You may *think* you are god's gift to galaxy edit but really you are not. Learn some humility.
Look whose talking mr 477 days later about a guy who last logged in over a month ago.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg