Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
psychosis

Динамическая погода,смена времени суток

Recommended Posts

2 мини гайда в 1 теме. 
1 часть - установка смены времени суток


Смена времени суток  

 

1 .

-Файл   http://rghost.ru/58845268 - скачать.
-распаковать epoch.Altis.pbo
-core_time.fsm поместить в корень миссии. 

2.
в файле init.sqf (миссия)

добавить строчку(где либо ,естественно не в блоке сервера)допустим в самом низу :

 

[8,false,false] execFSM "core_time.fsm";

 


3.Сохранить изменения и упаковать .pbo обратно.

Расшифровка:

[Interval,Bool, Night Cycle] execFSM "core_time.fsm";
 

Interval - кол-во минут для пропуска
Bool- значение false для параметра skipTime, true для параметра SETDATE

Night Cycle- false, для более длинной ночи. true для быстрой смены ночи

 

С этими параметрами необходимо поиграть чтобы найти то нужное вам. тут представлены те параметры которые устраивают меня. За 4ч цикл работы сервера проходит день,длинная ночь,наступает день и рестарт. после которого выставляется день заново.. и так по кругу...
Тем кто хочет изучить всё более подробно - ссылка на первоисточник--->http://forums.bistudio.com/archive/index.php/t-137061.html

 

 

 

 

Динамическая погода.
2 часть - установка динамической смены погоды.
1. Распаковать epoch.Altis.pbo
2. Создаём в распакованной папке epoch.Altis папку с названием "любоевашеназвание"

3. Создаём в ней файл под названием weather.sqf
4. Открываем файл weather.sqf

5. Вставляем следующее :

/* DynamicWeatherEffects.sqf version 1.01 by Engima of Ostgota Ops

* Description:
* Script that generates dynamic (random) weather. Works in single player, multiplayer (hosted and dedicated), and is JIP compatible.
* Arguments:
* [_initialFog]: Optional. Fog when mission starts. Must be between 0 and 1 where 0 = no fog, 1 = maximum fog. -1 = random fog.
* [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 and 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast.
* [_initialRain]: Optional. Rain when mission starts. Must be between 0 and 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than or equal to 0.75).
* [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector and z is the other. x and z must be greater than or equal to 0. [-1, -1] = random wind.
* [_debug]: Optional. true if debug text is to be shown, otherwise false.
*/

private ["_initialFog", "_initialOvercast", "_initialRain", "_initialWind", "_debug"];
private ["_minWeatherChangeTimeMin", "_maxWeatherChangeTimeMin", "_minTimeBetweenWeatherChangesMin", "_maxTimeBetweenWeatherChangesMin", "_rainIntervalRainProbability", "_windChangeProbability"];
private ["_minimumFog", "_maximumFog", "_minimumOvercast", "_maximumOvercast", "_minimumRain", "_maximumRain", "_minimumWind", "_maximumWind", "_minRainIntervalTimeMin", "_maxRainIntervalTimeMin", "_forceRainToStopAfterOneRainInterval", "_maxWind"];
private ["_minimumFogDecay", "_maximumFogDecay", "_minimumFogBase", "_maximumFogBase"];

if (isNil "_this") then { _this = []; };
if (count _this > 0) then { _initialFog = _this select 0; } else { _initialFog = -1; };
if (count _this > 1) then { _initialOvercast = _this select 1; } else { _initialOvercast = -1; };
if (count _this > 2) then { _initialRain = _this select 2; } else { _initialRain = -1; };
if (count _this > 3) then { _initialWind = _this select 3; } else { _initialWind = [-1, -1]; };
if (count _this > 4) then { _debug = _this select 4; } else { _debug = false; };

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The following variables can be changed to tweak weather behaviour

// Minimum time in minutes for the weather (fog and overcast) to change. Must be greater than or equal to 1 and less than or equal to
// _maxWeatherChangeTimeMin. When weather changes, it is fog OR overcast that changes, not both at the same time. (Suggested value: 10).
_minWeatherChangeTimeMin = 30;

// Maximum time in minutes for the weather (fog and overcast) to change. Must be greater than or equal to _minWeatherChangeTimeMin.
// (Suggested value: 20).
_maxWeatherChangeTimeMin = 60;

// Minimum time in minutes that weather (fog and overcast) stays constant between weather changes. Must be less than or equal to 0 and
// greater than or equal to _minWeatherChangeTimeMin. (Suggested value: 5).
_minTimeBetweenWeatherChangesMin = 5;

// Maximum time in minutes that weather (fog and overcast) stays unchanged between weather changes. Must be greater than or equal to
// _minWeatherChangeTimeMin. (Suggested value: 10).
_maxTimeBetweenWeatherChangesMin = 10;

// Fog intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumFog
// (0 = no fog, 1 = pea soup). (Suggested value: 0).
_minimumFog = 0;

