Scripts / Health respawn

Author
Message
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 12th Jan 2019 14:14 Edited at: 12th Jan 2019 15:07
There does not seem to be any setting to get the health to respawn.
I have come to the conclusion that scripting is the answer.
I have looked at the scripts that default for the health entity and cannot make sense of them enough to know how to change them.
I am open to suggestions.

If you ask me to post my script here, bare in mind I have written no script.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 12th Jan 2019 15:17
You can set all your Lives, Health and replenishment speeds etc in the " Start Marker " properties.
Is that what you mean ?
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 12th Jan 2019 16:42
I mean health entities that can be picked up by the player as they play the game.
PM
Len the man
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 12th Jan 2019 16:54
Do you want a script to re-spawn a health-kit or med-kit, so the player can go back after a few seconds to get another item to increase their health points?

Smallg made a script for me like this. I used the script so the player can drink water to increase their health points, and 20 or 30 seconds later it re-spawns and you can get another drink of water to increase your health points again.

Check out this link - https://forum.game-guru.com/thread/207801?page=20#msg2572192
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 12th Jan 2019 17:21
Ahh I thought you were referring to the replenishment ..
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 12th Jan 2019 18:40
This script works as far as the timer to respawn.
However it doe not give health, it takes one point of health each time it is collected.
If there is a way to make it so that it can picked up just by running into it and give heath instead of take it, I think that would more productive.
I have looked at it and cannot figure out the method needed to do that.
Is there anyone that can do that it would be most helpful.
PM
Len the man
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 12th Jan 2019 22:01 Edited at: 12th Jan 2019 22:03
I used this script with a med-box and it worked fine. However, some of this can be tricky to get it to work as desired.

Sometimes when I used this script with an entity model other then the med-box, it would take 1 health point away. I discovered that if you used another entity or made your own entity model, it might not work. Sometimes entities other then the med-box don't work so well, so here is what you can do to solve the problem. (1) You need to make a back-up copy of the entity you want to use and copy it's FPE file also. (2) You should then copy the contents of the FPE file from the med-box and use those contents to replace the contents of the FPE file of the entity you want to use. (3) Remember to change the model name in the FPE file to the entity model name you are using, and save the FPE file. The entity you want to use should then work with this script.

The script can also be altered for a simple approach pick-up instead of needing to push the "E" button.

I just altered it to a simple approach pick-up, then tried it out, and it worked with the med-box.

I will put the altered approach pick-up script here so you can download it and try it out.

Attachments

Login to view attachments
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 12th Jan 2019 23:29 Edited at: 13th Jan 2019 18:27
@Len the man There is no prompt of any kind and it will not allow the player to pick it up.
I am not even able to identify the lines in the script that would say how much health the the player is supposed to get.
Even that would be helpful to know in the stock scripts that came with GG.

You might be thinking that I did not follow your instructions.
I followed them to the letter.
(1) I made a back-up copy of the entity I want to use and copy it's FPE file also.
(2) I then then copied the contents of the FPE file from the med-box and used those contents to replace the contents of the FPE file of the entity I want to use.
(3) I changed the model name in the FPE file to the entity model name I am using, and saved the FPE file.

I did not work as you described.
I have supplied the script that you posted.
If you look at the way it is written are you sure that is the file that worked for you?
I just want to make sure that I have the correct script file.

Attachments

Login to view attachments
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 13th Jan 2019 05:44 Edited at: 13th Jan 2019 18:43
I did finally figure out how to change the amount of health that the player gets when they pick up the health entity in both the health_with_respawn_timer_pickup.lua and health_with_respawn_timer.lua.
Although the health_with_respawn_timer_pickup.lua does not allow pickup at all.
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 13th Jan 2019 06:27 Edited at: 13th Jan 2019 18:35
I have tried several different approaches and have failed miserably at not having to use the "E" key to pick the health using this script.
Other than that this script works great.

Attachments

Login to view attachments
PM
Len the man
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 13th Jan 2019 22:10
If I put a med-box on the ground (in the editor) and use the health_with_respawn_timer_pickup.lua script, it works fine... However, if you use it to try to pick something up that is on a table or if the entity is on top of something, you might need to edit the script to increase the distance that the entity can detect the players approach. To do this, you need to open the script in notepad++. Find line 13 where is says PlayerDist < 80 and change the number 80, and increase it to something like 100, or 120. This should help.

If this doesn't work, then I would ask what version of GG you are using, because some scripts don't work in some versions of GG.
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 14th Jan 2019 00:47 Edited at: 14th Jan 2019 00:48
It did not work with the changes you said to make. Not on a barrel or on the ground with the dist set to 300.
This the version of GG that I have.

Attachments

Login to view attachments
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 14th Jan 2019 06:04
From what i recall in FPSC you just set the spawn time and it would just appear after the player grabbed it after the time given. I believe Game Guru doesnt even use the spawn fields in the FPE... which is unfortunate....
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 14th Jan 2019 10:33 Edited at: 16th Jan 2019 10:13
Highly unfortunate!!
Having tried different approaches to this issue, I have come to the conclusion that it is as good as it gets.
Community based help has taken as far as it can and I thank you.
PM

Login to post a reply

Server time is: 2024-12-22 14:30:39
Your offset time is: 2024-12-22 14:30:39