A few of the units in my map have the ability to avoid attacks. This is done via a behavior with a damage response, with the chance being set to the appropriate chance of evasion, modify fraction 0, and modify minimum damage enabled. This part is, as far as I can tell, working fine. My troubles began when I tried to create a visual indicator for this ability. I want to have the word "Evade!" appear over the unit's head if the damage response is handled.
My first attempt was based on the pickup text I'm already using in my map. It involves two actors, a text actor, and a model actor (invisible model). My attempt didn't work out very well; all the messages appeared at the point where the unit was initially placed, without regard to the current position of the unit. I did a search and found:
I followed DrSuperEvil's suggestion and copied the Automated Refinery's text message instead. The results were kind of weird. While the person who posted the thread above could not get the messages to appear anywhere but over the hero's head (he wanted the message on the attacker), I couldn't get the messages to appear anywhere but over the attacker's head. I tried changing the dummy effect to a generic effect (I previously had it as an Apply Behavior with no behavior being applied). This caused the messages to disappear completely. For some reason, I couldn't actually choose a generic effect under the actor events or on the behavior damage response handled field - I had to change it within the XML. Even after the changes were made, it did not work.
Finally I gave up trying to use a generic effect, and I'm now using a Modify Unit effect (with no modifications, I wanted the launch unit / impact unit fields which don't seem to be available on an Apply Behavior effect). Well, now my evasion message is being created at the unit's initial point, once again disregarding the unit's position.
Anyone know how I can fix this?
EDIT: I went back to using an Apply Behavior effect and it's once against creating the text actor at the unit attacking the evading unit. I checked and all the evasion related behaviors have Combat: Location set to the Defender. I think I just need to pick the right type of dummy effect then? For some reason I can't get generic effects to work...
EDIT2: Okay... I don't even know what's up with this now. I walk my unit into a huge blob of marines, and for some reason the evade message only pops up over one specific marine, over and over. I kill that marine, and it starts appearing over a different marine instead. I run away from them. Then I order a Zergling to attack my evading unit... no messages at all. At this point I move my hero back to the marines, and no message shows up anywhere.
Check if the actor has a cap. Also you can use SOp (Local Offset) to move it. If you are creating text on the attachment it is difficult to localize. Check my autoharvester out in the community project to see what I did with text actors.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Check if the actor has a cap. Also you can use SOp (Local Offset) to move it. If you are creating text on the attachment it is difficult to localize. Check my autoharvester out in the community project to see what I did with text actors.
As far as I can tell, there's no cap. Where would such a cap be defined?
The problem isn't the location of the text actor, the problem is that the text actor is being attached to the wrong unit. I guess the real problem is with the dummy effect and the damage response behavior. Is there any good example map showing a damage response behavior with an appropriate dummy effect to create a text actor attached to the responding unit?
Under Event - Terms or under Events+. Try removing the SOp (Attachment) because that messes up the hosting of text actors.
If you want the text to appear on the attacker you must use the Hosting - Host - Effect field and set the scope to Scope Target and Hosting - Host - Actor to Actor Find
I'm trying to get the message to play on the defender (the responding unit), not the attacker. I changed the scope and host actor, but for some reason it's still playing it in a strange spot. Here's a couple screenshots showing what I made and the problem. The evasion text is appearing where the unit initially spawn (the unit is using Zeratul's model, and being attacked by a Zergling, triggering the damage response).
And this offset is not relative to the unit's current location?
Also when using those fields you need to specify a specific effect to be used as a frame of reference so under Hosting - Host - Effect put in your damage response effect.
And this offset is not relative to the unit's current location?
Also when using those fields you need to specify a specific effect to be used as a frame of reference so under Hosting - Host - Effect put in your damage response effect.
looks like the actor isnt being attached properly to the unit you want it on....
i dont know much about text actors.... but dont you want it to be create when the unit actually dodges and not when the unit is created?
The actor is being created when the effect is played. It's under the events, which you can't really see on the standard setup. My bad, I should've included a screenshot of the events too.
Maybe I spoke too soon. I got everything working for a moment. Then I ran another test. I forgot that the evasion ability is a shared aura. Since I set scope to caster, no matter who was being attacked, if the evasion kicked in the effect would happen upon the owner of the aura (the caster). To get around this, I changed the scope to source instead of caster, and the target of the effect to source as well.
At first it seems to work properly. Whichever unit evades is the one the text appears on. However, to test it further I sent both units into a mass of marines. For some reason, after the evasion effect is handled enough times in quick succession, the actor glitches and always displays the text on one of the two units. I pulled the unit upon which all the messages appeared on back, and sent the other one back in to get attacked - the messages still appear on the unit that's not even being attacked anymore.
I played around with the effect settings, it doesn't seem to matter if I set the effect's target to source or target, either way it works (possibly because the behavior damage response location is set to defender, so the target/source are one of the same). I'm not sure what's going on anymore though.
Further testing is really boggling my mind.
1) A test attacker attacks the aura source. The message appears on the aura source (intended).
2) The same test attacker now attacks unit 2, who is benefiting from the aura. Message appears on unit 2 (intended).
3) The same test attacker now attacks the aura source again. The message appears on unit 2 (this is the problem).
4) The same test attacker now attacks unit 3, who is also benefiting from the aura. Message appears on unit 3 (intended).
5) The same test attacker now attacks the aura source, or unit 2. Either way, the message appears on unit 3...
It goes on like this too. Every time I attack a different unit, the evasion message appears correctly on the unit being attacked, but when I attack previous units, the messages continue to appear on the the last "new" target.
I don't have much experience with text actors, though I can't believe they would really be that different from any actor...
If your behavior's damage response calls a handled effect of a type like "Modify Unit", and you then catch that effect in your events to create your text actor, specifying "At Source", can the actor really appear anywhere else than on the source unit?
Or is there something magically different about text actors?
I don't have much experience with text actors, though I can't believe they would really be that different from any actor...
If your behavior's damage response calls a handled effect of a type like "Modify Unit", and you then catch that effect in your events to create your text actor, specifying "At Source", can the actor really appear anywhere else than on the source unit?
Or is there something magically different about text actors?
I'm not entirely sure. This is my first time using text actors besides for pickups... for some reason, when I tried a Modify Unit effect (with no actual effect, just as a dummy for the actor) the text stopped appearing entirely. Generic has the same problem.
As a temporary fix I changed it to target (which seems to work properly) and changed the display message to "Miss!" It seems kind of ridiculous though... when googling the problem it took me to a page here on SC2Mapster where someone was asking for help with the opposite problem. He couldn't get the message to appear anywhere except the source unit, and finally settled for changing his "Miss!" message to "Evade!"
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
A few of the units in my map have the ability to avoid attacks. This is done via a behavior with a damage response, with the chance being set to the appropriate chance of evasion, modify fraction 0, and modify minimum damage enabled. This part is, as far as I can tell, working fine. My troubles began when I tried to create a visual indicator for this ability. I want to have the word "Evade!" appear over the unit's head if the damage response is handled.
My first attempt was based on the pickup text I'm already using in my map. It involves two actors, a text actor, and a model actor (invisible model). My attempt didn't work out very well; all the messages appeared at the point where the unit was initially placed, without regard to the current position of the unit. I did a search and found:
http://www.sc2mapster.com/forums/development/data/21785-miss-text-for-evasion-ability/
I followed DrSuperEvil's suggestion and copied the Automated Refinery's text message instead. The results were kind of weird. While the person who posted the thread above could not get the messages to appear anywhere but over the hero's head (he wanted the message on the attacker), I couldn't get the messages to appear anywhere but over the attacker's head. I tried changing the dummy effect to a generic effect (I previously had it as an Apply Behavior with no behavior being applied). This caused the messages to disappear completely. For some reason, I couldn't actually choose a generic effect under the actor events or on the behavior damage response handled field - I had to change it within the XML. Even after the changes were made, it did not work.
Finally I gave up trying to use a generic effect, and I'm now using a Modify Unit effect (with no modifications, I wanted the launch unit / impact unit fields which don't seem to be available on an Apply Behavior effect). Well, now my evasion message is being created at the unit's initial point, once again disregarding the unit's position.
Anyone know how I can fix this?
EDIT: I went back to using an Apply Behavior effect and it's once against creating the text actor at the unit attacking the evading unit. I checked and all the evasion related behaviors have Combat: Location set to the Defender. I think I just need to pick the right type of dummy effect then? For some reason I can't get generic effects to work...
EDIT2: Okay... I don't even know what's up with this now. I walk my unit into a huge blob of marines, and for some reason the evade message only pops up over one specific marine, over and over. I kill that marine, and it starts appearing over a different marine instead. I run away from them. Then I order a Zergling to attack my evading unit... no messages at all. At this point I move my hero back to the marines, and no message shows up anywhere.
Check if the actor has a cap. Also you can use SOp (Local Offset) to move it. If you are creating text on the attachment it is difficult to localize. Check my autoharvester out in the community project to see what I did with text actors.
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
As far as I can tell, there's no cap. Where would such a cap be defined?
The problem isn't the location of the text actor, the problem is that the text actor is being attached to the wrong unit. I guess the real problem is with the dummy effect and the damage response behavior. Is there any good example map showing a damage response behavior with an appropriate dummy effect to create a text actor attached to the responding unit?
Under Event - Terms or under Events+. Try removing the SOp (Attachment) because that messes up the hosting of text actors.
If you want the text to appear on the attacker you must use the Hosting - Host - Effect field and set the scope to Scope Target and Hosting - Host - Actor to Actor Find
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
@DrSuperEvil: Go
I'm trying to get the message to play on the defender (the responding unit), not the attacker. I changed the scope and host actor, but for some reason it's still playing it in a strange spot. Here's a couple screenshots showing what I made and the problem. The evasion text is appearing where the unit initially spawn (the unit is using Zeratul's model, and being attacked by a Zergling, triggering the damage response).
And this offset is not relative to the unit's current location?
Also when using those fields you need to specify a specific effect to be used as a frame of reference so under Hosting - Host - Effect put in your damage response effect.
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
@Soma2035: Go
looks like the actor isnt being attached properly to the unit you want it on....
i dont know much about text actors.... but dont you want it to be create when the unit actually dodges and not when the unit is created?
Thank you! That fixed it.
The actor is being created when the effect is played. It's under the events, which you can't really see on the standard setup. My bad, I should've included a screenshot of the events too.
@Soma2035: Go
Maybe I spoke too soon. I got everything working for a moment. Then I ran another test. I forgot that the evasion ability is a shared aura. Since I set scope to caster, no matter who was being attacked, if the evasion kicked in the effect would happen upon the owner of the aura (the caster). To get around this, I changed the scope to source instead of caster, and the target of the effect to source as well.
At first it seems to work properly. Whichever unit evades is the one the text appears on. However, to test it further I sent both units into a mass of marines. For some reason, after the evasion effect is handled enough times in quick succession, the actor glitches and always displays the text on one of the two units. I pulled the unit upon which all the messages appeared on back, and sent the other one back in to get attacked - the messages still appear on the unit that's not even being attacked anymore.
I played around with the effect settings, it doesn't seem to matter if I set the effect's target to source or target, either way it works (possibly because the behavior damage response location is set to defender, so the target/source are one of the same). I'm not sure what's going on anymore though.
Further testing is really boggling my mind.
1) A test attacker attacks the aura source. The message appears on the aura source (intended).
2) The same test attacker now attacks unit 2, who is benefiting from the aura. Message appears on unit 2 (intended).
3) The same test attacker now attacks the aura source again. The message appears on unit 2 (this is the problem).
4) The same test attacker now attacks unit 3, who is also benefiting from the aura. Message appears on unit 3 (intended).
5) The same test attacker now attacks the aura source, or unit 2. Either way, the message appears on unit 3...
It goes on like this too. Every time I attack a different unit, the evasion message appears correctly on the unit being attacked, but when I attack previous units, the messages continue to appear on the the last "new" target.
How long are you leaving between the different attacks.
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
In my last test, several seconds. Long enough for the message to disappear and then some.
I don't have much experience with text actors, though I can't believe they would really be that different from any actor...
If your behavior's damage response calls a handled effect of a type like "Modify Unit", and you then catch that effect in your events to create your text actor, specifying "At Source", can the actor really appear anywhere else than on the source unit?
Or is there something magically different about text actors?
I'm not entirely sure. This is my first time using text actors besides for pickups... for some reason, when I tried a Modify Unit effect (with no actual effect, just as a dummy for the actor) the text stopped appearing entirely. Generic has the same problem.
As a temporary fix I changed it to target (which seems to work properly) and changed the display message to "Miss!" It seems kind of ridiculous though... when googling the problem it took me to a page here on SC2Mapster where someone was asking for help with the opposite problem. He couldn't get the message to appear anywhere except the source unit, and finally settled for changing his "Miss!" message to "Evade!"