Jump to content
Sign in to follow this  
Balgias

Health Regen script.

Recommended Posts

I found this script in another part of the forums and I was wondering how I could get it to easily function in other campaigns, I'm unsure how to get this script started in-game.

private ["_newDamage","_t"];
hint "Regen Script Started";
while {alive player} do 
{
_t = time;
waitUntil {time - _t > 1};
if (damage player > 0) then 
	{
	_newDamage = (damage player) - 0.05;
	player setdamage _newDamage;
	hintSilent format["Current Damage %1",_newdamage];
	};
sleep 0.10;
};

waitUntil{alive player};
sleep 0.5;
[player] execVM "regen_health.sqf";

Share this post


Link to post
Share on other sites

Interesting.

From the top of my head I'll make an attempt at this, im no scripter, of coder, but i have dabbled in scripts and configs before,

it may not be right but its a start.

You would need to create the actual script, so using Armaedit--> http://www.armaholic.com/page.php?id=1455&highlight=ARMAEDIT

you would create a new SQF, and then basically paste the code into the open space, then save the script as regen_health

Put the script in the folder of your mission.

You would then take this code seen at the bottom of the script:

[player] execVM "regen_health.sqf";

name your character, (player) and put that name in between the brackets, so lets say your character's name was Dan, you would:

[Dan] execVM "regen_health.sqf";

As for calling the script i think you would put something like this in the player's init line

in the editor of the mission you were to use the script in.

null = [player] execVM "regen_health.sqf";

I'm not 100% on that.

Edit...

Yep just tested it works like i said.

Thing is when you do get injured it shows a number in the hint at the top right, and gives you a damage number, it does regenerate your

health but I think this could be better optimized,a nd more time added to slow the regeneration process, as 5 sec is to fast.

Share this post


Link to post
Share on other sites
Interesting.

From the top of my head I'll make an attempt at this, im no scripter, of coder, but i have dabbled in scripts and configs before,

it may not be right but its a start.

You would need to create the actual script, so using Armaedit--> http://www.armaholic.com/page.php?id=1455&highlight=ARMAEDIT

you would create a new SQF, and then basically paste the code into the open space, then save the script as regen_health

Put the script in the folder of your mission.

You would then take this code seen at the bottom of the script:

[player] execVM "regen_health.sqf";

name your character, (player) and put that name in between the brackets, so lets say your character's name was Dan, you would:

[Dan] execVM "regen_health.sqf";

As for calling the script i think you would put something like this in the player's init line

in the editor of the mission you were to use the script in.

null = [player] execVM "regen_health.sqf";

I'm not 100% on that.

Edit...

Yep just tested it works like i said.

Thing is when you do get injured it shows a number in the hint at the top right, and gives you a damage number, it does regenerate your

health but I think this could be better optimized,a nd more time added to slow the regeneration process, as 5 sec is to fast.

5 Seconds is what I was going for, I changed sleep 0.05 to 0.10 for a more gamey style of game-play due to not wanting to set up something more complex that uses bandages and whatnot. I'll be setting this up for a co-op campaign, so does that mean I'll have to splice this script into each of the campaigns missions, and my partner will have to do the exact same ? :S

Share this post


Link to post
Share on other sites

Ok.

so does that mean I'll have to splice this script into each of the campaigns missions, and my partner will have to do the exact same ? :S

Yes and no, there is a way to make it work through the campaign, but i dont know how to do that.

For each mission you would need to add it, so I would suggest just copy n paste from folder to folder, use one as a template.

This is an interesting idea though, this would be something unique for coops, instead of respawn you could have this regeneration,

although problem is not all bullets are wounding, so it depends.

Share this post


Link to post
Share on other sites

Well this coop mission it's being used for is a tough one, and coop campaign "save games" are a bit broken soo most of the time we end up having to replay entire missions because of some weird conditions causing the server to ignore the save games and revert to the start instead, thus deleting our progress.

http://forums.bistudio.com/showthread.php?118731-Arma-2-Namalsk-Crisis

It feels somewhat appropriate for there to be a somewhat strong healing mechanic present for coop for this mods campaign because of how often med-kits were frantically spammed in combat in the original STALKER. I know it's not at all in the aesthetic of the ARMA community in general to have a seemingly cheating method like this, but getting nicked by ones own grenade then being stuck moaning out for the rest of the mission is quite annoying :S Which is partially ARMA 2 to blame for the game (seemingly) having very little to no built-in self healing tools to capitalize on for single-player type missions apparently.

But all that aside if someone knows any better on how to get this working properly for a campaign I would be greatful.

Share this post


Link to post
Share on other sites

If you're planning to add health regen in Namalsk Crisis campaign. First you're going to need pboview to depbo the campaign. Then throw the script inside each mission folder and do a

nul = player execVM "regen.sqf"; 

in the init.sqf or each player's init. After that you're going to need cpbo to put the files and folder back into pbo format.

One of my zombie mission I made for a zombie mission pack (I barely released today, the mission where you play as bloodsuckers) uses health regen and I'm pretty sure you got the script from Dead3yeZ here if I'm correct.

http://www.armaholic.com/forums.php?m=posts&p=128532

In the @NC folder, there should be a file called ns_missions.pbo. Go to campaigns -> and extract those files out and edit them up. Just put the script in each mission folder and paste the code into the init.sqf . If you do modify, might as well resave it to another version and call it "Health Regen Version"

Edited by Phantom Six

Share this post


Link to post
Share on other sites
Guest

Mission editing realted questions do not belong in the Q&A section but in the ................... mission editing section!

Please search before posting. Topic moved.

Share this post


Link to post
Share on other sites

If I'm not mistaken I think the simple first aid module is a BIS heath regeneration script that also adds some cool screen effects.

If you use it though read up on it, its not that “simple†a simple first aid module. You will need to add this allowdamage true to all the none player units in a group to make them killable again for a start.

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  

×