Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
BigFNFal

Ускоренное игровое время

Хочу сделать на своём сервере ускоренное время, рестарт сервера у меня каждые 4 часа, так вот чтобы за эти 4 часа на сервере смогла бы быть ночь, хотя бы час. Как сдвинуть часовой пояс я знаю, а вот с этим не могу разобраться.

Edited by azstudio (see edit history)

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

 

 

/*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Fast Time and Jip">*/
/*%FSM<HEAD>*/
/*
item0[] = {"init",0,4346,-314.336365,-163.310043,-224.336319,-113.310059,0.000000,"init"};
item1[] = {"true",8,218,-143.406555,-163.663147,-53.406559,-113.663094,0.000000,"true"};
item2[] = {"waiting",2,250,-142.815994,174.977570,-52.815941,224.977585,0.000000,"waiting"};
item3[] = {"isServer",4,218,-320.040527,236.820862,-230.040604,286.820831,0.000000,"isServer"};
item4[] = {"isClient",4,218,22.549866,229.806961,112.549881,279.806946,0.000000,"isClient"};
item5[] = {"Sync_fast_time",2,250,-320.040588,361.884491,-230.040543,411.884491,0.000000,"Sync" \n "fast time"};
item6[] = {"Skip_time",2,250,22.673546,365.358307,112.673569,415.358307,0.000000,"Skip time"};
item7[] = {"true",8,218,-136.552094,482.154419,-46.552185,532.154358,0.000000,"true"};
item8[] = {"isClient_Sync",4,218,-142.562988,264.541229,-52.563095,314.541290,0.000000,"isClient" \n "Sync"};
item9[] = {"",7,210,-363.575775,503.336090,-355.575775,511.336121,0.000000,""};
item10[] = {"",7,210,-363.654907,196.631699,-355.654907,204.631683,0.000000,""};
item11[] = {"Sync_Client_with",2,250,-140.745895,361.651337,-50.745857,411.651398,0.000000,"Sync Client" \n "with server"};
item12[] = {"isServer",4,218,-310.435089,-53.185947,-220.435059,-3.185909,0.000000,"isServer"};
item13[] = {"isClient",4,218,18.135239,-53.273216,108.135193,-3.273283,1.000000,"isClient"};
item14[] = {"Set_Jip_Var",2,250,-311.382965,62.044098,-221.382874,112.044113,0.000000,"Set Jip Var"};
item15[] = {"Sync",2,250,18.089794,61.131149,108.089844,111.131157,0.000000,"Sync"};
item16[] = {"true",8,218,-142.563049,62.134674,-52.563004,112.134666,0.000000,"true"};
item17[] = {"Lets_split",2,250,-142.562988,-53.137280,-52.563026,-3.137243,0.000000,"Lets split"};
link0[] = {0,1};
link1[] = {1,17};
link2[] = {2,3};
link3[] = {2,4};
link4[] = {2,8};
link5[] = {3,5};
link6[] = {4,6};
link7[] = {5,7};
link8[] = {6,7};
link9[] = {7,9};
link10[] = {8,11};
link11[] = {9,10};
link12[] = {10,2};
link13[] = {11,7};
link14[] = {12,14};
link15[] = {13,15};
link16[] = {14,16};
link17[] = {15,16};
link18[] = {16,2};
link19[] = {17,12};
link20[] = {17,13};
globals[] = {0.000000,0,0,0,0,640,480,1,34,6316128,1,-451.561707,471.547577,-112.201111,-884.858887,724,606,1};
window[] = {0,-1,-1,-32000,-32000,850,522,1904,99,1,742};
*//*%FSM</HEAD>*/
class FSM
{
fsmName = "Fast Time and Jip";
class States
{
/*%FSM<STATE "init">*/
class init
{
name = "init";
init = /*%FSM<STATEINIT""">*/"private[""_safety"",""_lastjipupdate"",""_lastupdate"",""_lastsync"",""_skipValue"",""_skipTime"",""_method"",""_i"",""_night"",""_nightValue"",""_nightSkip"",""_num"",""_skipv""];" \n
"_lastjipupdate = time;" \n
"_lastupdate = time;" \n
"_lastsync = time;" \n
"" \n
"_skipValue = _this select 0;" \n
"_method = _this select 1;" \n
"_night = _this select 2;" \n
"" \n
"if(_night) then" \n
"{" \n
"    if(count _this > 3) then" \n
"    {" \n
"        _nightValue = _this select 3;" \n
"    }" \n
"    else" \n
"    {" \n
"        _nightValue = (_skipValue)*2;" \n
"    };" \n
"" \n
"    _nightSkip = (_nightValue)/60;" \n
"};" \n
"" \n
"_skipTime =(_skipValue)/60;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="Lets_split";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "waiting">*/
class waiting
{
name = "waiting";
init = /*%FSM<STATEINIT""">*/"//Safety check for lower end systems" \n
"_fps = round(diag_fps);" \n
"if(_fps < 35) then {_safety = true;} else {_safety = false};" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "isClient">*/
class isClient
{
priority = 0.000000;
to="Skip_time";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((time - _lastupdate) > 60) AND !isDedicated AND !isServer"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "isClient_Sync">*/
class isClient_Sync
{
priority = 0.000000;
to="Sync_Client_with";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((time - _lastsync) > 600) AND !isDedicated"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "isServer">*/
class isServer
{
priority = 0.000000;
to="Sync_fast_time";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((time - _lastjipupdate) > 60) AND isServer"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Sync_fast_time">*/
class Sync_fast_time
{
name = "Sync_fast_time";
init = /*%FSM<STATEINIT""">*/"skipTime _skipTime;" \n
"" \n
"_lastjipupdate = time;" \n
"" \n
"JipTimeNow = date;" \n
"publicVariable ""JipTimeNow"";"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Skip_time">*/
class Skip_time
{
name = "Skip_time";
init = /*%FSM<STATEINIT""">*/"//Safety Check for low-end CPU's" \n
"if(_night) then {" \n
"    if(SunOrMoon == 0) then" \n
"    {" \n
"        _num = _nightValue;" \n
"        _skipv = _nightSkip;" \n
"    }" \n
"    else" \n
"    {" \n
"        _num = _skipValue;" \n
"        _skipv = _skipTime;" \n
"    };" \n
"}" \n
"else" \n
"{" \n
"    _num = _skipValue;" \n
"    _skipv = _skipTime;" \n
"};" \n
"" \n
"if(_safety) then {" \n
"if(_method) then {_i = date select 4;};" \n
"" \n
"for ""_x"" from 1 to _num do" \n
"{" \n
"    if(_method) then" \n
"    {" \n
"        if(_i == 60) then {_i = 0;};" \n
"        _i = _i + 1;" \n
"        setDate [(date select 0), (date select 1), (date select 2), (date select 3),_i];" \n
"    } " \n
"    else" \n
"    {" \n
"        skipTime (1/60);" \n
"    };" \n
"};" \n
"}" \n
"else" \n
"{" \n
"    if(_method) then" \n
"    {" \n
"        setDate [(date select 0), (date select 1), (date select 2), (date select 3), ((date select 4) + (_num))];" \n
"    } " \n
"    else" \n
"    {" \n
"        skipTime _skipv;" \n
"    };" \n
"};" \n
"" \n
"_lastupdate = time;" \n
"" \n
"diag_log format[""Client time: Safety was %1"", _safety];"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Sync_Client_with">*/
class Sync_Client_with
{
name = "Sync_Client_with";
init = /*%FSM<STATEINIT""">*/"setDate JipTimeNow;" \n
"" \n
"_lastsync = time;" \n
"" \n
"diag_log format[""Client Time: Time synced from server to %1"", JipTimeNow];"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Set_Jip_Var">*/
class Set_Jip_Var
{
name = "Set_Jip_Var";
init = /*%FSM<STATEINIT""">*/"JipTimeNow = date;" \n
"" \n
"diag_log(""Server Time: Jip Var set and synced"");"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Sync">*/
class Sync
{
name = "Sync";
init = /*%FSM<STATEINIT""">*/"setDate JipTimeNow;" \n
"" \n
"diag_log(""Client Time: Initial Sync with server completed"");"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Lets_split">*/
class Lets_split
{
name = "Lets_split";
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "isClient">*/
class isClient
{
priority = 1.000000;
to="Sync";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"!isDedicated && !isNil {JipTimeNow}"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "isServer">*/
class isServer
{
priority = 0.000000;
to="Set_Jip_Var";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"isServer"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="init";
finalStates[] =
{
};
};
/*%FSM</COMPILE>*/
 

 

 



core_time.fsm

в файле init прописать //Time

[2.5,true,true,7] execFSM "core_time.fsm"; 

Share this post


Link to post
Share on other sites



