What's new
Warhaven

Don't be a lurker, register an account and join the fun! Post, rate and participate with other members on Warhaven! Registering takes only a few clicks but gives you access to an amazing community and all its benefits. We hope you enjoy your stay and most importantly have fun!

Need Help Making Trigger

Revenant

New Member
Messages
10
Reaction score
7
Hello everyone!

I'm currently in the works of making a small custom map - it's a 1v1 melee map but using my inspiration from all the mass war maps I've experienced, I wanted to add a couple of little quirks.

Unfortunately I am not ready to share the map yet, but I need help with a trigger. I have a neutral shipyard located on the map, and I want to make it so that when it "dies," it changes ownership from neutral to the player attacking it. I've been tinkering with the triggers some for a while, but my lack of experience and knowledge has left me in a bit of a rut. Can someone help me out?
 

SvnmS

Well-Known Member
Messages
1,911
Reaction score
780
Use the event :
"specific unit (your shipyard in this case) takes damage"
condition :
"current hp of triggering unit < damage taken"
actions :
"change ownership of triggering unit to owner of(damage source)"
"change hp of triggering unit to 100%"
 

Revenant

New Member
Messages
10
Reaction score
7
Tried it out and it didn't work. Well, the reset to 100% worked, but not the change. Does the shipyard need to be Neutral Hostile, or can it work for Neutral Passive?

And for clarification's sake, does "owner of (damage source)" mean the same as "owner of (attacking unit)"?
 

SvnmS

Well-Known Member
Messages
1,911
Reaction score
780
Tried it out and it didn't work. Well, the reset to 100% worked, but not the change. Does the shipyard need to be Neutral Hostile, or can it work for Neutral Passive?

And for clarification's sake, does "owner of (damage source)" mean the same as "owner of (attacking unit)"?
No, owner of attacking unit works when you use "unit attacks" event.
And it happens immediately after the unit starts attacking, before the attack even lands.
Damage source is for the "unit takes damage" event.
Make sure you are using damage source.
 
Top