Scripts / Help! Player health script.

Author
Message
Mishahhi
User Offline
Joined: 20th Jun 2020
Location: Russia
Posted: 15th Sep 2020 20:16
Hello! I came across a very interesting moment in the game, but I am very weak in this. How can I fix this function so that health only grows up to 100, and does not reach infinite reserves. Please, if possible, describe or better send a video how to deal with this problem for me!

Attachments

Login to view attachments
AmenMoses
GameGuru Master
4
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Sep 2020 22:35
Um, crystal ball is a bit foggy atm, could you post the script?
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
15
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Sep 2020 22:59
you can set the health back to 100 if it goes above by checking it
i.e.
if g_PlayerHealth > 100 then
SetPlayerHealth(100)
end
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Mishahhi
User Offline
Joined: 20th Jun 2020
Location: Russia
Posted: 16th Sep 2020 10:22
AmenMoses, I beg your pardon, but I cannot understand you.
Mishahhi
User Offline
Joined: 20th Jun 2020
Location: Russia
Posted: 16th Sep 2020 10:23
smallg, now I will try not to screw it up and try your script! Thank you very much for helping out with the question. I hope my crooked hands will do the job and unsubscribe you again!
Teabone
Forum Support
14
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 18th Sep 2020 17:47
Quote: "health only grows up to 100, and does not reach infinite reserves."


I fixed this a couple years ago on Github but some how it reverted after the Science Fiction DLC update. I'll see if i can reach out to Lee or anyone that has Github access right now to see if they could include it.

Especially all the health items and health zones need the maximum checked. Not just "100". Also, for Game Guru Classic the number "100" there I believe is a static number or graphic. It should be replaced with the maximum variable.

My biggest problem is getting changes like these approved a second or third time over. Its a bit of a headache convincing. Even if the changes were once accepted on Github in the past! :/

Store Assets - Store Link
Free Assets - Resource Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
6
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 18th Sep 2020 19:57
Just store the starting g_PlayerHealth value in a var, and use their value as needed. IE:

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2021-01-20 16:04:33
Your offset time is: 2021-01-20 16:04:33