// Fog intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumFog
// (0 = no fog, 1 = pea soup). (Suggested value: 0.8).
_maximumFog = 0.15;

// New ArmA3 facilities added by Bewilderbeest
_minimumFogDecay = 0.001;
_maximumFogDecay = 0.001;
_minimumFogBase = 1000;
_maximumFogBase = 1000;

// Overcast intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumOvercast
// (0 = no overcast, 1 = maximum overcast). (Suggested value: 0).
_minimumOvercast = 0;

// Overcast intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumOvercast
// (0 = no overcast, 1 = maximum overcast). (Suggested value: 1).
_maximumOvercast = 1;

// When raining, rain intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumRain
// (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0);
_minimumRain = 0;

// When raining, rain intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumRain
// (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0.8);
_maximumRain = 0.5;

// Wind vector strength never falls below this value. Must be greater or equal to 0 and less than or equal to _maximumWind.
// (Suggested value: 0);
_minimumWind = 0;

// Wind vector strength never exceeds this value. Must be greater or equal to 0 and greater than or equal to _minimumWind.
// (Suggested value: 8).
_maximumWind = 8;

// Probability in percent for wind to change when weather changes. If set to 0 then wind will never change. If set to 100 then rain will
// change every time the weather (fog or overcast) start to change. (Suggested value: 25);
_windChangeProbability = 25;

// A "rain interval" is defined as "a time interval during which it may rain in any intensity (or it may not rain at all)". When overcast
// goes above 0.75, a chain of rain intervals (defined below) is started. It cycles on until overcast falls below 0.75. At overcast
// below 0.75 rain intervals never execute (thus it cannot rain).

// Probability in percent (0-100) for rain to start at every rain interval. Set this to 0 if you don't want rain at all. Set this to 100
// if you want it to rain constantly when overcast is greater than 0.75. In short: if you think that it generally rains to often then
// lower this value and vice versa. (Suggested value: 50).
_rainIntervalRainProbability = 20;

// Minimum time in minutes for rain intervals. Must be greater or equal to 0 and less than or equal to _maxRainIntervalTimeMin.
// (Suggested value: 0).
_minRainIntervalTimeMin = 1;

