For longer missions in which the player's medic might die! I thought I needed a way to fully heal the player that A: can't be used endlessly, and B: rewards exploration and taking your time. Nothing annoys me more in missions than to get hurt, and not be able to get fully healed so that you have to listen to the guys constant moaning and watch the screen darken slightly every time. So I came up with the following setup: if you look carefully, you can find boxes of painkillers scattered throughout the level. Picking them up is a one-time thing, but will fully reset your health. Look for them in outposts and the like.
How it works:
First, I put down a Game Logic with the following text in it's initialization field:
pickedUpCount = 0;
pickup_code = {
deleteVehicle (_this select 0);
pickedUpCount = pickedUpCount + 1;
hint format ["Ahh, that's better.", pickedUpCount]; player setDamage 0;
};
Then all that is left to do is open up the box of painkillers, and in it's initialization field you put the following:
this addAction ["Heal", {call pickup_code}];
After that, you can put as many of these painkillers in the level as you want, as long as they have that code in it's initialization field. You only need one Game Logic.