Regenerating health in HL2E2
Post Reply
Quote
Re: Regenerating health in HL2E2
Posted by Dark Tree on Thu May 13th at 1:13am 2010


Yes hello all!

I would like to know if there is a way to enable or control health regeneration in the Half-Life 2: Episode 2 engine. I am making a mini-mod but want to have health regeneration in the style of Portal.

I do not want to have a large brush that is constantly giving me health, as that is rather tacky.

Any help or direction for me to be led in would be superb! I searched the forums, but alas, nothin.




Quote
Re: Regenerating health in HL2E2
Posted by Riven on Thu May 13th at 8:40am 2010


Hmm, outside of coding a new entity to do just that, the best way I could think of would be to use the logic_playerproxy entity.

You could enable a logic_timer with an interval of 0.1 and to send an output to the playerproxy

>On Timer; playerproxy; SetPlayerHealth; 100.

Or if you don't want it to affect the player until they get to a certain level of health, you could use the "RequestPlayerHealth" input on the playerproxy to send an output to a logic_compare which would then decide based on whatever level of health you deem too low whether to heal the player then or not.

No volumes needed!






Quote
Re: Regenerating health in HL2E2
Posted by Niborius on Thu May 13th at 7:24pm 2010


Wow Riven is there anything about source mapping you don't know? smiley





Quote
Re: Regenerating health in HL2E2
Posted by omegaslayer on Thu May 13th at 8:41pm 2010


DigiPen?! You jerk I wanted to go there, but alas no $$ to pay for it. Be sure to say hi to Brian for me smiley



Quote
Re: Regenerating health in HL2E2
Posted by Niborius on Thu May 13th at 8:48pm 2010


Quoting omegaslayer
DigiPen?! You jerk I wanted to go there, but alas no $$ to pay for it. Be sure to say hi to Brian for me smiley


You're not making sense smiley






Quote
Re: Regenerating health in HL2E2
Posted by omegaslayer on Thu May 13th at 9:06pm 2010


Quoting Niborius
Quoting omegaslayer
DigiPen?! You jerk I wanted to go there, but alas no $$ to pay for it. Be sure to say hi to Brian for me smiley


You're not making sense smiley


Look at his occupation: "digipen student". DigiPen is a school for game design up in Washington in the united states. The creators of Portal (and now portal 2) graduated from DigiPen and were scooped up by Valve. Its basically one of the most prestigious schools to learn art (for game art), or a computer science degree (for graphics/game logic/networking). Valve, Microsoft, and Nintendo (which is right next door to the school's building) hire people who graduate from there directly practicality. I wanted to go to the school there but it was very expensive, more money that I could afford even if I took out loans to pay for it.

I know a guy named Brian (IcedEagle) who goes there (rather hes graduating this year I believe).




Quote
Re: Regenerating health in HL2E2
Posted by Le Chief on Thu May 13th at 11:35pm 2010


I was able to achieve this effect in Half-Life 1 with a bit of code but Riven's suggestion sounds good. No brush based entities!





Quote
Re: Regenerating health in HL2E2
Posted by Niborius on Fri May 14th at 6:29am 2010


Quoting omegaslayer
Look at his occupation: "digipen student". DigiPen is a school for game design up in Washington in the united states. The creators of Portal (and now portal 2) graduated from DigiPen and were scooped up by Valve. Its basically one of the most prestigious schools to learn art (for game art), or a computer science degree (for graphics/game logic/networking). Valve, Microsoft, and Nintendo (which is right next door to the school's building) hire people who graduate from there directly practicality. I wanted to go to the school there but it was very expensive, more money that I could afford even if I took out loans to pay for it.

I know a guy named Brian (IcedEagle) who goes there (rather hes graduating this year I believe).


Ok that does make sense smiley and now that you mentioned it again I think I heard of DigiPen before. Anyways thanks for explaining






Quote
Re: Regenerating health in HL2E2
Posted by G4MER on Fri May 14th at 2:43pm 2010


They were at PAX in the BYOC area.. met some of them.. they had some student made games there on thumb drives they gave out.



Quote
Re: Regenerating health in HL2E2
Posted by Dark Tree on Mon May 17th at 4:28am 2010


Thank you Riven, I will try that out and let you know how it works out!


Quoting omegaslayer
Be sure to say hi to Brian for me

lol if I see him I'll sure let him know you said hi.


Muynay: You were at PAX? Hm, if you go next year I'll seeya there!




Quote
Re: Regenerating health in HL2E2
Posted by Carcase on Thu Jun 17th at 6:00am 2010


You say to use a logic_compare, what parameter do you set its compare value to with the player proxy? Is there a !value or something?



Quote
Re: Regenerating health in HL2E2
Posted by Riven on Thu Jun 17th at 6:11pm 2010


By using the "RequestPlayerHealth" Input value for the logic_playerproxy via the logic_timer, that input links with the logic_playerproxy's "PlayerHealth" output value, passing along whatever the player's health is at the last time the health request input was used. So, that value outputs the actual value of the player's health, which you could send to the logic_compare. something along the lines of:

PlayerHealth; logic_Compare; SetCompareValue; <none>
PlayerHealth; logic_compare; Compare; delay: 0.001

^That's the output coming from the logic_playerproxy to the logic_compare. You leave the parameter value empty because the output will fill it in automatically.

So, now looking at the logic_compare you'd set the Initial value in the class keyvalues to whatever number you'd like the lowest health for a player to be at before getting automatically healed. So for example, if you don't want the player to be automatically rejuvenated until they're at 45 HP, then you'd type 45 in the "initial value" keyvalue box.

When the logic_compare receives the input from the logic_playerproxy, you may use this output from the logic_compare:

OnLessThan; logic_playerproxy; SetPlayerHealth; 100

So, when the logic_playerproxy sends the "compare" output, the player should be re-healed, and all this happens in less than 1/100th of a second, checking every 1/10th of a second to do it again.

Does all that make sense? I'm trying to re-check to see if it does, so hopefully it's not too convoluted.








Post Reply