Author Topic: [VCE] How do I create Hunger System the correct way?  (Read 693 times)

Hey guys, I have encountered a little problem.
You see, I am making a Survival server, where I want to add Hunger, Thirst, Temperature, Fatigue and a lot more.

Here's what my hunger looks like so far:



When events are executed, I get my health always sapped, and onVariableUpdate does not show the centerprint of both hunger and temperature.
I also noticed that while my health is being sapped, the Hunger variable is at 100!
And fyi, I tried naming ifVariables to <var:pl:Hunger>, and also, #4 is >= 10 because I tested if that's the problem.

Okay guys, I fixed the Hunger System substracting and all that... But since I changed onMinigameReset -> FireRelay to onPlayerTouch, when one player executes the system after the another one already did, the another player's hunger system stops working and passes on to the one player.
How do I do some schnizzy stuff so hunger system works individually for each player?

Okay guys, I fixed the Hunger System substracting and all that... But since I changed onMinigameReset -> FireRelay to onPlayerTouch, when one player executes the system after the another one already did, the another player's hunger system stops working and passes on to the one player.
How do I do some schnizzy stuff so hunger system works individually for each player?
It seems like relays only work for a player through one brick. So when another person triggers the same brick, it commits itself to the new player, taking away the relay from the original player. The player really never has the relay, the brick does, which is causing the problem. If someone could make an event for "PlayerFireRelay", this would work. Otherwise, you would need a ton more events and a brick for each player that joins. Unless, there is another way I am not aware of.

^^This is potentially all wrong^^

try using print counts for your loop, it can handle multiple people
onvariableupdate is only called with the VCE links i think

It seems like relays only work for a player through one brick. So when another person triggers the same brick, it commits itself to the new player, taking away the relay from the original player. The player really never has the relay, the brick does, which is causing the problem. If someone could make an event for "PlayerFireRelay", this would work. Otherwise, you would need a ton more events and a brick for each player that joins. Unless, there is another way I am not aware of.

^^This is potentially all wrong^^
It will ignore the second player and keep the first

Change "player" to "client"

It will ignore the second player and keep the first
it should stop the first though, it always has for me

Change "player" to "client"

It seems like relays only work for a player through one brick. So when another person triggers the same brick, it commits itself to the new player, taking away the relay from the original player.

Combine these statements and I believe you got it.

If you change all "player"s to "client"s, then it should work.

But I would suggest using the Hunger mod for this, unless you include certain hunger aspects such as speed of the player, starving=no move playertype. 

I had been thinking about doing a completely realistic City RPG with what you are doing here, ie VCE functions for hunger, hygiene, sleep, etc...

Holy crap you guys, I think you helped me with that problem!
I still need to confirm it works correctly, though. Waiting for players on my server, currently.