Canjucks Posted May 26, 2020 Share Posted May 26, 2020 So I tried to make russian roulette a hospital event instead of being killed you hit the hosp for x amount of time. So, I haven't understood yet how health works and I think this is where the issue lies but this is the code I changed in roulette and the screenshot is the error I get in hospital. if ($shot) { $this->error("It was the chamber with the bullet and you paralysed yourself!"); $this->user->set("US_energy", 0); $this->user->set("US_will", 0); // update health to 0 and timer to extended time in hospital // I tried health at 0 but then found it was linked to ranks so made higher value. $this->user->set("US_health", 1000); $this->user->set("US_shotBy", $this->user->id); $this->user->updateTimer('hospital', (30000), true); Thanks in advance if you can help me work this out as its been kinda bugging me - see what I did there lol Quote Link to comment Share on other sites More sharing options...
Sim Posted May 26, 2020 Share Posted May 26, 2020 Whatever yo did? Yuou never told us what's wrong? Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 26, 2020 Share Posted May 26, 2020 More information requested. Screenshot contains the result of a call to var_dump(), but no error message. Is `US_shotBy` a valid key? Quote Link to comment Share on other sites More sharing options...
Sim Posted May 26, 2020 Share Posted May 26, 2020 As far as I am aware, health is always 0 in GL? Your either dead or your alive? 1 hour ago, Magictallguy said: call to print_r(), but no error message. Is `US_shotBy` a valid key? Var_dump? US_shotBy is valid. Quote Link to comment Share on other sites More sharing options...
Canjucks Posted May 26, 2020 Author Share Posted May 26, 2020 The issue is understanding how health is dealt with in GL. The mod that I modified isn't mine in Russian Roulette which kills you if you get hit. In my version it send you to hospital for x amount of time, losing your will and energy. After reading some of your responses it made me think if Health is always 0 then this change I made won't work unless I make further changes so Health can equal a greater number so when it hits 0 it does something more than it does now as setting it to 0 does nothing. You can set it to a higher number for reviving your health in the hospital mod if somehow you lose health you can pay to get it back to 100% which is not quite accurate as it is. This just might be a flaw with how I'm trying to change the game to suit the style I'm working towards. Quote Link to comment Share on other sites More sharing options...
Sim Posted May 26, 2020 Share Posted May 26, 2020 If they die. Don't let them know they are dead? Just make a fake health bar until it off hospital? Say 100 minutes in hospital then you revive them. Every minute is a % of health refilled. Quote Link to comment Share on other sites More sharing options...
Canjucks Posted May 26, 2020 Author Share Posted May 26, 2020 its going to work into my next thing of being able to revive peeps in hospital. Having more things that end you up in hosp will make that more viable. Quote Link to comment Share on other sites More sharing options...
Tom V Posted May 27, 2020 Share Posted May 27, 2020 They way I understand it, a players full health equals zero and goes up with damage. If the players health value exceeds the rank health value, then they should be dead. When you check in to hospital, health value is set to zero (full health) and player is released when hospital timer runs out. It sounds like you want other players to be able to bust someone out of the hospital early by paying a fee or by other means (just guessing because you didn't provide a lot of detail). If that's the case, you should be trying to reduce or reset the player's hospital timer, to simulate that you are speeding up the healing / reviving them. 1 Quote Link to comment Share on other sites More sharing options...
Sim Posted May 27, 2020 Share Posted May 27, 2020 Thanks for explaining how the health system works @Tom V. I never looked into it yet since I hadn't had a need to. Quote Link to comment Share on other sites More sharing options...
Canjucks Posted May 27, 2020 Author Share Posted May 27, 2020 4 hours ago, Tom V said: They way I understand it, a players full health equals zero and goes up with damage. If the players health value exceeds the rank health value, then they should be dead. When you check in to hospital, health value is set to zero (full health) and player is released when hospital timer runs out. It sounds like you want other players to be able to bust someone out of the hospital early by paying a fee or by other means (just guessing because you didn't provide a lot of detail). If that's the case, you should be trying to reduce or reset the player's hospital timer, to simulate that you are speeding up the healing / reviving them. Thanks for explaining how Health works that will go a long way to understanding this error (or lack of reason for the error that I have when using russian roulette). I thought I did explain it but yes I want to have a revive button (bust out) for a fee ultimately either with money or energy as the cost or both. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.