Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Automatic heal after get hurt

Author
Message
Captain Kirk
19
Years of Service
User Offline
Joined: 30th Aug 2005
Location: Sickbay
Posted: 30th Dec 2007 19:59
I would like to make a game, where if the user get hurt, and if health loosing stops for a few seconds (player find a cover and/or enemy stops attacking and/or enemy die), player health will start regenerating automatically.

Can somebody help in this?
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 30th Dec 2007 20:44
As far as i know, there isn't a way to detect if the player is losing health, i may be wrong though.

sps999
17
Years of Service
User Offline
Joined: 23rd Oct 2007
Location: On my Computer
Posted: 31st Dec 2007 01:47 Edited at: 1st Jan 2008 02:25
Use this script in a trigger zone.



Note: It does not have to be over the whole level.

Notice: I have not yet tested it so it might not work.

This is my very first script request carried out and I'm really proud.

----Edit----
Whoops! Doesn't work at all even when the trigger zone is across the map. Maybe somebody could tweak and and fix it.

Snipesoul
17
Years of Service
User Offline
Joined: 29th Aug 2007
Location: Somewhere in New York...
Posted: 31st Dec 2007 04:15
@sps99, Your script is almost correct, but your syntax is wrong.
Here's an edited one for ya:



Test it as a script of a dynamic light and tell me if it works or not. Thank you!

Snipe to Success
Captain Kirk
19
Years of Service
User Offline
Joined: 30th Aug 2005
Location: Sickbay
Posted: 31st Dec 2007 19:19 Edited at: 31st Dec 2007 19:21
Yess. It's seems to be working. Thank you everybody.

BTW: Happy New Year for everybody.
sps999
17
Years of Service
User Offline
Joined: 23rd Oct 2007
Location: On my Computer
Posted: 31st Dec 2007 19:43 Edited at: 31st Dec 2007 20:02
Snipesoul, you seem to be fixing all my scripts and I am very grateful for that.

Thank You

----Edit----

It works! Except only once.

Okay, when I take damage I won't heal for some time like it's supposed to. But when I have full health and I take damage again it heals right away. Could you make it so once you have full health you will have to wait 'till the timer ends again?

Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 31st Dec 2007 20:00
...FPSC wants to immediately replenish the player's health. More like god mode, than regeneration.

Played with it some. Try setting:

:state=2,timergreater=45000:plraddhealth=1

Not perfect by any means, but it will give about a 45 second delay from when the player first receives damage, before the player's health will increase. In the middle of a firefight, it seems a little less noticable.

Nice job guys!


Own It, Or Get Owned...
sps999
17
Years of Service
User Offline
Joined: 23rd Oct 2007
Location: On my Computer
Posted: 31st Dec 2007 20:08
Thanks, Seth Black, but what I tried to state in my previous post is that once the 45000 milliseconds are over you're in god mode from then on. What I need is so that the timing process restarts after full health is reached.

Thanks.

Snipesoul
17
Years of Service
User Offline
Joined: 29th Aug 2007
Location: Somewhere in New York...
Posted: 31st Dec 2007 23:19
The timerstart action resets the timer back to 0, and starts a new one.

Snipe to Success
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 31st Dec 2007 23:31 Edited at: 31st Dec 2007 23:37
...true. I ran a level with two enemies shooting at me for several minutes.

Each time the player took damage, I'd duck behind a wall and could count off the delay before regeneration took place.

Why would you want to start the timer after the player is at full health?


Widow 13 - Coming Spring 2008
Snipesoul
17
Years of Service
User Offline
Joined: 29th Aug 2007
Location: Somewhere in New York...
Posted: 31st Dec 2007 23:47
The point is, you want to start the timer as soon as the player loses health. Do I need to re-edit the script again?

Snipe to Success
sps999
17
Years of Service
User Offline
Joined: 23rd Oct 2007
Location: On my Computer
Posted: 1st Jan 2008 02:21 Edited at: 1st Jan 2008 02:24
What I meant is not start the Timer when you have full health but restart the script and it's supposed to do that but it doesn't. That's what I meant.

P.S.

How do you guys like my sig? I'm a big Lord of the Rings fan and I'm very proud of my Sig. Sorry for the offtopic message, I was just dying to say it.

Snipesoul
17
Years of Service
User Offline
Joined: 29th Aug 2007
Location: Somewhere in New York...
Posted: 1st Jan 2008 04:49 Edited at: 1st Jan 2008 04:49
New re-edited script! I set the new default regeneration time to 10 seconds, but you can still adjust it to any time you want. I'm still looking for a condition for something like plrshotdamage so I can determine if the player has been shot. Besides that, the script is pretty much complete anyway.



Snipe to Success
Captain Kirk
19
Years of Service
User Offline
Joined: 30th Aug 2005
Location: Sickbay
Posted: 2nd Jan 2008 09:58
Thanks
Molten Ice
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 14th Feb 2008 16:06
Sorry for starting this old topic again.... but Just wanted to say the script works like a charm

BUT, after 10 seconds when the health starts to regenerate it regenerates almost instantly from whatever it was to full!! could there be some delay in healing the health? what change should I make?

Thanks!
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 14th Feb 2008 16:08
Make the timer number bigger....

Here:
Quote: ";Artificial Intelligence Script

;Header

desc = SPS999's player health regeneration EDITED BY SNIPESOUL, SNIPED UP STUDIOS


;Triggers

:state=0,plrhealthless=500:timerstart,state=1
:state=1,timergreater=10000:plraddhealth=1
:state=1,plrhealthgreater=499:state=0

;End of Script"


Molten Ice
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 14th Feb 2008 16:12
I thought that one delayed the time where the player is not losing any more health and then it starts to regenerate.

I was looking for a way to slow down the rate of regeneration.... if my health is 10 for instance after killing an enemy... I wait for a few seconds and then the thing starts healing... just like it's supposed to. BUT, it reaches 500 in less than a second! I wanted to slow down the rate of healing.... not time before the healing starts.

I hope you understand what I mean.

Thanks!
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 14th Feb 2008 17:04
Sorry, you can't go lower than 1, unless....

Wait, new script!


It should work.....

Molten Ice
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 15th Feb 2008 14:34
seems to work.... may I know what exactly you changed? the health still regenerates really fast.

Thanks again!
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 15th Feb 2008 14:59
I made it time 1 second between health point addition.....

Molten Ice
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 16th Feb 2008 15:30
did you try it out? Still seems fast to me...
Pride
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Eastern USA
Posted: 24th Feb 2008 18:10 Edited at: 24th Feb 2008 18:49
Works fine the first time, but after I fully heal the first time, I go into a phase of god-mode. I WON'T die unless I jump off teh boundaries.

EDIT: Oh, nvm, I got it working, thanks, it works GREAT!

Hey mods, I liked my siggy!

Login to post a reply

Server time is: 2024-11-24 06:49:45
Your offset time is: 2024-11-24 06:49:45