Jump to content
Sign in to follow this  
Kackarot58

Adjusting Food & Drink Levels

Recommended Posts

18 minutes ago, Clint Baldwin said:

Are these items in constants? I cannot find it!

Is this what your looking for ?

3BnoA53.png

Edited by XxFri3ndlyxX

Share this post


Link to post
Share on other sites

How to slow down hungry and thirsty?

2 hours ago, XxFri3ndlyxX said:

 this what your looking for ?

3BnoA53.png

 

Share this post


Link to post
Share on other sites
27 minutes ago, Ton_41 said:

How to slow down hungry and thirsty?

 

That i'm not sure yet. Was briefly going through files. But an alternative you could do is to make the max and initial higher number. this would result in taking longer time to deplete.

Share this post


Link to post
Share on other sites

Hey @Clint Baldwin, @XxFri3ndlyxX I think the right place to edit the rate of thirst and hunger is in 3_Game\PlayerConstants.c:

Quote

    const float METABOLIC_SPEED_ENERGY_BASAL    = 0.04;        //energy loss per second while idle
    
    const float METABOLIC_SPEED_ENERGY_WALK        = 0.1;         //energy loss per second
    const float METABOLIC_SPEED_ENERGY_JOG        = 0.32;     //energy loss per second
    const float METABOLIC_SPEED_ENERGY_SPRINT    = 0.54;     //energy loss per second
    
    const float METABOLIC_SPEED_WATER_BASAL        = 0.070;     //water loss per second while idle
    
    const float METABOLIC_SPEED_WATER_WALK        = 0.22;     //water loss per second
    const float METABOLIC_SPEED_WATER_JOG        = 0.66;     //water loss per second
    const float METABOLIC_SPEED_WATER_SPRINT    = 1.10;     //water loss per second

To my knowledge, that would require the file to be edited both on the server and the client, so each player would need to download this "mod". Perhaps you can do it server side only, but I haven't tested that.

EDIT: Just did a brief test and it seems to work perfectly fine to just edit this on the server side. So you can forget about my ramblings below... :)

/*

What you can do right now is to do an override in the mission file (the init.c on the server) by adding energy and water to each player for each server update. It's NOT a very efficient or good way of doing it, but based on 5 min. testing it works. It would go in the "class CustomMission: MissionServer" part of init.c and go something like this:

Quote

class CustomMission: MissionServer
{

    override void OnUpdate(float timeslice)
    {
        UpdateDummyScheduler();
        TickScheduler(timeslice);
        UpdateLogoutPlayers();
        ref array<Man> players = new array<Man>;
        GetGame().GetPlayers( players );
        
        for ( int i = 0; i < players.Count(); i++ )
        {
            PlayerBase player;
            Class.CastTo( player, players.Get(i));
            player.GetStatStomachWater().Add( 0.0002 );
            player.GetStatStomachEnergy().Add( 0.0001 );
         }
    }

...

}

Here I add a small amount to the player's water and energy for each update. It has the unintended effect of increasing water and energy when the player is idle.

*/

Edited by ColKernel
Tested editing PlayerConstants.c
  • Thanks 1
  • Beans 1

Share this post


Link to post
Share on other sites
On 9/29/2018 at 8:28 AM, ColKernel said:

Hey @Clint Baldwin, @XxFri3ndlyxX I think the right place to edit the rate of thirst and hunger is in 3_Game\PlayerConstants.c:

To my knowledge, that would require the file to be edited both on the server and the client, so each player would need to download this "mod". Perhaps you can do it server side only, but I haven't tested that.

EDIT: Just did a brief test and it seems to work perfectly fine to just edit this on the server side. So you can forget about my ramblings below... :)

/*

What you can do right now is to do an override in the mission file (the init.c on the server) by adding energy and water to each player for each server update. It's NOT a very efficient or good way of doing it, but based on 5 min. testing it works. It would go in the "class CustomMission: MissionServer" part of init.c and go something like this:

Here I add a small amount to the player's water and energy for each update. It has the unintended effect of increasing water and energy when the player is idle.

*/

i got it thanks.

Edited by BFG Barry

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×