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
  • 0
Gizda

Добавление новых объектов

Подскажите, как добавить новые объекты на карту из оффлайн редактора через отдельный файл, который вызывается в init.c?

 

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Ниче не понял, что за оффлайн редактор, вызываемый с init.c ?

Share this post


Link to post
Share on other sites







  • 0
17 минут назад, 123new сказал:

Ниче не понял, что за оффлайн редактор, вызываемый с init.c ?

Извиняюсь, не так мысли изложил) В оффлайне делаем здания, экспортируем их в файл, и этот файл вызываем в init.c. Есть такая возможность?

Share this post


Link to post
Share on other sites
  • 0
39 минут назад, Gizda сказал:

Извиняюсь, не так мысли изложил) В оффлайне делаем здания, экспортируем их в файл, и этот файл вызываем в init.c. Есть такая возможность?

без вызова этого файла, разумеется.
экспорт делается поумолчанию в scripts.log в appdata - local

Share this post


Link to post
Share on other sites
  • 0
57 минут назад, 123new сказал:

без вызова этого файла, разумеется.
экспорт делается поумолчанию в scripts.log в appdata - local

Я про то что здесь я нашел инструкцию, где добавление новых объектов и зданий прописывается в файл init.c, но это нагромождает его очень сильно, есть функция, если не ошибаюсь называется include вот с помощью нее можно ли сделать вызов файла в котором находятся постройки и объекты с координатами?

Share this post


Link to post
Share on other sites
  • 0

Gizda да.
делаем файл, называем его как хотим, например, так: MyBildings.c

заполняем его таким содержимым

void Spawnbildings()
{
	{my code}
}

где вместо {my code} будет ваш код, который вы в init.c вставляли.
А на том месте, куда вы в init.c вставляли вместо вами вставленного кода будет 

 Spawnbildings();

разумеется, в самом начале инита надо наш MyBildings.c еще через include подключить, иначе сервер не запустится.

Share this post


Link to post
Share on other sites
  • 0

123newа можно поподробнее как это прописать а то там есть

void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    //Force collision update
    vector roll = obj.GetOrientation();
    roll [ 2 ] = roll [ 2 ] - 1;
    obj.SetOrientation( roll );
    roll [ 2 ] = roll [ 2 ] + 1;
    obj.SetOrientation( roll );
}

и добавляем сам объект в void Main()

SpawnObject("Land_CementWorks_ExpeditionB", "2667.110596 -0.193780 1417.669189", "-89.000000 0.000000 0.000000");

 

Share this post


Link to post
Share on other sites
  • 0
12 часа назад, PJIIOxa сказал:

123newа можно поподробнее как это прописать а то там есть


void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    //Force collision update
    vector roll = obj.GetOrientation();
    roll [ 2 ] = roll [ 2 ] - 1;
    obj.SetOrientation( roll );
    roll [ 2 ] = roll [ 2 ] + 1;
    obj.SetOrientation( roll );
}

и добавляем сам объект в void Main()


SpawnObject("Land_CementWorks_ExpeditionB", "2667.110596 -0.193780 1417.669189", "-89.000000 0.000000 0.000000");

 

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Share this post


Link to post
Share on other sites
  • 0

123new

 

Сделал в точности! Но объект в моем случае ангар не спавнится

Share this post


Link to post
Share on other sites
  • 0

White124 значит либо с координатами напортачили, либо с id объекта, либо вызов самого спавна не сделан.

 

Share this post


Link to post
Share on other sites
  • 0

123new Прикрепляю свой файл... там же все очень просто - но не спавнит.... бред

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Share this post


Link to post
Share on other sites
  • 0

White124 

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

добавил проверку вывода в лог, все работает:

