Hello all. I'm sorta stuck with a certain behaviour I want to create right now.
Heres my situation: I have a toggleable ability with the oracle which applies a behaviour onto the oracle. This behaviour drains energy and cloaks the oracle, while applying a search behaviour every period. This search behaviour searches for ground units at the oracle's feet which applies an apply behaviour effect which applies another cloak behaviour. (Very similar to the Arbiter's cloak field)
Now heres my problem: I want to make it so that, every time a unit cloaked by the oracle attacks, it loses the ability to cloak for a brief duration. So what I'm thinking of doing is, in the applied cloak behaviour, every time a unit uses it's weapon, an apply behaviour effect is applied which applies a behaviour which surpresses that unit's ability to cloak for a short while (or at least, not be influenced by the oracle's cloaking ability so that it doesn't remove cloak from a dark templar, but I really wouldn't care if this sort of oversight happened).
The problem I'm having is, I'm not sure how to detect and apply the uncloak behaviour. There is a death reaction effect under the modifier thingy, but nothing for detecting if the unit is using it's weapon attacking. How would I go about this?
I'm also wanting to make a unit which decloaks to fire then recloaks after a bit (the unit is permanently cloaked), but this is an easier problem, since I can link the uncloak behaviour to that unit's weapon directly. I'm just not sure how to do the decloak on attack in a more general case.
I think the mutalisk campaign upgrade that gives it increased health regen checks for if the unit is in battle. I believe it does this by seeing if the unit is either attacking or being attacked. Perhaps you could take a look at it.
It uses a validator to remove the behaviour for a short time I would assume. I want to try out using effect - final or effect - expire, but the problem with these is that the behaviour is constantly being applied and constantly expiring, so if I wanted the behaviour to be cancelled by an attack and have an effect final trigger to apply the decloak, it would actually apply every time the cloak behaviour runs out (which is once every 0.5417 seconds for me).
I want to try out using effect - final or effect - expire, but the problem with these is that the behaviour is constantly being applied and constantly expiring, so if I wanted the behaviour to be cancelled by an attack and have an effect final trigger to apply the decloak, it would actually apply every time the cloak behaviour runs out (which is once every 0.5417 seconds for me).
The premise of my suggestion is that since the cloak behavior has to be constantly reapplied to the units around the Oracle, adding a validator to the behavior (or the effect which applies it) will make it so that the behavior is not applied to the unit in the first place, hence "decloaking" it in effect, without having to apply a separate behavior which suppresses cloaking.
The problem I'm having is, I'm not sure how to detect and apply the uncloak behavior. There is a death reaction effect under the modifier thingy, but nothing for detecting if the unit is using it's weapon attacking. How would I go about this?
In the behavior that cloaks unit go to "Damage Response" field, set "Chance" to "1", set "Location" to "Attacker", set "Handled" to effect which will apply another temporary behavior with "suppress cloak" flag.
This way every time unit deals any damage (weapon and spells alike) it's cloaking behavior will apply a suppress cloak. You can use "Exclude Effect Array" to add some exceptions (if there are some abilities you don't want to trigger decloak), or use "Require Effect Array" to make effect trigger only when damage is made via specific effects.
Great suggestion, this is getting me on the right track, but I'm still having a problem.
From what I understand, what youre suggesting is when every time someone in the cloaking field attacks, they have their cloak removed, which is what I want. The problem I'm having is that this only seems to work if instead of Attacker I have Defender, and both units are in the cloaking field (or rather, have the cloaking field behaviour). This makes sense given the field's name being Damage response.
Oh right, I should have specified further. In the setup I described -> set target for apply behavior to "source" (in the effect which applies the decloak behavior). If you had left it on its default "target" then it wold have probably applied decloaking to the unit that you were attacking and not on the attacker. (I'm not too sure about it, but it's always best to specify "source" when you want behavior to be applied to the unit which hosts the applier behavior);
But this is how I think it works, just in case I'll test it too.
Edit: Yup, setting target to source makes it work as you wanted.
Hello all. I'm sorta stuck with a certain behaviour I want to create right now.
Heres my situation: I have a toggleable ability with the oracle which applies a behaviour onto the oracle. This behaviour drains energy and cloaks the oracle, while applying a search behaviour every period. This search behaviour searches for ground units at the oracle's feet which applies an apply behaviour effect which applies another cloak behaviour. (Very similar to the Arbiter's cloak field)
Now heres my problem: I want to make it so that, every time a unit cloaked by the oracle attacks, it loses the ability to cloak for a brief duration. So what I'm thinking of doing is, in the applied cloak behaviour, every time a unit uses it's weapon, an apply behaviour effect is applied which applies a behaviour which surpresses that unit's ability to cloak for a short while (or at least, not be influenced by the oracle's cloaking ability so that it doesn't remove cloak from a dark templar, but I really wouldn't care if this sort of oversight happened).
The problem I'm having is, I'm not sure how to detect and apply the uncloak behaviour. There is a death reaction effect under the modifier thingy, but nothing for detecting if the unit is using it's weapon attacking. How would I go about this?
I'm also wanting to make a unit which decloaks to fire then recloaks after a bit (the unit is permanently cloaked), but this is an easier problem, since I can link the uncloak behaviour to that unit's weapon directly. I'm just not sure how to do the decloak on attack in a more general case.
Thank you for any/all help.
I think the mutalisk campaign upgrade that gives it increased health regen checks for if the unit is in battle. I believe it does this by seeing if the unit is either attacking or being attacked. Perhaps you could take a look at it.
Buff behaviors have a "Suppress cloak" flag.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
@MaskedImposter: Go
It uses a validator to remove the behaviour for a short time I would assume. I want to try out using effect - final or effect - expire, but the problem with these is that the behaviour is constantly being applied and constantly expiring, so if I wanted the behaviour to be cancelled by an attack and have an effect final trigger to apply the decloak, it would actually apply every time the cloak behaviour runs out (which is once every 0.5417 seconds for me).
@aZergBaneling: Go
I am aware of this. I'm just not sure how to activate it when a target attacks.
Oh, I'm sorry, I misinterpreted the problem.
I still may be, but I can suggest adding a validator to the cloaking behavior itself to check if the unit is not attacking.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
@aZergBaneling: Go
That would be a great idea, but it doesn't work.
The premise of my suggestion is that since the cloak behavior has to be constantly reapplied to the units around the Oracle, adding a validator to the behavior (or the effect which applies it) will make it so that the behavior is not applied to the unit in the first place, hence "decloaking" it in effect, without having to apply a separate behavior which suppresses cloaking.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
In the behavior that cloaks unit go to "Damage Response" field, set "Chance" to "1", set "Location" to "Attacker", set "Handled" to effect which will apply another temporary behavior with "suppress cloak" flag.
This way every time unit deals any damage (weapon and spells alike) it's cloaking behavior will apply a suppress cloak. You can use "Exclude Effect Array" to add some exceptions (if there are some abilities you don't want to trigger decloak), or use "Require Effect Array" to make effect trigger only when damage is made via specific effects.
@DuckyTheDuck: Go
Great suggestion, this is getting me on the right track, but I'm still having a problem.
From what I understand, what youre suggesting is when every time someone in the cloaking field attacks, they have their cloak removed, which is what I want. The problem I'm having is that this only seems to work if instead of Attacker I have Defender, and both units are in the cloaking field (or rather, have the cloaking field behaviour). This makes sense given the field's name being Damage response.
@DilemaH: Go
Oh right, I should have specified further. In the setup I described -> set target for apply behavior to "source" (in the effect which applies the decloak behavior). If you had left it on its default "target" then it wold have probably applied decloaking to the unit that you were attacking and not on the attacker. (I'm not too sure about it, but it's always best to specify "source" when you want behavior to be applied to the unit which hosts the applier behavior);
But this is how I think it works, just in case I'll test it too.
Edit: Yup, setting target to source makes it work as you wanted.
@DuckyTheDuck: Go
Yep, its working! Thanks a bunch man :)