  • 0

Была уже тема про ускорение игрового времени на офф форуме.

Все уперлось в реализм, нагрузку и т.п.

 

Персонаж будет испытывать жажду и голод быстрее в 4 раза, движение облаков так же... ну и т.п.

Плюс к этому, если ускорять более чем в 2 раза время, то будут тормоза и лаги.

 

В целом - забей, оно того не стоит. Ну или погугли англ. форумы, там был скрипт ускорения.

Share this post


Link to post
Share on other sites
  • 0

Была уже тема про ускорение игрового времени на офф форуме.

Все уперлось в реализм, нагрузку и т.п.

 

Персонаж будет испытывать жажду и голод быстрее в 4 раза, движение облаков так же... ну и т.п.

Плюс к этому, если ускорять более чем в 2 раза время, то будут тормоза и лаги.

 

В целом - забей, оно того не стоит. Ну или погугли англ. форумы, там был скрипт ускорения.

а хотя бы час ночи перед рестартом, возможно сделать?

Share this post


Link to post
Share on other sites
  • 0

Можно переводить время перед стартом сервера. Имеется ввиду менять в файле.

Share this post


Link to post
Share on other sites
  • 0

Была уже тема про ускорение игрового времени на офф форуме.

Все уперлось в реализм, нагрузку и т.п.

 

Персонаж будет испытывать жажду и голод быстрее в 4 раза, движение облаков так же... ну и т.п.

Плюс к этому, если ускорять более чем в 2 раза время, то будут тормоза и лаги.

 

В целом - забей, оно того не стоит. Ну или погугли англ. форумы, там был скрипт ускорения.

нехрена подобного, ускоряется только смена дня и ночи, срипт я потерял, и найти нормальный немогу..(

Share this post


Link to post
Share on other sites
  • 0

 

Была уже тема про ускорение игрового времени на офф форуме.

Все уперлось в реализм, нагрузку и т.п.

 

Персонаж будет испытывать жажду и голод быстрее в 4 раза, движение облаков так же... ну и т.п.

Плюс к этому, если ускорять более чем в 2 раза время, то будут тормоза и лаги.

 

В целом - забей, оно того не стоит. Ну или погугли англ. форумы, там был скрипт ускорения.

нехрена подобного, ускоряется только смена дня и ночи, срипт я потерял, и найти нормальный немогу..(

вот тут http://epochmod.com/forum/index.php?/topic/906-shortened-daynight-cycles/page-2 горячая полемика 

Share this post


Link to post
Share on other sites
  • 0

а настроить время на сервере чтобы к рестарту была ночь около 1 часа не?

Share this post


Link to post
Share on other sites
  • 0

 

/*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Fast Time and Jip">*/
/*%FSM<HEAD>*/
/*
item0[] = {"init",0,4346,-314.336365,-163.310043,-224.336319,-113.310059,0.000000,"init"};
item1[] = {"true",8,218,-143.406555,-163.663147,-53.406559,-113.663094,0.000000,"true"};
item2[] = {"waiting",2,250,-142.815994,174.977570,-52.815941,224.977585,0.000000,"waiting"};
item3[] = {"isServer",4,218,-320.040527,236.820862,-230.040604,286.820831,0.000000,"isServer"};
item4[] = {"isClient",4,218,22.549866,229.806961,112.549881,279.806946,0.000000,"isClient"};
item5[] = {"Sync_fast_time",2,250,-320.040588,361.884491,-230.040543,411.884491,0.000000,"Sync" \n "fast time"};
item6[] = {"Skip_time",2,250,22.673546,365.358307,112.673569,415.358307,0.000000,"Skip time"};
item7[] = {"true",8,218,-136.552094,482.154419,-46.552185,532.154358,0.000000,"true"};
item8[] = {"isClient_Sync",4,218,-142.562988,264.541229,-52.563095,314.541290,0.000000,"isClient" \n "Sync"};
item9[] = {"",7,210,-363.575775,503.336090,-355.575775,511.336121,0.000000,""};
item10[] = {"",7,210,-363.654907,196.631699,-355.654907,204.631683,0.000000,""};
item11[] = {"Sync_Client_with",2,250,-140.745895,361.651337,-50.745857,411.651398,0.000000,"Sync Client" \n "with server"};
item12[] = {"isServer",4,218,-310.435089,-53.185947,-220.435059,-3.185909,0.000000,"isServer"};
item13[] = {"isClient",4,218,18.135239,-53.273216,108.135193,-3.273283,1.000000,"isClient"};
item14[] = {"Set_Jip_Var",2,250,-311.382965,62.044098,-221.382874,112.044113,0.000000,"Set Jip Var"};
item15[] = {"Sync",2,250,18.089794,61.131149,108.089844,111.131157,0.000000,"Sync"};
item16[] = {"true",8,218,-142.563049,62.134674,-52.563004,112.134666,0.000000,"true"};
item17[] = {"Lets_split",2,250,-142.562988,-53.137280,-52.563026,-3.137243,0.000000,"Lets split"};
link0[] = {0,1};
link1[] = {1,17};
link2[] = {2,3};
link3[] = {2,4};
link4[] = {2,8};
link5[] = {3,5};
link6[] = {4,6};
link7[] = {5,7};
link8[] = {6,7};
link9[] = {7,9};
link10[] = {8,11};
link11[] = {9,10};
link12[] = {10,2};
link13[] = {11,7};
link14[] = {12,14};
link15[] = {13,15};
link16[] = {14,16};
link17[] = {15,16};
link18[] = {16,2};
link19[] = {17,12};
link20[] = {17,13};
globals[] = {0.000000,0,0,0,0,640,480,1,34,6316128,1,-451.561707,471.547577,-112.201111,-884.858887,724,606,1};
window[] = {0,-1,-1,-32000,-32000,850,522,1904,99,1,742};
*//*%FSM</HEAD>*/
class FSM
{
  fsmName = "Fast Time and Jip";
  class States
  {
    /*%FSM<STATE "init">*/
    class init
    {
      name = "init";
      init = /*%FSM<STATEINIT""">*/"private[""_safety"",""_lastjipupdate"",""_lastupdate"",""_lastsync"",""_skipValue"",""_skipTime"",""_method"",""_i"",""_night"",""_nightValue"",""_nightSkip"",""_num"",""_skipv""];" \n
       "_lastjipupdate = time;" \n
       "_lastupdate = time;" \n
       "_lastsync = time;" \n
       "" \n
       "_skipValue = _this select 0;" \n
       "_method = _this select 1;" \n
       "_night = _this select 2;" \n
       "" \n
       "if(_night) then" \n
       "{" \n
       "	if(count _this > 3) then" \n
       "	{" \n
       "		_nightValue = _this select 3;" \n
       "	}" \n
       "	else" \n
       "	{" \n
       "		_nightValue = (_skipValue)*2;" \n
       "	};" \n
       "" \n
       "	_nightSkip = (_nightValue)/60;" \n
       "};" \n
       "" \n
       "_skipTime =(_skipValue)/60;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "true">*/
        class true
        {
          priority = 0.000000;
          to="Lets_split";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "waiting">*/
    class waiting
    {
      name = "waiting";
      init = /*%FSM<STATEINIT""">*/"//Safety check for lower end systems" \n
       "_fps = round(diag_fps);" \n
       "if(_fps < 35) then {_safety = true;} else {_safety = false};" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "isClient">*/
        class isClient
        {
          priority = 0.000000;
          to="Skip_time";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"((time - _lastupdate) > 60) AND !isDedicated AND !isServer"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "isClient_Sync">*/
        class isClient_Sync
        {
          priority = 0.000000;
          to="Sync_Client_with";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"((time - _lastsync) > 600) AND !isDedicated"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "isServer">*/
        class isServer
        {
          priority = 0.000000;
          to="Sync_fast_time";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"((time - _lastjipupdate) > 60) AND isServer"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Sync_fast_time">*/
    class Sync_fast_time
    {
      name = "Sync_fast_time";
      init = /*%FSM<STATEINIT""">*/"skipTime _skipTime;" \n
       "" \n
       "_lastjipupdate = time;" \n
       "" \n
       "JipTimeNow = date;" \n
       "publicVariable ""JipTimeNow"";"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "true">*/
        class true
        {
          priority = 0.000000;
          to="waiting";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Skip_time">*/
    class Skip_time
    {
      name = "Skip_time";
      init = /*%FSM<STATEINIT""">*/"//Safety Check for low-end CPU's" \n
       "if(_night) then {" \n
       "	if(SunOrMoon == 0) then" \n
       "	{" \n
       "		_num = _nightValue;" \n
       "		_skipv = _nightSkip;" \n
       "	}" \n
       "	else" \n
       "	{" \n
       "		_num = _skipValue;" \n
       "		_skipv = _skipTime;" \n
       "	};" \n
       "}" \n
       "else" \n
       "{" \n
       "	_num = _skipValue;" \n
       "	_skipv = _skipTime;" \n
       "};" \n
       "" \n
       "if(_safety) then {" \n
       "if(_method) then {_i = date select 4;};" \n
       "" \n
       "for ""_x"" from 1 to _num do" \n
       "{" \n
       "	if(_method) then" \n
       "	{" \n
       "		if(_i == 60) then {_i = 0;};" \n
       "		_i = _i + 1;" \n
       "		setDate [(date select 0), (date select 1), (date select 2), (date select 3),_i];" \n
       "	} " \n
       "	else" \n
       "	{" \n
       "		skipTime (1/60);" \n
       "	};" \n
       "};" \n
       "}" \n
       "else" \n
       "{" \n
       "	if(_method) then" \n
       "	{" \n
       "		setDate [(date select 0), (date select 1), (date select 2), (date select 3), ((date select 4) + (_num))];" \n
       "	} " \n
       "	else" \n
       "	{" \n
       "		skipTime _skipv;" \n
       "	};" \n
       "};" \n
       "" \n
       "_lastupdate = time;" \n
       "" \n
       "diag_log format[""Client time: Safety was %1"", _safety];"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "true">*/
        class true
        {
          priority = 0.000000;
          to="waiting";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Sync_Client_with">*/
    class Sync_Client_with
    {
      name = "Sync_Client_with";
      init = /*%FSM<STATEINIT""">*/"setDate JipTimeNow;" \n
       "" \n
       "_lastsync = time;" \n
       "" \n
       "diag_log format[""Client Time: Time synced from server to %1"", JipTimeNow];"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "true">*/
        class true
        {
          priority = 0.000000;
          to="waiting";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Set_Jip_Var">*/
    class Set_Jip_Var
    {
      name = "Set_Jip_Var";
      init = /*%FSM<STATEINIT""">*/"JipTimeNow = date;" \n
       "" \n
       "diag_log(""Server Time: Jip Var set and synced"");"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "true">*/
        class true
        {
          priority = 0.000000;
          to="waiting";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Sync">*/
    class Sync
    {
      name = "Sync";
      init = /*%FSM<STATEINIT""">*/"setDate JipTimeNow;" \n
       "" \n
       "diag_log(""Client Time: Initial Sync with server completed"");"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "true">*/
        class true
        {
          priority = 0.000000;
          to="waiting";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Lets_split">*/
    class Lets_split
    {
      name = "Lets_split";
      init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "isClient">*/
        class isClient
        {
          priority = 1.000000;
          to="Sync";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!isDedicated && !isNil {JipTimeNow}"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "isServer">*/
        class isServer
        {
          priority = 0.000000;
          to="Set_Jip_Var";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"isServer"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
  };
  initState="init";
  finalStates[] =
  {
  };
};
/*%FSM</COMPILE>*/

core_time.fsm

в файле init прописать //Time

[2.5,true,true,7] execFSM "core_time.fsm"; 

а можно, по конкретней где именно в init прописать? и как этот скрипт настраивать?

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

×
×
  • 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.