SCRIPT       : EntityAI m_EnergySource = Battery9V<965d8c30>
SCRIPT       : int m_EnergySourceNetworkIDLow = 0
SCRIPT       : int m_EnergySourceNetworkIDHigh = 0
SCRIPT       : Object Land_CementWorks_Hall1 in position <8227.950195, 472.911011, 9031.429688> and orientation <-29.000006, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8220.184570, 470.395660, 9051.306641> and orientation <61.999992, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8217.918945, 470.412750, 9050.119141> and orientation <62.999996, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8224.615234, 475.399994, 9052.994141> and orientation <151.000031, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8226.000000, 475.399994, 9050.499023> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8227.283203, 475.399994, 9048.183594> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8228.471680, 475.399994, 9046.041992> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8229.905273, 475.399994, 9043.458984> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8231.208008, 475.399994, 9041.099609> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8232.629883, 475.399994, 9038.533203> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8234.019531, 475.399994, 9036.025391> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8235.379883, 475.399994, 9033.573242> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8236.815430, 475.399994, 9030.981445> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8238.237305, 475.399994, 9028.417969> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8239.675781, 475.399994, 9025.823242> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8240.928711, 475.399994, 9023.561523> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8242.180664, 475.399994, 9021.303711> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8243.409180, 475.399994, 9019.086914> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8244.858398, 475.399994, 9016.471680> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8211.449219, 475.399994, 9045.690430> and orientation <-29.000008, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8212.845703, 475.399994, 9043.153320> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8214.093750, 475.399994, 9040.869141> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8215.387695, 475.399994, 9038.533203> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8216.817383, 475.399994, 9035.941406> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8218.268555, 475.399994, 9033.317383> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8219.670898, 475.399994, 9030.787109> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8221.029297, 475.399994, 9028.336914> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8222.411133, 475.399994, 9025.844727> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8223.695313, 475.399994, 9023.528320> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8225.041992, 475.399994, 9021.098633> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8226.300781, 475.399994, 9018.826172> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8227.543945, 475.399994, 9016.583984> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8228.871094, 475.399994, 9014.190430> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8230.245117, 475.399994, 9011.710938> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8231.648438, 475.399994, 9009.199219> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8215.403320, 478.080475, 9047.751953> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8216.756836, 478.069000, 9045.305664> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8218.188477, 478.068878, 9042.719727> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8219.540039, 478.068726, 9040.276367> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8221.030273, 478.068604, 9037.574219> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8222.189453, 478.068481, 9035.489258> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8223.526367, 478.068329, 9033.074219> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8224.849609, 478.068298, 9030.683594> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8226.166016, 478.068268, 9028.305664> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8227.532227, 478.068054, 9025.836914> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8228.883789, 478.067932, 9023.394531> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8230.208008, 478.067780, 9021.000977> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8231.529297, 478.067566, 9018.613281> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8232.918945, 478.067535, 9016.102539> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8234.275391, 478.067383, 9013.652344> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8235.661133, 478.067261, 9011.148438> and orientation <-28.999998, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8241.368164, 478.042450, 9014.354492> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8239.925781, 478.027802, 9016.962891> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8238.516602, 478.029816, 9019.502930> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8237.134766, 478.029999, 9021.993164> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8235.724609, 478.030243, 9024.534180> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8234.387695, 478.030487, 9026.943359> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8233.041992, 478.030640, 9029.367188> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8231.613281, 478.030823, 9031.941406> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8230.218750, 478.031067, 9034.454102> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8228.813477, 478.031311, 9036.985352> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8227.368164, 478.031586, 9039.589844> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8225.941406, 478.031830, 9042.250000> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8224.504883, 478.027771, 9044.837891> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8223.056641, 478.028046, 9047.447266> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8221.694336, 478.028290, 9049.901367> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8221.125000, 478.028503, 9051.005859> and orientation <151.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8233.303711, 475.399994, 9008.475586> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8235.620117, 475.399994, 9009.764648> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8237.988281, 475.399994, 9011.072266> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8239.910156, 475.399994, 9012.137695> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8241.946289, 475.399994, 9013.265625> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8244.240234, 475.399994, 9014.537109> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8244.641602, 475.399994, 9014.738281> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8237.154297, 478.043945, 9010.699219> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8239.625000, 478.044006, 9012.083984> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8240.948242, 478.044006, 9012.823242> and orientation <-119.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8223.182617, 475.399994, 9053.441406> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8220.819336, 475.399994, 9052.101563> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8218.258789, 475.399994, 9050.698242> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8215.664063, 475.399994, 9049.250977> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8213.081055, 475.399994, 9047.843750> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8211.854492, 475.399994, 9047.191406> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8219.577148, 478.050140, 9051.385742> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8217.121094, 478.049347, 9050.019531> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8215.816406, 478.049347, 9049.308594> and orientation <61.000000, 0.000000, 0.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8235.050781, 477.000000, 9022.594727> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8232.451172, 477.000000, 9021.205078> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8233.690430, 477.000000, 9025.024414> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8231.057617, 477.000000, 9023.627930> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8232.517578, 477.000000, 9027.365234> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8229.890625, 477.000000, 9025.966797> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8228.523438, 477.000000, 9028.559570> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8231.091797, 477.000000, 9029.933594> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8227.152344, 477.000000, 9031.039063> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8229.746094, 477.000000, 9032.407227> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8228.304688, 477.000000, 9034.750977> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8225.716797, 477.000000, 9033.388672> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8224.437500, 477.000000, 9035.805664> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8227.002930, 477.000000, 9037.166016> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8223.230469, 477.000000, 9038.375000> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8225.840820, 477.000000, 9039.750000> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8224.267578, 477.000000, 9042.119141> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8221.649414, 477.000000, 9040.738281> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8222.802734, 477.000000, 9044.697266> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8220.182617, 477.000000, 9043.294922> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8218.790039, 477.000000, 9045.899414> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8221.400391, 477.000000, 9047.282227> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8217.416992, 477.000000, 9048.405273> and orientation <62.000004, 0.000000, 90.000000> is created!
SCRIPT       : Object Land_BusStation_wall_bench in position <8219.895508, 477.000000, 9049.735352> and orientation <62.000004, 0.000000, 90.000000> is created!

