Regenerating health in HL2E2

Regenerating health in HL2E2

Re: Regenerating health in HL2E2 Posted by Dark Tree on Thu May 13th 2010 at 1:13am
Dark Tree
646 posts
Posted 2010-05-13 1:13am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
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.
Re: Regenerating health in HL2E2 Posted by Riven on Thu May 13th 2010 at 8:40am
Riven
1640 posts
Posted 2010-05-13 8:40am
Riven
Wuch ya look'n at?
super admin
1640 posts 1266 snarkmarks Registered: May 2nd 2005 Occupation: Architect Location: Austin, Texas, USA
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!
Blog: www.playingarchitecture.net
LinkedIn: Eric Lancon
Twitter:@Riven202
Re: Regenerating health in HL2E2 Posted by Niborius on Thu May 13th 2010 at 7:24pm
Niborius
1007 posts
Posted 2010-05-13 7:24pm
Niborius
member
1007 posts 1116 snarkmarks Registered: Mar 23rd 2009 Location: The Netherlands
Wow Riven is there anything about source mapping you don't know? :D
Youtube Channel: https://www.youtube.com/c/Nibgames
Re: Regenerating health in HL2E2 Posted by omegaslayer on Thu May 13th 2010 at 8:41pm
omegaslayer
2481 posts
Posted 2010-05-13 8:41pm
2481 posts 595 snarkmarks Registered: Jan 16th 2004 Occupation: Sr. DevOPS Engineer Location: Seattle, WA
DigiPen?! You jerk I wanted to go there, but alas no $$ to pay for it. Be sure to say hi to Brian for me :)
Re: Regenerating health in HL2E2 Posted by Niborius on Thu May 13th 2010 at 8:48pm
Niborius
1007 posts
Posted 2010-05-13 8:48pm
Niborius
member
1007 posts 1116 snarkmarks Registered: Mar 23rd 2009 Location: The Netherlands
omegaslayer said:
DigiPen?! You jerk I wanted to go there, but alas no $$ to pay for it. Be sure to say hi to Brian for me :)
You're not making sense :uncertain:
Youtube Channel: https://www.youtube.com/c/Nibgames
Re: Regenerating health in HL2E2 Posted by omegaslayer on Thu May 13th 2010 at 9:06pm
omegaslayer
2481 posts
Posted 2010-05-13 9:06pm
2481 posts 595 snarkmarks Registered: Jan 16th 2004 Occupation: Sr. DevOPS Engineer Location: Seattle, WA
Niborius said:
omegaslayer said:
DigiPen?! You jerk I wanted to go there, but alas no $$ to pay for it. Be sure to say hi to Brian for me :)
You're not making sense :uncertain:
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).
Re: Regenerating health in HL2E2 Posted by Le Chief on Thu May 13th 2010 at 11:35pm
Le Chief
2605 posts
Posted 2010-05-13 11:35pm
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
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!
Aaron's Stuff
Re: Regenerating health in HL2E2 Posted by Niborius on Fri May 14th 2010 at 6:29am
Niborius
1007 posts
Posted 2010-05-14 6:29am
Niborius
member
1007 posts 1116 snarkmarks Registered: Mar 23rd 2009 Location: The Netherlands
omegaslayer said:
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 :) and now that you mentioned it again I think I heard of DigiPen before. Anyways thanks for explaining
Youtube Channel: https://www.youtube.com/c/Nibgames
Re: Regenerating health in HL2E2 Posted by G4MER on Fri May 14th 2010 at 2:43pm
G4MER
2460 posts
Posted 2010-05-14 2:43pm
G4MER
floaty snark rage
member
2460 posts 360 snarkmarks Registered: Sep 6th 2003 Location: USA
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.
Re: Regenerating health in HL2E2 Posted by Dark Tree on Mon May 17th 2010 at 4:28am
Dark Tree
646 posts
Posted 2010-05-17 4:28am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
Thank you Riven, I will try that out and let you know how it works out!
omegaslayer said:
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!
Re: Regenerating health in HL2E2 Posted by Carcase on Thu Jun 17th 2010 at 6:00am
Carcase
145 posts
Posted 2010-06-17 6:00am
Carcase
member
145 posts 15 snarkmarks Registered: Nov 15th 2003 Location: Northern Virginia
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?
Re: Regenerating health in HL2E2 Posted by Riven on Thu Jun 17th 2010 at 6:11pm
Riven
1640 posts
Posted 2010-06-17 6:11pm
Riven
Wuch ya look'n at?
super admin
1640 posts 1266 snarkmarks Registered: May 2nd 2005 Occupation: Architect Location: Austin, Texas, USA
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.
Blog: www.playingarchitecture.net
LinkedIn: Eric Lancon
Twitter:@Riven202