Always day and Item condition

danowner

New Member
Member
Sep 11, 2014
7
0
1
Simple 2 questions that I am incapeble of knowing at the moment... How do I make it always day, and also how do I turn off item condition? (weapons don't break)?

Cheers guys
 
*Always day;
I know Rust++ has Freeze_Time setting but i think its broken. (@mikec will know)
*item condition;
Go to Root/Server_data and open server.cfg.
and paste this into it.
Code:
conditionloss.damagemultiplier 0 
conditionloss.armorhealthmult 0
0 = off, 1 = default. 0.5 = half, etc.
 
*Always day;
I know Rust++ has Freeze_Time setting but i think its broken. (@mikec will know)
*item condition;
Go to Root/Server_data and open server.cfg.
and paste this into it.
Code:
conditionloss.damagemultiplier 0
conditionloss.armorhealthmult 0
0 = off, 1 = default. 0.5 = half, etc.

Yup it's broken: http://fougerite.com/threads/fougerite-mc.148/page-3#post-1630

@ OP

There are a bunch of built in commands to give some of the most requested features, that's why I laugh when people use plugins to accomplish them. Here is a list of all server variables you can add to your server.cfg

http://playrustwiki.com/wiki/Server_Commands
 
Last edited:
Its possible to set to noon every 1 min by using timers.
JavaScript:
function DayTimeCallback(){
    World.Time = 12; //Set time to 12 (Noon)
}

function On_PluginInit() {
    Plugin.CreateTimer("DayTime", 1000).Start(); //10,000 = About 1 min.
}
That's ms... 1000 = 1sec, 60000 =1min
 
Could the dangerous "while" be used? (Dangerous for me :D)
JavaScript:
function On_PluginInit() {
try{
      while(World.Time != 12){
           World.Time = 12;
      }
}catch(err){Plugin.Log("Error", "Something Broke! --> " + err.message);}
}
I always use try now, learned my lesson. :D
 
Could the dangerous "while" be used? (Dangerous for me :D)
JavaScript:
function On_PluginInit() {
try{
      while(World.Time != 12){
           World.Time = 12;
      }
}catch(err){Plugin.Log("Error", "Something Broke! --> " + err.message);}
}
I always use try now, learned my lesson. :D
Don't do it !

Never ever use a wile loop when you arn't sure that it will stop or have a delay in it

Here I'm not sure of what it will do, two options :
- Run once and then go out of the wile loop not resetting the time anymore
- Keep running again and again cause the time have the time to update just after you set it and before it checks, this will lag your server

You should use a timer ;)
 
Don't do it !

Never ever use a wile loop when you arn't sure that it will stop or have a delay in it

Here I'm not sure of what it will do, two options :
- Run once and then go out of the wile loop not resetting the time anymore
- Keep running again and again cause the time have the time to update just after you set it and before it checks, this will lag your server

You should use a timer ;)

Why would you use a while for that ? I would do :



C#:
World w = World.GetWorld();
w.DayLength = float.MaxValue;
w.Time = 12;

Translated to js :


JavaScript:
World.DayLength = Number.MAX_VALUE;
World.Time = 12;

JavaScript:
function On_PluginInit(){
     Plugin.CreateTimer("Time", 60000).Start();
}

function TimeCallback(){
     Plugin.KillTimer("Time");
     World.DayLength = Number.MAX_VALUE;
     World.Time = 12;
     Plugin.CreateTimer("Time", 60000).Start();
}

This way the sun shouldn't even move. Correct me if I wrote something wrong.
 
  • Winner
Reactions: mikec
env.timescale "amount"Sets the passage of time (day/night cycle) to a certain speed, default is "0.0066666667".

You should be able to make the daytime clock practically stop (a Rust day lasts years) by tweaking this value.

I've already added code to Fougerite to set server globals to disable decay. There are six variables involved with decay, but Fougerite combines them into one setting, on or off.

The same could be done for controlling time in Rust. I'll put it on the enhancements list.