так и не нашел никакой проблемы в вашем файле

Edited by 123new (see edit history)

Share this post


Link to post
Share on other sites
  • 0

123new 

Может с координатами ерунда? Может он спавнит мой объект но в каком то другом месте. Я создавал в offline а там беда с координатами я слышал...

Share this post


Link to post
Share on other sites
  • 0

White124 ну вообще указывается обычно в формате X Y Z

где X и Z это размещение на карте, Y - высота. Соответственно, если перепутать их и поменять местами, можно создать объект хоть под картой, хоть за картой, хоть в небе, вопрос лишь в том, создастся ли.
Так что советую включить окно debug в настройках сервера, сделать тп или отреспавнитсья в нужном месте, и уже с этого окна корректные координаты списать.

Share this post


Link to post
Share on other sites
  • 0

123new Да всё нормально там с координатами. Обычный "бронированый" сарай на Зените. Я уже просто забыл как делал в ините,теперь только через отдельный файл всё делаю....

Может затык что СРАЗУ надо в void это ставить?

Share this post


Link to post
Share on other sites
  • 0
1 час назад, paranoyk сказал:

123new Да всё нормально там с координатами. Обычный "бронированый" сарай на Зените. Я уже просто забыл как делал в ините,теперь только через отдельный файл всё делаю....

Может затык что СРАЗУ надо в void это ставить?

не понял вас, в каком смысле 'затык что СРАЗУ надо в void это ставить'?

Share this post


Link to post
Share on other sites
  • 0

123new Ну вроде вот так ...

//Spawn helper function
void SpawnObject( string type, vector position, vector orientation )
{
    auto obj = GetGame().CreateObject( type, position );
    obj.SetPosition( position );
    obj.SetOrientation( orientation );
    //Force collision update
    vector roll = obj.GetOrientation();
    roll [ 2 ] = roll [ 2 ] - 1;
    obj.SetOrientation( roll );
    roll [ 2 ] = roll [ 2 ] + 1;
    obj.SetOrientation( roll );
}

