Hey,
Is there a possibility to check if a unit is detected?
I wanted to increase the actor's opacity if detected, however the "Unit Detected" validator doesn't seem to work.
When I gave the unit a dummy-behavior with "Validator (Disable): Unit detected" and added an "behavior.off"-event to the actor, nothing happened.
But if I use "Validator (Remove): Unit detected" with an "behavior.destroy"-event in the actor it kinda works, even though my own unit also becomes opaque regardless if there is an enemy detector nearby. Also I don't know how to apply the behavior again afterwards, since it would've get destroyed.
I'm still new to map making so take my observation with a grain of salt. I checked the "Is Detected" Validator and it seems to check The "Target" by default in the "Validator: Unit-" field. Have you tried changing "Validator: Unit-" from Target to "Caster"? I think caster is the unit which has the behavior.
My guess is that the Validator is checking if YOUR cloaked unit can detect units around it (Not the other way around) (And if they are not cloaked / burrowed, odds are he can).
If it still doesn't work, you could try also changing "Validator: Other Unit-" to different values (It seems like this field is for knowing which other unit is the one that has to be detecting your "Caster" unit.
I'm trying to change all the different values of this validator around, I just can't get it to work... If it really is for checking if my unit can detect other units, then it's labelled wrong. Haven't tried the Other Unit value yet, seems kinda illogical because there is no reference unit, but I'll give it a try. Thanks for your efforts.
That also doesn't work, unfortunately.
The only solution I've found is checking the area around the unit for any detectors, but that is suboptimal as it is inaccurate (the detector range doesn't matter) and performance-hitting I suppose. Seems like a pretty ugly workaround for me
so please tell me how exactly this should work. a unit is cloaked and as soon as a detector detects the unit the unit shall gain/loose some opacity?
where exactly is a buff involved here? if it is a dummy buff it won't activate again after it was deactivated. i would try the unit flag visible as validator or try the actor event UnitDetectedByViewer or ModelEvent.CloakOn. i am quite sure one of these things will w ork for you
Yes, the unit is cloaked and shall gain some opacity as soon as an enemy detector detects the unit. I used a buff because I didn't know how else I could accomplish this, your suggestions also don't seem to work for me, maybe I'm doing something wrong.
UnitDetectedByViewer makes the unit full opacity as soon as I see it on my screen, ModelEvent.CloakOn/Off don't do anything and the flag "visible" is always true for myself, I don't know how exactly I should compare this from other players.
I think I may just let it be, could also be better from a gameplay perspective.
Though I'm still curious how this should be done..
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey, Is there a possibility to check if a unit is detected?
I wanted to increase the actor's opacity if detected, however the "Unit Detected" validator doesn't seem to work. When I gave the unit a dummy-behavior with "Validator (Disable): Unit detected" and added an "behavior.off"-event to the actor, nothing happened.
But if I use "Validator (Remove): Unit detected" with an "behavior.destroy"-event in the actor it kinda works, even though my own unit also becomes opaque regardless if there is an enemy detector nearby. Also I don't know how to apply the behavior again afterwards, since it would've get destroyed.
Is there some semi-easy solution to this?
I'm still new to map making so take my observation with a grain of salt. I checked the "Is Detected" Validator and it seems to check The "Target" by default in the "Validator: Unit-" field. Have you tried changing "Validator: Unit-" from Target to "Caster"? I think caster is the unit which has the behavior.
My guess is that the Validator is checking if YOUR cloaked unit can detect units around it (Not the other way around) (And if they are not cloaked / burrowed, odds are he can).
If it still doesn't work, you could try also changing "Validator: Other Unit-" to different values (It seems like this field is for knowing which other unit is the one that has to be detecting your "Caster" unit.
I'm trying to change all the different values of this validator around, I just can't get it to work... If it really is for checking if my unit can detect other units, then it's labelled wrong. Haven't tried the Other Unit value yet, seems kinda illogical because there is no reference unit, but I'll give it a try. Thanks for your efforts.
Try the hidden flag?
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
That also doesn't work, unfortunately. The only solution I've found is checking the area around the unit for any detectors, but that is suboptimal as it is inaccurate (the detector range doesn't matter) and performance-hitting I suppose. Seems like a pretty ugly workaround for me
@DrSuperEvil: Go
hidden is for items. if a item is beared by a unit it is hidden. it's not for detectors (at least that was my xp)
@LordJaraxx: Go
so please tell me how exactly this should work. a unit is cloaked and as soon as a detector detects the unit the unit shall gain/loose some opacity? where exactly is a buff involved here? if it is a dummy buff it won't activate again after it was deactivated.
i would try the unit flag visible as validator or try the actor event UnitDetectedByViewer or ModelEvent.CloakOn. i am quite sure one of these things will w ork for you
@FunkyUserName: Go
Yes, the unit is cloaked and shall gain some opacity as soon as an enemy detector detects the unit. I used a buff because I didn't know how else I could accomplish this, your suggestions also don't seem to work for me, maybe I'm doing something wrong.
UnitDetectedByViewer makes the unit full opacity as soon as I see it on my screen, ModelEvent.CloakOn/Off don't do anything and the flag "visible" is always true for myself, I don't know how exactly I should compare this from other players.
I think I may just let it be, could also be better from a gameplay perspective. Though I'm still curious how this should be done..