// Maximum time in minutes for rain intervals. Must be greater than or equal to _minRainIntervalTimeMin. (Suggested value:
// (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2).
_maxRainIntervalTimeMin = (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2;

// If set to true, then the rain is forced to stop after one rain interval during which it has rained (use this for example if you only want
// small occational cloudbursts ). If set to false, then the rain may stop, but it may also just change intensity for an
// immedeate new rain interval. (Suggested value: false).
_forceRainToStopAfterOneRainInterval = false;


///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Don't touch anything beneath this line

drn_DynamicWeather_DebugTextEventArgs = []; // Empty

"drn_DynamicWeather_DebugTextEventArgs" addPublicVariableEventHandler {
drn_DynamicWeather_DebugTextEventArgs call drn_fnc_DynamicWeather_ShowDebugTextLocal;
};

/*
* Summary: Shows debug text on local client.
* Arguments:
* _text: Debug text.
*/
drn_fnc_DynamicWeather_ShowDebugTextLocal = {
private ["_minutes", "_seconds"];

if (!isNull player) then {
player sideChat (_this select 0);
};

_minutes = floor (time / 60);
_seconds = floor (time - (_minutes * 60));
diag_log ((str _minutes + ":" + str _seconds) + " Debug: " + (_this select 0));
};

/*
* Summary: Shows debug text on all clients.
* Arguments:
* _text: Debug text.
*/
drn_fnc_DynamicWeather_ShowDebugTextAllClients = {
drn_DynamicWeather_DebugTextEventArgs = _this;
publicVariable "drn_DynamicWeather_DebugTextEventArgs";
drn_DynamicWeather_DebugTextEventArgs call drn_fnc_DynamicWeather_ShowDebugTextLocal;
};

if (_debug) then {
["Starting script WeatherEffects.sqf..."] call drn_fnc_DynamicWeather_ShowDebugTextLocal;
};

drn_DynamicWeatherEventArgs = []; // [current overcast, current fog, current rain, current weather change ("OVERCAST", "FOG" or ""), target weather value, time until weather completion (in seconds), current wind x, current wind z]
drn_AskServerDynamicWeatherEventArgs = []; // []

drn_fnc_overcastOdds =
{
if (_this < 1/3) then
{
0.1
}
else
{
(9/4) * (_this - (1/3)) ^ 2 + 0.1
}
};

drn_fnc_fogOdds =
{
if (_this < 1/3) then
{
0
}
else
{
(9/4) * (_this - (1/3)) ^ 2
}
};

drn_fnc_DynamicWeather_SetWeatherLocal = {
private ["_currentOvercast", "_currentFog", "_currentRain", "_currentWeatherChange", "_targetWeatherValue", "_timeUntilCompletion", "_currentWindX", "_currentWindZ"];

_currentOvercast = _this select 0;
_currentFog = _this select 1;
_currentRain = _this select 2;
_currentWeatherChange = _this select 3;
_targetWeatherValue = _this select 4;
_timeUntilCompletion = _this select 5;
_currentWindX = _this select 6;
_currentWindZ = _this select 7;

if (typeName _currentFog == "ARRAY") then {
_currentFog set [0, (_currentFog select 0) max (_currentRain / 4)];
}
else {
_currentFog = _currentFog max (_currentRain / 4);
};

// Set current weather values
if (date select 2 > 4 && date select 2 < 19) then
{
0 setOvercast _currentOvercast;
}
else
{
0 setOvercast (0.1 max _currentOvercast);
};
0 setFog [_currentFog max (_currentRain / 4), 0.001, 1000];
drn_var_DynamicWeather_Rain = _currentRain;
setWind [_currentWindX, _currentWindZ, true];

if (!isNil "drn_JIPWeatherSync") then
{
sleep 0.5;
skipTime 1;
sleep 0.5;
skipTime -1;
drn_JIPWeatherSync = nil;
};

// Set forecast
if (_currentWeatherChange == "OVERCAST") then {
if (date select 2 > 4 && date select 2 < 18) then
{
_timeUntilCompletion setOvercast (_targetWeatherValue call drn_fnc_overcastOdds);
}
else
{
_timeUntilCompletion setOvercast (0.1 max (_targetWeatherValue call drn_fnc_overcastOdds));
};
5 setFog [_currentRain / 4, 0.001, 1000]; // Quick hack to ensure fog goes away regularly
_currentFog
};
if (_currentWeatherChange == "FOG") then {
if (typeName _targetWeatherValue == "ARRAY") then {
_targetWeatherValue set [0, (_targetWeatherValue select 0) max (_currentRain / 4)];
}
else {
_targetWeatherValue = _targetWeatherValue max (_currentRain / 4);
};
_timeUntilCompletion setFog _targetWeatherValue;
};
};

if (!isDedicated) then
{
drn_JIPWeatherSync = true;
};

if (!isServer) then {
"drn_DynamicWeatherEventArgs" addPublicVariableEventHandler {
drn_DynamicWeatherEventArgs spawn drn_fnc_DynamicWeather_SetWeatherLocal;
};

waitUntil {!isNil "drn_var_DynamicWeather_ServerInitialized"};

drn_AskServerDynamicWeatherEventArgs = [true];
publicVariable "drn_AskServerDynamicWeatherEventArgs";
};

if (isServer) then {
drn_fnc_DynamicWeather_SetWeatherAllClients = {
private ["_timeUntilCompletion", "_currentWeatherChange"];

_timeUntilCompletion = drn_DynamicWeather_WeatherChangeCompletedTime - drn_DynamicWeather_WeatherChangeStartedTime;
if (_timeUntilCompletion > 0) then {
_currentWeatherChange = drn_DynamicWeather_CurrentWeatherChange;
}
else {
_currentWeatherChange = "";
};

drn_DynamicWeatherEventArgs = [overcast, fog, drn_var_DynamicWeather_Rain, _currentWeatherChange, drn_DynamicWeather_WeatherTargetValue, _timeUntilCompletion, drn_DynamicWeather_WindX, drn_DynamicWeather_WindZ];
publicVariable "drn_DynamicWeatherEventArgs";
drn_DynamicWeatherEventArgs spawn drn_fnc_DynamicWeather_SetWeatherLocal;
};

"drn_AskServerDynamicWeatherEventArgs" addPublicVariableEventHandler {
[] spawn drn_fnc_DynamicWeather_SetWeatherAllClients;
};

drn_DynamicWeather_CurrentWeatherChange = "";
drn_DynamicWeather_WeatherTargetValue = 0;
drn_DynamicWeather_WeatherChangeStartedTime = time;
drn_DynamicWeather_WeatherChangeCompletedTime = time;
drn_DynamicWeather_WindX = _initialWind select 0;
drn_DynamicWeather_WindZ = _initialWind select 1;

if (_initialFog == -1) then {
_initialFog = (_minimumFog + random (_maximumFog - _minimumFog));
}
else {
if (_initialFog < _minimumFog) then {
_initialFog = _minimumFog;
};
if (_initialFog > _maximumFog) then {
_initialFog = _maximumFog;
};
};

0 setFog [(((_initialFog / _maximumFog) call drn_fnc_fogOdds) * _maximumFog) max (rain / 4), 0.001, 1000];

if (_initialOvercast == -1) then {
_initialOvercast = (_minimumOvercast + random (_maximumOvercast - _minimumOvercast));
}
else {
if (_initialOvercast < _minimumOvercast) then {
_initialOvercast = _minimumOvercast;
};
if (_initialOvercast > _maximumOvercast) then {
_initialOvercast = _maximumOvercast;
};
};

0 setOvercast (_initialOvercast call drn_fnc_overcastOdds);

if (_initialOvercast >= 0.75) then {
if (_initialRain == -1) then {
_initialRain = (_minimumRain + random (_minimumRain - _minimumRain));
}
else {
if (_initialRain < _minimumRain) then {
_initialRain = _minimumRain;
};
if (_initialRain > _maximumRain) then {
_initialRain = _maximumRain;
};
};
}
else {
_initialRain = 0;
};

drn_var_DynamicWeather_Rain = _initialRain;
0 setRain drn_var_DynamicWeather_Rain;
0 setFog [drn_var_DynamicWeather_Rain / 4, 0.001, 1000];


_maxWind = _minimumWind + random (_maximumWind - _minimumWind);

if (drn_DynamicWeather_WindX == -1) then {
if (random 100 < 50) then {
drn_DynamicWeather_WindX = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindX = _minimumWind + random (_maxWind - _minimumWind);
};
};

if (drn_DynamicWeather_WindZ == -1) then {
if (random 100 < 50) then {
drn_DynamicWeather_WindZ = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindZ = _minimumWind + random (_maxWind - _minimumWind);
};
};

setWind [drn_DynamicWeather_WindX, drn_DynamicWeather_WindZ, true];

if (!isNil "drn_JIPWeatherSync") then
{
sleep 0.5;
skipTime 1;
sleep 0.5;
skipTime -1;
drn_JIPWeatherSync = nil;
};

sleep 0.05;

publicVariable "drn_var_DynamicWeather_Rain";
drn_var_DynamicWeather_ServerInitialized = true;
publicVariable "drn_var_DynamicWeather_ServerInitialized";

// Start weather thread
[_minWeatherChangeTimeMin, _maxWeatherChangeTimeMin, _minTimeBetweenWeatherChangesMin, _maxTimeBetweenWeatherChangesMin, _minimumFog, _maximumFog, _minimumFogDecay, _maximumFogDecay, _minimumFogBase, _maximumFogBase, _minimumOvercast, _maximumOvercast, _minimumWind, _maximumWind, _windChangeProbability, _debug] spawn {
private ["_minWeatherChangeTimeMin", "_maxWeatherChangeTimeMin", "_minTimeBetweenWeatherChangesMin", "_maxTimeBetweenWeatherChangesMin", "_minimumFog", "_maximumFog", "_minimumOvercast", "_maximumOvercast", "_minimumWind", "_maximumWind", "_windChangeProbability", "_debug"];
private ["_weatherType", "_fogLevel", "_overcastLevel", "_oldFogLevel", "_oldOvercastLevel", "_weatherChangeTimeSek"];
private ["_fogValue", "_fogBase", "_fogDecay"];
_minWeatherChangeTimeMin = _this select 0;
_maxWeatherChangeTimeMin = _this select 1;
_minTimeBetweenWeatherChangesMin = _this select 2;
_maxTimeBetweenWeatherChangesMin = _this select 3;
_minimumFog = _this select 4;
_maximumFog = _this select 5;
_minimumFogDecay = _this select 6;
_maximumFogDecay = _this select 7;
_minimumFogBase = _this select 8;
_maximumFogBase = _this select 9;
_minimumOvercast = _this select 10;
_maximumOvercast = _this select 11;
_minimumWind = _this select 12;
_maximumWind = _this select 13;
_windChangeProbability = _this select 14;
_debug = _this select 15;

// Set initial fog level
_fogLevel = 2;
_overcastLevel = 2;

while {true} do {
// Sleep a while until next weather change
sleep floor (_minTimeBetweenWeatherChangesMin * 60 + random ((_maxTimeBetweenWeatherChangesMin - _minTimeBetweenWeatherChangesMin) * 60));

if (_minimumFog == _maximumFog && _minimumOvercast != _maximumOvercast) then {
_weatherType = "OVERCAST";
};
if (_minimumFog != _maximumFog && _minimumOvercast == _maximumOvercast) then {
_weatherType = "FOG";
};
if (_minimumFog != _maximumFog && _minimumOvercast != _maximumOvercast) then {

// Select type of weather to change
if ((random 100) < 50) then {
_weatherType = "OVERCAST";
}
else {
_weatherType = "FOG";
};
};

// DEBUG
//_weatherType = "OVERCAST";

if (_weatherType == "FOG") then {

drn_DynamicWeather_CurrentWeatherChange = "FOG";

// Select a new fog level
_oldFogLevel = _fogLevel;
_fogLevel = floor ((random 100) / 25);

while {_fogLevel == _oldFogLevel} do {
_fogLevel = floor ((random 100) / 25);
};

_fogDecay = _minimumFogDecay + (_maximumFogDecay - _minimumFogDecay) * random 1;
_fogBase = _minimumFogBase + (_maximumFogBase - _minimumFogBase) * random 1;
_fogValue = 0;

if (_fogLevel == 0) then {
_fogValue = _minimumFog + (_maximumFog - _minimumFog) * random 0.05;
};
if (_fogLevel == 1) then {
_fogValue = _minimumFog + (_maximumFog - _minimumFog) * (0.05 + random 0.2);
};
if (_fogLevel == 2) then {
_fogValue = _minimumFog + (_maximumFog - _minimumFog) * (0.25 + random 0.3);
};
if (_fogLevel == 3) then {
_fogValue = _minimumFog + (_maximumFog - _minimumFog) * (0.55 + random 0.45);
};

drn_DynamicWeather_WeatherTargetValue = [((_fogValue / _maximumFog) call drn_fnc_fogOdds) * _maximumFog, _fogDecay, _fogBase];

drn_DynamicWeather_WeatherChangeStartedTime = time;
_weatherChangeTimeSek = _minWeatherChangeTimeMin * 60 + random ((_maxWeatherChangeTimeMin - _minWeatherChangeTimeMin) * 60);
drn_DynamicWeather_WeatherChangeCompletedTime = time + _weatherChangeTimeSek;

if (_debug) then {
["Weather forecast: Fog " + str drn_DynamicWeather_WeatherTargetValue + " in " + str round (_weatherChangeTimeSek / 60) + " minutes."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};

if (_weatherType == "OVERCAST") then {

drn_DynamicWeather_CurrentWeatherChange = "OVERCAST";

// Select a new overcast level
_oldOvercastLevel = _overcastLevel;
//_overcastLevel = floor ((random 100) / 25);
_overcastLevel = 3;

while {_overcastLevel == _oldOvercastLevel} do {
_overcastLevel = floor ((random 100) / 25);
};

if (_overcastLevel == 0) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * random 0.05;
};
if (_overcastLevel == 1) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * (0.05 + random 0.3);
};
if (_overcastLevel == 2) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * (0.35 + random 0.35);
};
if (_overcastLevel == 3) then {
drn_DynamicWeather_WeatherTargetValue = _minimumOvercast + (_maximumOvercast - _minimumOvercast) * (0.7 + random 0.3);
};

// DEBUG
/*
if (overcast > 0.8) then {
drn_DynamicWeather_WeatherTargetValue = 0.5;
}
else {
drn_DynamicWeather_WeatherTargetValue = 0.85;
};
*/

drn_DynamicWeather_WeatherChangeStartedTime = time;
_weatherChangeTimeSek = _minWeatherChangeTimeMin * 60 + random ((_maxWeatherChangeTimeMin - _minWeatherChangeTimeMin) * 60);
drn_DynamicWeather_WeatherChangeCompletedTime = time + _weatherChangeTimeSek;

if (_debug) then {
["Weather forecast: Overcast " + str drn_DynamicWeather_WeatherTargetValue + " in " + str round (_weatherChangeTimeSek / 60) + " minutes."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};

// On average every one fourth of weather changes, change wind too
if (random 100 < _windChangeProbability) then {
private ["_maxWind"];

_maxWind = _minimumWind + random (_maximumWind - _minimumWind);

if (random 100 < 50) then {
drn_DynamicWeather_WindX = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindX = _minimumWind + random (_maxWind - _minimumWind);
};
if (random 100 < 50) then {
drn_DynamicWeather_WindZ = -_minimumWind - random (_maxWind - _minimumWind);
}
else {
drn_DynamicWeather_WindZ = _minimumWind + random (_maxWind - _minimumWind);
};

if (_debug) then {
["Wind changes: [" + str drn_DynamicWeather_WindX + ", " + str drn_DynamicWeather_WindZ + "]."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};

call drn_fnc_DynamicWeather_SetWeatherAllClients;

sleep _weatherChangeTimeSek;
};
};

// Start rain thread
if (_rainIntervalRainProbability > 0) then {
[_minimumRain, _maximumRain, _forceRainToStopAfterOneRainInterval, _minRainIntervalTimeMin, _maxRainIntervalTimeMin, _rainIntervalRainProbability, _debug] spawn {
private ["_minimumRain", "_maximumRain", "_forceRainToStopAfterOneRainInterval", "_minRainIntervalTimeMin", "_maxRainIntervalTimeMin", "_rainIntervalRainProbability", "_debug"];
private ["_nextRainEventTime", "_forceStop"];

_minimumRain = _this select 0;
_maximumRain = _this select 1;
_forceRainToStopAfterOneRainInterval = _this select 2;
_minRainIntervalTimeMin = _this select 3;
_maxRainIntervalTimeMin = _this select 4;
_rainIntervalRainProbability = _this select 5;
_debug = _this select 6;

if (rain > 0) then {
drn_var_DynamicWeather_Rain = rain;
publicVariable "drn_var_DynamicWeather_Rain";
};

_nextRainEventTime = time;
_forceStop = false;

while {true} do {

if (overcast > 0.75) then {

if (time >= _nextRainEventTime) then {
private ["_rainTimeSec"];

// At every rain event time, start or stop rain with 50% probability
if (random 100 < _rainIntervalRainProbability && !_forceStop) then {
drn_var_DynamicWeather_rain = _minimumRain + random (_maximumRain - _minimumRain);
publicVariable "drn_var_DynamicWeather_rain";

_forceStop = _forceRainToStopAfterOneRainInterval;
}
else {
drn_var_DynamicWeather_rain = 0;
publicVariable "drn_var_DynamicWeather_rain";

_forceStop = false;
};

// Pick a time for next rain change
_rainTimeSec = _minRainIntervalTimeMin * 60 + random ((_maxRainIntervalTimeMin - _minRainIntervalTimeMin) * 60);
_nextRainEventTime = time + _rainTimeSec;

if (_debug) then {
["Rain set to " + str drn_var_DynamicWeather_rain + " for " + str (_rainTimeSec / 60) + " minutes"] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};
}
else {
if (drn_var_DynamicWeather_rain != 0) then {
drn_var_DynamicWeather_rain = 0;
publicVariable "drn_var_DynamicWeather_rain";

if (_debug) then {
["Rain stops due to low overcast."] call drn_fnc_DynamicWeather_ShowDebugTextAllClients;
};
};

_nextRainEventTime = time;
_forceStop = false;
};

if (_debug) then {
sleep 1;
}
else {
sleep 20;
};
};
};
};
};

[_rainIntervalRainProbability, _debug] spawn {
private ["_rainIntervalRainProbability", "_debug"];
private ["_rain", "_rainPerSecond"];

_rainIntervalRainProbability = _this select 0;
_debug = _this select 1;

if (_debug) then {
_rainPerSecond = 0.2;
}
else {
_rainPerSecond = 0.03;
};

if (_rainIntervalRainProbability > 0) then {
_rain = drn_var_DynamicWeather_Rain;
}
else {
_rain = 0;
};

0 setRain _rain;
0 setFog [fog max (_rain / 4), 0.001, 1000];
sleep 0.1;

while {true} do {
if (_rainIntervalRainProbability > 0) then {
if (_rain < drn_var_DynamicWeather_Rain) then {
_rain = _rain + _rainPerSecond;
if (_rain > 1) then { _rain = 1; };
};
if (_rain > drn_var_DynamicWeather_Rain) then {
_rain = _rain - _rainPerSecond;
if (_rain < 0) then { _rain = 0; };
};
}
else {
_rain = 0;
};

3 setRain _rain;
3 setFog [fog max (_rain / 4), 0.001, 1000];

sleep 10;
};
};

 

 

 

6. Открываем файл Init.sqf

вставляем где либо не нарушая целостности других блоков:

//погода
[] execVM "scripts\weather.sqf"; 
 

 

 

сохранить измения.
7.Перепаковать файл epoch.Altis.pbo    ...всё...

 

Edited by psychosis (see edit history)

Share this post


Link to post
Share on other sites



 

Всё подключается отдельно . 

 

Смена времени суток  

http://rghost.ru/58845268 - скачать

закинуть в папку миссии. 

 

в файле init.sqf (миссия)

 

добавить строчку :

 

[8,false,false] execFSM "core_time.fsm";
 

Динамическая погода

 

В ранее созданную папку scripts закинуть файл http://rghost.ru/58845338   (либо создать таковую,либо любую другую )

опять же в файле init.sqf вставить строчку :

 

//погода
[] execVM "scripts\weather.sqf"; 
 

сохранить.

Перепаковать файл .pbo    ...всё...

 

 

Добавь оформления и описание сделай толковое, непонятно что за скрипт!

Share this post


Link to post
Share on other sites

Скрипт динамической погоды поставил.

Со сменой дня и ночи, сложнее. На другом форуме, мне сообщили, что за смену времени отвечает файл "epochconfig.hpp" в папке "@EpochHive".

Посмотрел его. В нём есть строки, которые, как я думаю, как раз и отвечают за время:

 

// Time based
StaticDateTime[] = {2035,6,10,7,0}; // {0,0,0,8,0} would forces the server to start at 8am each time it is started while allowing the year, month and day to stay real time. Any values left at 0 will result in no change.
timeDifference = 0; // Server uses real time this will allow you to offset just the hour.
timeMultiplier = 4; // Sets a time multiplier for in-game time. The command range is now capped at 0.1 - 120 to avoid performance problems.

 

Что именно нужно поправить, чтобы запустить на сервере такую конфигурацию: Перезагрузка через каждые 6 часов. Начинается день по внутреннему времени в 7 утра и через 4,5 часа реального времени начинает темнеть, т. е. на ночь остаётся 1,5 часа реального времени (вместе с сумерками)

Edited by Den (see edit history)

Share this post


Link to post
Share on other sites

народ подскажите, локальное время на сервере в А3 возможно?

Share this post


Link to post
Share on other sites

народ подскажите, локальное время на сервере в А3 возможно?

Возможно. В C:\ARMA3\@epochhive ищи epochconfig.hpp

И верти эти строки, как угодно...

 

// Time based
StaticDateTime[] = {2035,6,10,7,0}; // {0,0,0,8,0} would forces the server to start at 8am each time it is started while allowing the year, month and day to stay real time. Any values left at 0 will result in no change. (Короче так. Изначально стоит год,день,месяц (именно в такой последовательности, америкосы), час и прочая хрень. Ставишь 0,0,0,8,0 - ставишь сервер на текушие время (8 утра) и дату.).
timeDifference = 0; // Server uses real time this will allow you to offset just the hour. (0 - нифига, 1 - сервер использует текущую дату).
timeMultiplier = 4; // Sets a time multiplier for in-game time. The command range is now capped at 0.1 - 120 to avoid performance problems. (хрен знает, что это значит, вроде время в игре устанавливает).
lootMultiplier = 0.5; // 1 = max loot bias. This controls how much loot can payout per Epoch loot container. (это отвечает за контейнер Эпоча (сколько в диване и шифоньере  найти можно, короче), судя по всему - % наполненности...)
Edited by Pillygrim (see edit history)

Share this post


Link to post
Share on other sites

 

timeMultiplier = 4; // Sets a time multiplier for in-game time. The command range is now capped at 0.1 - 120 to avoid performance problems. (хрен знает, что это значит, вроде время в игре устанавливает).

  скорость течения времени эт ) , с этими настройками я игрался... ниче не помогает....

Share this post


Link to post
Share on other sites

Как сделать реальное течение времени?

Включил сервер и там уже время тоже что и на компе.

Share this post


Link to post
Share on other sites

Как сделать реальное течение времени?

Включил сервер и там уже время тоже что и на компе.

Поставить в HiveExt в локальное время. Type = local

Share this post


Link to post
Share on other sites

Поставить в HiveExt в локальное время. Type = local

В арме 3 подобного нету

Share this post


Link to post
Share on other sites

Парни всем привет. Залейте еще раз этот мод. У кого есть, буду благодарен.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By blackredghost
      Здравствуйте! Пытаюсь запустить сервер в Arma 3. Файлы миссии достались мне от разраба, который сейчас в очень тяжелом материальном положении.
      Я плохо понимаю в Arma 3. Я БУДУ ОЧЕНЬ БЛАГОДАРЕН, если поможете мне разобраться как починить эту хрень. ДАЖЕ ДЕНЕГ ЗАПЛАЧУ!
      Вот
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
    • By MrMiBl
      Всем привет! С наступающим!  
      Проблема такая: безсознанка очень долгая (от двух минут и больше от рандомной пульки...)
      Собственно вопрос: как её отключить либо сократить время?  
      покопавшись в файлах нашел такую тему: fn_unconscious.sqf
      // (c) facoptere@gmail.com, licensed to DayZMod for the community private ["_count","_anim","_weapon","_sprint","_stance","_transmove","_start","_timeout","_short","_sandLevel","_speed"]; if (r_player_unconsciousInProgress) exitWith {}; r_player_unconsciousInProgress = true; r_player_unconsciousInputDisabled = true; //this is like this in order to release the current user input disableUserInput true; disableUserInput true; disableUserInput false; disableUserInput false; disableUserInput true; disableUserInput true; _start = diag_tickTime; _timeout = abs r_player_timeout; _short = _timeout < 4; if (!_short) then { 4 cutRsc ["playerStatusWaiting", "PLAIN",1]; playSound "heartbeat_1"; }; _count = 0; // can be set to false by medEPI.sqf, during the 'while' loop r_player_unconscious = true; player setVariable ["NORRN_unconscious", r_player_unconscious, true]; _sandLevel = ctrlPosition ((uiNamespace getVariable 'DAYZ_GUI_waiting') displayCtrl 1400); //diag_log [(diag_tickTime - _start) < _timeout , !r_player_unconscious , alive player ]; dayz_autoRun = false; if (player == vehicle player) then { player playAction "CanNotMove"; }; "dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [2]; "dynamicBlur" ppEffectCommit 0; "colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0; if (dayz_soundMuted) then {call player_toggleSoundMute;}; // hide icon before fadeSound 0 fadeSound 0.05; while { (diag_tickTime - _start) < _timeout and r_player_unconscious and alive player } do { player setVariable ["unconsciousTime", _timeout - diag_tickTime + _start, (_count % 10) == 0]; if (!_short) then { _sandLevel set [ 3, 0.136829 * safezoneH * (diag_tickTime - _start) / _timeout ]; ((uiNamespace getVariable 'DAYZ_GUI_waiting') displayCtrl 1400) ctrlSetPosition _sandLevel; ((uiNamespace getVariable 'DAYZ_GUI_waiting') displayCtrl 1400) ctrlCommit 0.05; }; /*_veh = vehicle player; if ((player != _veh) and {(_veh iskindOf "LandVehicle")}) then { _speed = [0,0,0] distance velocity _veh; if (_speed > 10) then { _veh engineOn false; } else { player action ["eject", _veh]; player leaveVehicle _veh; [] spawn { uiSleep 0.1; player playMoveNow "amovppnemstpsnonwnondnon"; }; // instant prone }; }; if (player == _veh) then { player setVelocity [0,0,0]; }; */ uiSleep 0.1; _count = _count + 1; }; if (!_short) then{ 4 cutRsc ["default", "PLAIN",0]; }; r_player_unconscious = false; player setVariable ["NORRN_unconscious", r_player_unconscious, true]; r_player_timeout = 0; player setVariable ["unconsciousTime", r_player_timeout, true]; r_player_cardiac = false; player setVariable ["USEC_isCardiac",r_player_cardiac, true]; r_player_unconsciousInProgress = false; 4 cutRsc ["default", "PLAIN",1]; if (player == vehicle player) then { // "AinjPpneMstpSnonWnonDnon" rolls from back first (jarring transition if player was knocked out prone or fell to stomach) [nil, player, rSWITCHMOVE, "AmovPpneMstpSnonWnonDnon_healed"] call RE; player SWITCHMOVE "AmovPpneMstpSnonWnonDnon_healed"; PVDZ_plr_SwitchMove = [player,"AmovPpneMstpSnonWnonDnon_healed"]; publicVariableServer "PVDZ_plr_SwitchMove"; //Needed to execute switchMove on server machine. rSwitchMove only executes on other clients player playMoveNow "AmovPpneMstpSnonWnonDnon_healed"; }; 10 fadeSound 1; "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; if ({getNumber (configFile >> "CfgWeapons" >> _x >> "type") in [1,2]} count (weapons player) > 0) then { //Prevent firing while weapon is still shown on back or holstered. AmovPpneMstpSnonWnonDnon_healed has disableWeapons=0 in config (should be 1) waitUntil {uiSleep 1; !(animationState player in ["ainjppnemstpsnonwnondnon_rolltofront","amovppnemstpsnonwnondnon_healed","amovppnemstpsnonwnondnon"])}; }; //once more to be safe disableUserInput false; disableUserInput false; disableUserInput true; disableUserInput true; disableUserInput false; disableUserInput false; r_player_unconsciousInputDisabled = false; //diag_log [ __FILE__, diag_tickTime, "done" ]; Копать тут или где-то в другом месте?
    • By DrTauren
      DZAI создана простой, легко настраиваемой, лёгкой в установке системой. Она создана для работы с любыми DayZ-модами и картами.

      Особенности системы:
      Статичный спавн ботов - в городах, деревнях, на военных базах Динамический спавн ботов - спавнятся рандомно по всей карте. Могут появиться где угодно и когда угодно Патрули на воздушной технике - патрули также появляются рандомно. Пешие игроки имеют маленький шанс быть обнаруженными, но игрокам на какой-либо технике повезло гораздо меньше  Сухопутные патрули на технике - появляются так же рандомно, курсируют по дорогам между городами и деревнями Собственноручно настраиваемые патрули - спавните ботов и различные патрули в нужных вам местах. Например на ваших кастомных военных базах Боты используют только лутабельное оружие - вы можете подобрать любое оружие с убитого бота без каких-либо проблем, т.к. их лут генерируется с учётоб таблиц лута вашего мода. Чем реже лут у бота, тем он опасней (автор имеет ввиду скилл бота) Система жизней - боты имеют столько же жизней, как игрок. Точно так же могут упасть без сознания. Так что лучше стрелять по головам  
       
      Установка:
      1) Качаем архив: 
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
      2) Распаковываем наш dayz_server.pbo, затем открываем файл server_monitor.sqf
      3) Находим строку:
      allowConnection = true; и добавляем над ней эту:
      [] call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZAI\init\dzai_initserver.sqf"; 4) Копируем папку DZAI из скаченного архива в корень нашего dayz_server
      5) Настроить работу системы под себя вы можете в этом файле: DZAI\init\dzai_config.sqf
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.