rekrul 7 Posted August 18, 2010 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
Jelliz 10 Posted August 18, 2010 Eventhandler HandleHeal AISFinishHeal lifeState A start, but as i dont have any clue about MP scripting i dont think i can help further. Share this post Link to post Share on other sites
rekrul 7 Posted August 19, 2010 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
rekrul 7 Posted August 19, 2010 (edited) I've been pondering this, can someone help me and tell me whether I'm on the right track or not. HandleHealTriggered 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 August 19, 2010 by Rekrul Share this post Link to post Share on other sites
rekrul 7 Posted August 22, 2010 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