• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] removing cloak when in combat

Status
Not open for further replies.
Level 2
Joined
Nov 28, 2013
Messages
12
Hi, I've been wondering this for a couple of days and tried to google answers but didn't find anything...
I have this buff behaviour that keeps the hero cloaked, but if the unit deals damage or it's being dealt to, I want the buff to be removed, any idea how might I be able to accomplish this?

I've already tried to accomplish it somehow with damage response, but if I put location to defender,
I could probably find a way to make myself visible when I get hit, but I can't really test it atm.
When I put location to attacker the effect I put on 'handle' is applied to the unit I'm attacking.
Also I've tried to do this with Validators but I haven't been able to find a good Validator combination to execute it like I want it,
only one even close is 'Caster not attacking' but I turn visible a soon as I order the unit to attack.


Please note: that what I meant is that the hero is dealt with ex. AoE attack etc.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Use 2 buff behaviours.
1 for when attacking.
1 for when attacked.

Make these apply a temporary buff which disables the cloaking buff. The duration is that of the re-cloak time.

If the wrong unit is getting the cloak prevention buff then you need to change the target unit in the add behaviour effect. I forget which it is but obviously it is either going to be caster or target, one is the attacker and the other the defender.
 
Level 2
Joined
Nov 28, 2013
Messages
12
Well firstly I don't want the unit to automatically re-cloak, also I don't know how to I get the behaviour to react to when I'm attacking and then doing something to me after that.
 
Level 2
Joined
Nov 28, 2013
Messages
12
I can't find any 'Apply Behavior'.. Only things close are 'Handled' and 'Exhausted', but 'Handled' takes effect and when Location is 'Attacker' it applies the unit I attack and when it's 'Defender' it applies on me when I'm attacked, neither of them is what I want. and due the description 'Exhausted' gives me I doubt it's the one I'm looking for..
 
Level 9
Joined
Dec 21, 2006
Messages
490
ok the long version
the weapon your unit is using has a field "Effect". there should be a "damage effect" linked to it. we will need this soon.

1. you create a new "Set effect"
2. you create a new "Remove behaviour effect"
3. now you add the "damage effect" of your weapon to newly created "Set Effect"
4. then you add the newly created "remove behaviour effect" to the newly created "Set effect".
5. then add the "Set Effect" to your weapon.

-------------now everything is linked-------------
-------------but settings are wrong--------------

6. now change the "target" of the "remove behavior effect" to caster and change the buff to your cloak one.


this solution allows you to have different weapons with different behavior towards cloak.
 
Level 2
Joined
Nov 28, 2013
Messages
12
well I don't want the attack (necessarily) deal extra damage on the first hit so I left out the set effect and damage effect parts out, then I already had a 'remove effect behavior' called "Remove Cloaked", and I had set the effect for the 'handle' to the "Remove Cloaked" effect, now "Remove Cloaked" should've removed the cloak from the enemy I hit, so I just set 'target' to "Caster", but it didn't help me.. Now I'm starting to think I'm doing something wrong, any idea how could I check that?
 
Level 9
Joined
Dec 21, 2006
Messages
490
how about telling us WHAT exactly you want to achieve?
the solution above doesn't deal any extra damage, just do it as i told you and the unit will loose his cloak when attacking another unit.

to remove cloak when the unit itself is being attacked you just have to add a validator to the cloak behavior.
 
Level 2
Joined
Nov 28, 2013
Messages
12
I'm trying to create an ability that would cloak the unit but when it's attacking or attacked it will uncloak.
I'm sorry I think I missed a couple of things in your latest explanation, like 'then add the "Set Effect" to your weapon.'..
I'm sorry about this, but I still don't understand why do I need 'Set Effect' and 'Damage Effect' if I only want the unit to uncloak upon combat?

EDIT:
Sorry my bad, yes I cannot think, I forgot that the 'damage effect' is the one dealing damage in the weapon

EDIT EDIT:
Thank you so much! it works perfectly now :D
Thank you for having all this time for my project I would LOVE to have someone like you guiding on me on my SC2 projects, I still have much questions and stuff to figure out in this project;
such as how can I change UI?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
such as how can I change UI?
surprisingly easy. You use the UI editor and define new UI files which modify the properties of existing UI elements, including adding new UI elements. The key here is you want the XML to come from existing UI elements since that is what the game will create and you cannot modify their files directly. You can define new UI elements but they will have to be created from an existing element that was modified. It will automatically execute new UI files when created. Remember that you can delete fields using appropriate XML commands.
 
Level 9
Joined
Dec 21, 2006
Messages
490
surprisingly easy. You use the UI editor and define new UI files which modify the properties of existing UI elements, including adding new UI elements. The key here is you want the XML to come from existing UI elements since that is what the game will create and you cannot modify their files directly. You can define new UI elements but they will have to be created from an existing element that was modified. It will automatically execute new UI files when created. Remember that you can delete fields using appropriate XML commands.

after xml he quit reading :d

allexit i hope you will stay with your project and have enough patience with the editor, unlike all others ever been helped here.
if you like to change your UI you have to watch/read tutorials on sc2mapster to do so.

p.s. i could need some reputation or i will never catch up to Dr.SuperGood
 
Level 2
Joined
Nov 28, 2013
Messages
12
Yeah, I will definitely stay with this project, and I'm so glad there's people like you helping people like me. I still have one question;
If you've ever played League of Legends you probably know what Warwick's ultimate does, I'm trying to create a very similar ability, but the closest I can get is the unit teleports next to the enemy unit and their both stunned and the enemy unit keeps taking damage, looks redicilous and I'm still stunned even tho the enemy is dead..
So what it does I should teleport next to the targeted enemy unit and start swinging at it dealing x damage per second and keeping enemy unit stunned, if it's killed or the effect ends I can move again.
Anyways Muhahahahaaa, I wouldn't hesitate to give you reputation but I'm not sure how you do it in hiveworkshop, I haven't used this much..
 
Level 9
Joined
Dec 21, 2006
Messages
490
never played lol but i try it

target ability - set effect - A teleport, B apply behaviour
B applies a buff to caster with duration = channeltime
the buff has a validator, so moving or casting another ability will destroy it

this buff has a periodic timer and the periodic effect = search effect - apply behavior.
the search effect looks for enemies in range and applies the stun buffs to them

quite straight forward

p.s just click on the symbol next to my cake
 
Level 2
Joined
Nov 28, 2013
Messages
12
Well firsly I have to set up some kind of persistent effect to the ability so that it'll be channeled like I explained earlier, at least I thought
Then I don't have to really do the search effect part because I want this to be targeted only towards one unit as I explained earlier again
And then I have to figure out how to make the enemy unit periodically lose health (shouldn't be hard) and make my unit swing at it while the ability is channeled, like I wanted in the first place, but I can't even get animations work on abilities..
I had figured out how to teleport to the enemy etc. but that part I explained now I don't know..
 
Status
Not open for further replies.
Top