void main()
{
	//Главная база
SpawnObject("Land_CementWorks_Hall1", "8227.950195 472.911011 9031.429688", "-29.000006 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8220.184570 470.395660 9051.306641", "61.999992 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8217.918945 470.412750 9050.119141", "62.999996 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8224.615234 475.399994 9052.994141", "151.000031 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8226.000000 475.399994 9050.499023", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8227.283203 475.399994 9048.183594", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8228.471680 475.399994 9046.041992", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8229.905273 475.399994 9043.458984", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8231.208008 475.399994 9041.099609", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8232.629883 475.399994 9038.533203", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8234.019531 475.399994 9036.025391", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8235.379883 475.399994 9033.573242", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8236.815430 475.399994 9030.981445", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8238.237305 475.399994 9028.417969", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8239.675781 475.399994 9025.823242", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8240.928711 475.399994 9023.561523", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8242.180664 475.399994 9021.303711", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8243.409180 475.399994 9019.086914", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8244.858398 475.399994 9016.471680", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8211.449219 475.399994 9045.690430", "-29.000008 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8212.845703 475.399994 9043.153320", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8214.093750 475.399994 9040.869141", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8215.387695 475.399994 9038.533203", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8216.817383 475.399994 9035.941406", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8218.268555 475.399994 9033.317383", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8219.670898 475.399994 9030.787109", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8221.029297 475.399994 9028.336914", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8222.411133 475.399994 9025.844727", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8223.695313 475.399994 9023.528320", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8225.041992 475.399994 9021.098633", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8226.300781 475.399994 9018.826172", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8227.543945 475.399994 9016.583984", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8228.871094 475.399994 9014.190430", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8230.245117 475.399994 9011.710938", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8231.648438 475.399994 9009.199219", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8215.403320 478.080475 9047.751953", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8216.756836 478.069000 9045.305664", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8218.188477 478.068878 9042.719727", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8219.540039 478.068726 9040.276367", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8221.030273 478.068604 9037.574219", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8222.189453 478.068481 9035.489258", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8223.526367 478.068329 9033.074219", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8224.849609 478.068298 9030.683594", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8226.166016 478.068268 9028.305664", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8227.532227 478.068054 9025.836914", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8228.883789 478.067932 9023.394531", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8230.208008 478.067780 9021.000977", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8231.529297 478.067566 9018.613281", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8232.918945 478.067535 9016.102539", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8234.275391 478.067383 9013.652344", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8235.661133 478.067261 9011.148438", "-28.999998 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8241.368164 478.042450 9014.354492", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8239.925781 478.027802 9016.962891", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8238.516602 478.029816 9019.502930", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8237.134766 478.029999 9021.993164", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8235.724609 478.030243 9024.534180", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8234.387695 478.030487 9026.943359", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8233.041992 478.030640 9029.367188", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8231.613281 478.030823 9031.941406", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8230.218750 478.031067 9034.454102", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8228.813477 478.031311 9036.985352", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8227.368164 478.031586 9039.589844", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8225.941406 478.031830 9042.250000", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8224.504883 478.027771 9044.837891", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8223.056641 478.028046 9047.447266", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8221.694336 478.028290 9049.901367", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8221.125000 478.028503 9051.005859", "151.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8233.303711 475.399994 9008.475586", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8235.620117 475.399994 9009.764648", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8237.988281 475.399994 9011.072266", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8239.910156 475.399994 9012.137695", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8241.946289 475.399994 9013.265625", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8244.240234 475.399994 9014.537109", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8244.641602 475.399994 9014.738281", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8237.154297 478.043945 9010.699219", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8239.625000 478.044006 9012.083984", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8240.948242 478.044006 9012.823242", "-119.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8223.182617 475.399994 9053.441406", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8220.819336 475.399994 9052.101563", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8218.258789 475.399994 9050.698242", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8215.664063 475.399994 9049.250977", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8213.081055 475.399994 9047.843750", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8211.854492 475.399994 9047.191406", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8219.577148 478.050140 9051.385742", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8217.121094 478.049347 9050.019531", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8215.816406 478.049347 9049.308594", "61.000000 0.000000 0.000000");
SpawnObject("Land_BusStation_wall_bench", "8235.050781 477.000000 9022.594727", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8232.451172 477.000000 9021.205078", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8233.690430 477.000000 9025.024414", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8231.057617 477.000000 9023.627930", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8232.517578 477.000000 9027.365234", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8229.890625 477.000000 9025.966797", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8228.523438 477.000000 9028.559570", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8231.091797 477.000000 9029.933594", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8227.152344 477.000000 9031.039063", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8229.746094 477.000000 9032.407227", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8228.304688 477.000000 9034.750977", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8225.716797 477.000000 9033.388672", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8224.437500 477.000000 9035.805664", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8227.002930 477.000000 9037.166016", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8223.230469 477.000000 9038.375000", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8225.840820 477.000000 9039.750000", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8224.267578 477.000000 9042.119141", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8221.649414 477.000000 9040.738281", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8222.802734 477.000000 9044.697266", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8220.182617 477.000000 9043.294922", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8218.790039 477.000000 9045.899414", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8221.400391 477.000000 9047.282227", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8217.416992 477.000000 9048.405273", "62.000004 0.000000 90.000000");
SpawnObject("Land_BusStation_wall_bench", "8219.895508 477.000000 9049.735352", "62.000004 0.000000 90.000000");
	//INIT WEATHER BEFORE ECONOMY INIT------------------------
	Weather weather = g_Game.GetWeather();

	weather.MissionWeather(false);    // false = use weather controller from Weather.c

	weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
	weather.GetRain().Set( 0, 0, 1);
	weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);

	//INIT ECONOMY--------------------------------------
	Hive ce = CreateHive();
	if ( ce )
		ce.InitOffline();

	//DATE RESET AFTER ECONOMY INIT-------------------------
	int year, month, day, hour, minute;
	int reset_month = 9, reset_day = 20;
	GetGame().GetWorld().GetDate(year, month, day, hour, minute);

    if ((month == reset_month) && (day < reset_day))
    {
        GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
    }
    else
    {
        if ((month == reset_month + 1) && (day > reset_day))
        {
            GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
        }
        else
        {
            if ((month < reset_month) || (month > reset_month + 1))
            {
                GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
            }
        }
    }
}



