Scripts / regen rates via script?

Author
Message
Honkeyboy
3D Media Maker
6
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 7th Jun 2021 17:26
Hi guys, can we access the regen rates via script? Ive noticed these in the global.lua
-- GameLoop Globals, Init and Loop
g_gameloop_StartHealth = 0
g_gameloop_RegenRate = 0
g_gameloop_RegenSpeed = 0
g_gameloop_RegenDelay = 0
but unsure if they can be called via a script?
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AmenMoses
GameGuru Master
5
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 7th Jun 2021 19:24
Try setting them and see what happens, looking at how they are used in gameloop.lua I can't see why it wouldn't work.

Been there, done that, got all the T-Shirts!
PM
Honkeyboy
3D Media Maker
6
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 8th Jun 2021 11:28 Edited at: 8th Jun 2021 12:10
well so far I've tried putting them on a zone 2 ways with no result, I'm also unsure what g_gameloop_StartHealth = 0 does is that when to start or stop? anyway so far no go :/

1/


2/


i supose i could do it buy adding 1 health on a timer maybe until the max health is reached?

Edit so had a bash at that using a timer on the healing zone script which also didn't work for me lol it adds the health but doesn't wait 3 seconds hmm :/


Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
smallg
Community Leader
15
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Jun 2021 16:11 Edited at: 8th Jun 2021 16:12
start or stop what?
g_gameloop_StartHealth is how much health the player starts the level with - i.e. the amount you have set in the start marker.

Your zone needs to only count down while the player is inside the zone if you want it to only heal after 3 seconds of being in the zone - currently it will start counting as soon as the script is active.
i.e. put the code inside an if g_Entity[e]['plrinzone'] == 1 then check
and remember to reset the timer while the player is not in the zone
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
6
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 8th Jun 2021 17:08 Edited at: 8th Jun 2021 19:22
Couldn't get it to work so i tried it this way which works fine It was only on a zone m8 for testing purposes its actually a skill mod for the rogue class anyways this one works if anyone needs one just pop it on a zone and you heal.
Notes indicate the rate and speed of the regen.



Edit: anyone have any idea why that works on a zone and not on an always active entity?
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Login to post a reply

Server time is: 2021-11-27 11:53:14
Your offset time is: 2021-11-27 11:53:14