Jump to content
Sign in to follow this  
rekrul

addScore for first aid and negative for killing civvies in MP

Recommended Posts

I have a mission where 4 mechanized US squads are playable and respawn is set to "SIDE". However I want players to get +1 score for giving first aid and -5 for killing civilians or enemies who has surrendered but I have no idea how.

I'm guessing I have to use addEventHandler (?) but checking the wiki and searching here haven't helped much so can anyone point me the right direction? I hope I don't have to make an addEventHandler for all 44 playable units?

Share this post


Link to post
Share on other sites

Thanks, but how do I use that? I guess AISFinishHeal is the one I want to use, but I have no idea how to as I've never used EventHandlers.

Share this post


Link to post
Share on other sites

I've been pondering this, can someone help me and tell me whether I'm on the right track or not.

HandleHeal

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

So for every (playable) unit I need this:

 this addEventHandler ["handleHeal",{_this select 1 addScore 1}];

I know this will give the healer 1p even if the wounded die during the healing, but I can live with that (it's the thought that counts, etc). However some questions arise:

1. If that eventHandler is on both the wounded and healer, wouldn't that run it twice giving healer 1p twice?

2. Do I have to run this on every playable unit or just once in a script? Since it reports both, it doesn't seem to be triggered by a unit, just when someone is starting to heal.

3. Wouldn't this give AI points too?

4. I'm using all 3 First Aid modules, where all units can give first aid but only corpsman can heal (completely). Does this mean that one wounded guy can "give" 2 points? (1 for FA and 1 for (complete) heal?

Edited by Rekrul

Share this post


Link to post
Share on other sites

The handleHeal thing worked, thanks!

How do I fix it so those killing civilians gets negative score? I assume I have to use an eventhandler and "killed" but since the civilians are created by Alice, how do I add the eventhandler?

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  

×