class CustomMission: MissionServer
{	
	void SetRandomHealth(EntityAI itemEnt)
	{
		if ( itemEnt )
		{
			int rndHlt = Math.RandomInt(55,100);
			itemEnt.SetHealth("","",rndHlt);
		}
	}

	override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
	{
		Entity playerEnt;
		playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
		Class.CastTo(m_player, playerEnt);
		
		GetGame().SelectPlayer(identity, m_player);
		
		return m_player;
	}
	
	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		EntityAI itemTop;
		EntityAI itemEnt;
		ItemBase itemBs;
		float rand;
		
		itemTop = player.FindAttachmentBySlotName("Body");
		
		if ( itemTop )
		{
			itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
			if ( Class.CastTo(itemBs, itemEnt ) )
				itemBs.SetQuantity(4);

			SetRandomHealth(itemEnt);
			
			itemEnt = itemTop.GetInventory().CreateInInventory("RoadFlare");
			SetRandomHealth(itemEnt);
			
			rand = Math.RandomFloatInclusive(0.0, 1.0);
			if ( rand < 0.35 )
				itemEnt = player.GetInventory().CreateInInventory("Apple");
			else if ( rand > 0.65 )
				itemEnt = player.GetInventory().CreateInInventory("Pear");
			else
				itemEnt = player.GetInventory().CreateInInventory("Plum");
		
			SetRandomHealth(itemEnt);
		}
	}
};
  
Mission CreateCustomMission(string path)
{
	return new CustomMission();	
}

 

Share this post


Link to post
Share on other sites
  • 0

paranoyk ну так это нормальное явление. Мы через void объявляем собственную функцию с нужным нам именем, принимающую определенные значения, но не возвращающую никаких значений. После чего просто вызываем эту функцию нужное количество раз с указанными нами значениями.
Повторюсь, тот файл, что я приложил, работает, и лог с того сообщения тому в доказательство. Если у вас не спавнит - ищите проблему в чем-то другом. Может у вас миссия сервер другая используется, или моды конфликт какой вызывают, уж не знаю.

Share this post


Link to post
Share on other sites
  • 0

123new Дык у автора не спавниться,у меня то через вызов функции всё в лёт идет....(ещё раз спасибо что тогда вразумили не засорять ИНИТ:)))

Share this post


Link to post
Share on other sites
  • 0

paranoyk ну пусть автор и проверяет где он косякнул)) я вот уже буквально пару дней назад встретил такой затык, что собственно накрученные изменения в init.c по спавну персонажа без вызовов виде super.CreateCharacter и т.п. отрубают корректную работу мода зараженных зон. Прикольно? Вот и я так думаю. Методом сверки файлов мода и миссии сервера вычислил, и нигде про это не говорится.
А есть такие моды, как VanillaPlusPlus, в которых вообще вся активная миссия сервера заменяется на другую. Так что что там у него накручено мы лишь гадать можем.

Share this post


Link to post
Share on other sites
  • 0

123new Бегемоты должны быть повешаны!

(а мододелы-расстреляны)

 

Кстати с заражёнными зонами...вы на чьей основе их делали?

 

Share this post


Link to post
Share on other sites
  • 0

123new 

Ты некорректен в данном случае

 

X Y Z

 

В CreateObject X Z Y - где Z высота

Share this post


Link to post
Share on other sites
  • 0
23 часа назад, 123new сказал:

paranoyk Radiation Zone от AlPepino

Вы полностью переработали мод под установку только на сервер?

 

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.