Jump to content
Sign in to follow this  
Tankbuster

eventHandler handleHeal, clarification rqd :)

Recommended Posts

Triggered when unit starts to heal (player using heal action or AI heals after being ordered). If code returns false, engine side healing follows. Return true if you handle healing in script, use AISFinishHeal to tell engine that script side healing is done. See also lifeState and setUnconscious commands.

Passed array: [unit, healer, healercanheal]

* unit: Object

* healer: Object

* healercanheal: Boolean - true when healer is corpsman

Just want to get this straight in my head and rule out any potential linguistic anomalies in this...

When attached to a unit, this EH will be fired when he starts to heal so it's best attached to a medic?

The returned _this will be; select 0 will be the injured chap, select 1 will be the medic and, in this example, select 2 will be true.

Am I reading this right?

Share this post


Link to post
Share on other sites

No help then?

What I've found so far is that is I put this EH on players, it only fires when the medic heals someone. If I put it on non medic players, it doesn't fire when they get healed.

Share this post


Link to post
Share on other sites

I haven't played with this much, so I can't really help. But my first stop would be the new A2 healing modules systems and check out how they utilize this. Try PM'ing Xeno, as he did the custom ACE healing system, he might know.

Share this post


Link to post
Share on other sites

Oddly enough, it's a broken Xeno script I'm trying to fix.

I will look into the modules, though. Thanks CG.

Share this post


Link to post
Share on other sites

Has anyone had any success getting the handleHeal eventhandler to fire when healer is a medic tent for example?. The sparse documentation is not specific enough.

Perhaps a BI dev could clarify please?

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

At the moment, I'm finding the EH only fires when it's attached to a medic and he heals himself. I'd love to be corrected though.

Share this post


Link to post
Share on other sites

OK, more info. I've found that the handleHeal fires on the unit being healed

This has the unfortunate side effect that the game can't run a script on the medic as he heals - for example, give him points - as the EH will fire on the healee and we then can't get the healee to fire a script on the healer. Remote scripts aren't allowed... One client can't start a script on another.

Jman, unsure, Will get an answer for you soon.

Share this post


Link to post
Share on other sites
Jman;1813498']Has anyone had any success getting the handleHeal eventhandler to fire when healer is a medic tent for example?. The sparse documentation is not specific enough.

Perhaps a BI dev could clarify please?

handleHeal EH doesn't fire when units heal at medic tent. Just tried it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×