Jump to content
disorder

Autoheal Algorithm Coding

Recommended Posts

This is autohealing from a programmers perspective, lots of code here.

The code takes a health fraction amount every second, calculated from the players current food value and then adds it up. Every 10 seconds the system adds this as blood.

function tick_cycle

if health_counter < 10 do

begin

health_fraction = player_food_value / 1000

blood_heal_modifier = blood_heal_modifier + health_fraction

health_counter + 1

end

else if health_counter >= 10 do

begin

player_current_blood = player_current_blood + blood_heal_modifier

blood_heal_modifier = 0

health_counter = 0

end

1000 is a very small fraction, but since you are adding up to 12000 blood. It will take a very long time to full heal even at full food levels.

  • Like 8

Share this post


Link to post
Share on other sites

Aw thanks, It's funny I actually did this as a working mod for GTA4 ages ago too.

Share this post


Link to post
Share on other sites

Just a thought,

It'd be good to cap the regen, so you can't get more than +/- 75% of your health back without assistance.

I know someone's going to tell me "it's not fair on lonewolves". but it's a multiplayer game. We can't bypass all player interaction.

Communication has to be rewarded (with life) to discourage pure KoS mentality.

  • Like 1

Share this post


Link to post
Share on other sites

Just a thought,

It'd be good to cap the regen, so you can't get more than +/- 75% of your health back without assistance.

I know someone's going to tell me "it's not fair on lonewolves". but it's a multiplayer game. We can't bypass all player interaction.

Communication has to be rewarded (with life) to discourage pure KoS mentality.

I agree with this completely. 85% of the time, I play as a lone wolf, and I don't want to be gimped. Makes it more challenging.

Share this post


Link to post
Share on other sites

i agree nice idea and well thought out. 75% cap would make it fair as well

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

×