beta 0 Posted March 16, 2007 What I'm trying to do is to get the action to heal (like at the field hospital) and repair (like at the repair truck) to be transferred to an object (say a first aid cabinet or a crate). Tried to search, but I don't quite know what key words to look for, the searches turned up nothing useful. Hopefully someone knows ... Share this post Link to post Share on other sites
norrin 9 Posted March 16, 2007 One way would be to place a trigger with a radius that extends a little past the unit or building in question and then in the on activation code put player setDamage 0. I usually use a timeout countdown of 5 - 10 seconds so that the player has to hang around for a few seconds to get healed or rearmed. If you only want it work on certain unit types you can use a slightly more sophisticated trigger that runs a small script like in the following example you can get from  here I’ve written it so that the harrier spawns low on fuel and without bombs.  Just pull up alongside the tent in front of you and after 5 seconds your plane should refuel and reload with an accompanying message. Try parking the Hummer next to the tent but you’ll find that the reload trigger is only activated by the harrier. You’ll also find when the aircraft respawns that its low on fuel and has no bombs so just park it next to the tent again and it will reload. I’ve deliberately set the respawn time for both players and aircraft low so that you don’t have to wait long for testing.  You could also lengthen the time it takes to reload and refuel by making the “timeout†longer in the trigger. It also seems to take a few seconds for the option to board the respawned harrier to appear, don't worry though just keep trying and after 20 sec or so it'll let you get in as the pilot. The important thing is you can just apply the same principles and types of scripts to make buildings or objects heal and repair. Share this post Link to post Share on other sites
UNN 0 Posted March 16, 2007 As norrin mentioned, a simple example would be a first aid box. Add an action to your box, that calls a script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">FirstAidBox addAction ["Heal","healplayer.sqf"] healplayer.sqf: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Box=_This Select 0; _Unit=_This Select 1; _Unit SetDamage 0; You can also do it via configs if your making the objects yourself. Quote[/b] ]It also seems to take a few seconds for the option to board the respawned harrier to appear, don't worry though just keep trying and after 20 sec or so it'll let you get in as the pilot. Use the reveal command: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Player reveal _Harrier Just change _Harrier to whatever you use as a variable for the aircraft. The reason there's a delay is, it takes a little time for newly spawned objects to be identified as friendly or not. Share this post Link to post Share on other sites
beta 0 Posted March 16, 2007 Figured it would be so simple Don't know why I didn't think of that, I must have spent a good hour looking at all the new ArmA scripting commands before it was released. Guess I was looking for an 'easy' answer heh. Thanks for the replies, we'll see how it goes in multiplayer, never did like scripting for multiplayer ... Share this post Link to post Share on other sites
Big Dawg KS 6 Posted March 16, 2007 Figured it would be so simple  Don't know why I didn't think of that, I must have spent a good hour looking at all the new ArmA scripting commands before it was released. Guess I was looking for an 'easy' answer heh. Thanks for the replies, we'll see how it goes in multiplayer, never did like scripting for multiplayer ...  The easy answer is to make an addon with a modified config, because repair and heal properties are defined in the object's config. Share this post Link to post Share on other sites