Перейти к содержимому

DustBlue IPB Skin by CodeGame Networks

векторное строительство(вращение объектов при постройке)


  • Авторизуйтесь для ответа в теме
Сообщений в теме: 9

#1 metiss

metiss

    Администратор

  • Администраторы
  • 49 сообщений

Отправлено 13 октября 2014 - 05:12

1.Качаем архив тутПрикрепленный файл  BuildVectorsV3.zip   28,25К   475 Количество загрузок:

2. Содержимое архива бросаем в корень нашей мисии.

3. Идем в файл init.sqf и ищем
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
сразу после нее вставляем:
call compile preprocessFileLineNumbers "custom\compiles.sqf";
Ищем вот это:
DZE_BuildOnRoads
Сразу после вставляем:
DZE_noRotate = []; //Объекты которые запретим вращать. Пр: DZE_noRotate = ["VaultStorageLocked"]
DZE_curPitch = 45; //Starting rotation angle. Only 1, 5, 45, or 90.
4. Лезем в наш dayz_server.pbo открываем server_functions.sqf ищем:
dayz_objectUID2 = {
И заменяем всю эту функцию (тоесть от dayz_objectUID2 = { и до последней скобки };  ) на эту:
dayz_objectUID2 = {
private["_position","_dir","_key"];
if((count _this) == 2) then{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
}else{
if((count _this) == 3) then{
if(typename (_this select 2) == "ARRAY")then{
_vector = _this select 2;
if(count _vector == 2)then{
if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;

_vecCnt = 0;
{
_set = _x;
{
_vecCnt = _vecCnt + (round (_x * 100))

} foreach _set;

} foreach _vector;
if(_vecCnt < 0)then{
_vecCnt = ((_vecCnt * -1) * 3);
};
_key = _key + str(_vecCnt); 
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};

}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
}else{
if((count _this) == 4) then{
if(typename (_this select 3) == "ARRAY")then{
_vector = _this select 3;
if(count _vector == 2)then{
if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;

_vecCnt = 0;
{
_set = _x;
{
_vecCnt = _vecCnt + (round (_x * 100))

} foreach _set;

} foreach _vector;
if(_vecCnt < 0)then{
_vecCnt = ((_vecCnt * -1) * 3);
};
_key = _key + str(_vecCnt); 
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
}else{
if(typename (_this select 2) == "ARRAY")then{
_vector = _this select 2;
if(count _vector == 2)then{
if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;

_vecCnt = 0;
{
_set = _x;
{
_vecCnt = _vecCnt + (round (_x * 100))

} foreach _set;

} foreach _vector;
if(_vecCnt < 0)then{
_vecCnt = ((_vecCnt * -1) * 3);
};
_key = _key + str(_vecCnt); 
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
};
}else{
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _position;
_key = _key + str(round(_dir));
};
};

};
_key
};
5. Идем в наш server_monitor.sqf ищем
// # NOW SPAWN OBJECTS #
и конец ищем тоже:
// # END SPAWN OBJECTS #
А все что между этими строками заменяем на:
// # NOW SPAWN OBJECTS #
_totalvehicles = 0;
{
_idKey =  _x select 1;
_type = _x select 2;
_ownerID =  _x select 3;

_worldspace =  _x select 4;
_intentory = _x select 5;
_hitPoints = _x select 6;
_fuel = _x select 7;
_damage =  _x select 8;

_dir = 0;


_pos = [0,0,0];
_wsDone = false;
if (count _worldspace >= 2) then
{
if ((typeName (_worldspace select 0)) == "STRING") then {
_worldspace set [0, call compile (_worldspace select 0)];
_worldspace set [1, call compile (_worldspace select 1)];
};
_dir = _worldspace select 0;
if (count (_worldspace select 1) == 3) then {
_pos = _worldspace select 1;
_wsDone = true;
}
}; 

if (!_wsDone) then {
if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
};

_vector = [[0,0,0],[0,0,0]];
_vecExists = false;
_ownerPUID = "0";
if (count _worldspace >= 3) then{
if(count _worldspace == 3) then{
if(typename (_worldspace select 2) == "STRING")then{
_ownerPUID = _worldspace select 2;
}else{
if(typename (_worldspace select 2) == "ARRAY")then{
_vector = _worldspace select 2;
if(count _vector == 2)then{
if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
_vecExists = true;
};
};
}; 
};

}else{
//Was not 3 elements, so check if 4 or more
if(count _worldspace == 4) then{
if(typename (_worldspace select 3) == "STRING")then{
_ownerPUID = _worldspace select 3;
}else{
if(typename (_worldspace select 2) == "STRING")then{
_ownerPUID = _worldspace select 2;
};
};


if(typename (_worldspace select 2) == "ARRAY")then{
_vector = _worldspace select 2;
if(count _vector == 2)then{
if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
_vecExists = true;
};
};
}else{
if(typename (_worldspace select 3) == "ARRAY")then{
_vector = _worldspace select 3;
if(count _vector == 2)then{
if(((count (_vector select 0)) == 3) && ((count (_vector select 1)) == 3))then{
_vecExists = true;
};
};
};
};

}else{
//More than 3 or 4 elements found
//Might add a search for the vector, ownerPUID will equal 0
};
};
};
	  
// diag_log format["Server_monitor: [ObjectID = %1]  [ClassID = %2] [_ownerPUID = %3]", _idKey, _type, _ownerPUID];

if (_damage < 1) then {
//diag_log format["OBJ: %1 - %2", _idKey,_type];

//Create it
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectID", _idKey, true];
_object setVariable ["OwnerPUID", _ownerPUID, true];

_lockable = 0;
if(isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then {
_lockable = getNumber(configFile >> "CfgVehicles" >> _type >> "lockable");
};

// fix for leading zero issues on safe codes after restart
if (_lockable == 4) then {
_codeCount = (count (toArray _ownerID));
if(_codeCount == 3) then {
_ownerID = format["0%1", _ownerID];
};
if(_codeCount == 2) then {
_ownerID = format["00%1", _ownerID];
};
if(_codeCount == 1) then {
_ownerID = format["000%1", _ownerID];
};
};

if (_lockable == 3) then {
_codeCount = (count (toArray _ownerID));
if(_codeCount == 2) then {
_ownerID = format["0%1", _ownerID];
};
if(_codeCount == 1) then {
_ownerID = format["00%1", _ownerID];
};
};

_object setVariable ["CharacterID", _ownerID, true];

clearWeaponCargoGlobal  _object;
clearMagazineCargoGlobal  _object;
// _object setVehicleAmmo DZE_vehicleAmmo;

_object setdir _dir;

if(_vecExists)then{
_object setVectorDirAndUp _vector;
};

_object setposATL _pos;
_object setDamage _damage;

if ((typeOf _object) in dayz_allowedObjects) then {
if (DZE_GodModeBase) then {
_object addEventHandler ["HandleDamage", {false}];
} else {
_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];
};
// Test disabling simulation server side on buildables only.
_object enableSimulation false;
// used for inplace upgrades && lock/unlock of safe
_object setVariable ["OEMPos", _pos, true];

};

if (count _intentory > 0) then {
if (_type in DZE_LockedStorage) then {
// Fill variables with loot
_object setVariable ["WeaponCargo", (_intentory select 0),true];
_object setVariable ["MagazineCargo", (_intentory select 1),true];
_object setVariable ["BackpackCargo", (_intentory select 2),true];
} else {

//Add weapons
_objWpnTypes = (_intentory select 0) select 0;
_objWpnQty = (_intentory select 0) select 1;
_countr = 0; 
{
if(_x in (DZE_REPLACE_WEAPONS select 0)) then {
_x = (DZE_REPLACE_WEAPONS select 1) select ((DZE_REPLACE_WEAPONS select 0) find _x);
};
_isOK =  isClass(configFile >> "CfgWeapons" >> _x);
if (_isOK) then {
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
};
_countr = _countr + 1;
} count _objWpnTypes; 

//Add Magazines
_objWpnTypes = (_intentory select 1) select 0;
_objWpnQty = (_intentory select 1) select 1;
_countr = 0;
{
if (_x == "BoltSteel") then { _x = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
if (_x == "ItemTent") then { _x = "ItemTentOld" };
_isOK =  isClass(configFile >> "CfgMagazines" >> _x);
if (_isOK) then {
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
};
_countr = _countr + 1;
} count _objWpnTypes;

//Add Backpacks
_objWpnTypes = (_intentory select 2) select 0;
_objWpnQty = (_intentory select 2) select 1;
_countr = 0;
{
_isOK =  isClass(configFile >> "CfgVehicles" >> _x);
if (_isOK) then {
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
};
_countr = _countr + 1;
} count _objWpnTypes;
};
}; 

if (_object isKindOf "AllVehicles") then {
{
_selection = _x select 0;
_dam = _x select 1;
if (_selection in dayZ_explosiveParts && _dam > 0.8) then {_dam = 0.8};
[_object,_selection,_dam] call object_setFixServer;
} count _hitpoints;

_object setFuel _fuel;

if (!((typeOf _object) in dayz_allowedObjects)) then {

//_object setvelocity [0,0,1];
_object call fnc_veh_ResetEH; 

if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then {
_object setvehiclelock "locked";
};

_totalvehicles = _totalvehicles + 1;

// total each vehicle
serverVehicleCounter set [count serverVehicleCounter,_type];
};
};

//Monitor the object
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];
};
} count (_BuildingQueue + _objectQueue);
// # END SPAWN OBJECTS # 
6. Сохраняем все, и запаковываем сервер обратно.
7. Идем снова в папку с миссией в файл description.ext и в самом конце вставляем:
#include "custom\snap_pro\snappoints.hpp"
Вроде все. Сохраняем и радуемся. Автор еще рекомендует установить Precise Base Building эта штуковина жестко привязывает координаты построек к БД

#2 Ivanmakarov

Ivanmakarov

    Новичок

  • Пользователи
  • Pip
  • 3 сообщений

Отправлено 20 ноября 2014 - 18:56

Всем привет. Очень хороший и качественный гайд по установке, но к вам убедительная просьба указывать путь к файлу, ищу второй час server_monitor.sqf где он может находиться не понимаю, приходиться прерывать все системные файлы.
P.S. Не использую поисковик винды так как тут он попросту не работает.

Буду вам благодарен если в дальнейшем пропишите везде пути или сделаете отдельный файл где какие файлы находятся.

#3 Ivanmakarov

Ivanmakarov

    Новичок

  • Пользователи
  • Pip
  • 3 сообщений

Отправлено 20 ноября 2014 - 18:59

Да есть такой и нашел его по этому адресу, может кому пригодиться C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead\@DayZ_Epoch_Server\addons\dayz_server\system

#4 Ivanmakarov

Ivanmakarov

    Новичок

  • Пользователи
  • Pip
  • 3 сообщений

Отправлено 20 ноября 2014 - 19:13

Скажите как перевести данное меню на русский язык, очень бы хотелось дать именно русскоязычное меню. Спасибо за данный скрипт.

#5 NoNameUltima

NoNameUltima

    Администратор

  • Администраторы
  • 191 сообщений
  • ГородСанкт-Петербург

Отправлено 22 ноября 2014 - 03:30

Просмотр сообщенияIvanmakarov (20 ноября 2014 - 19:13) писал:

Скажите как перевести данное меню на русский язык, очень бы хотелось дать именно русскоязычное меню. Спасибо за данный скрипт.

Открывай архив, который тут, и открывай все файлы в блокноте.
Ищи англ. названия пунктов, подсказок.
Переводи файл в кодировку UTF8 без BOM (Notepad++ в помощь). - вверху кодировки.
А потом переводи и сохраняй...

Статья, - как переводить:
http://rnrportal.ru/...пталокализация/


P.S.
metiss

Тема без форматирования псц...

P.S.P.S.
Создавайте темы с вопросами в разделе - вопросы по серверам. - Просто можете сослаться на гайд из данного раздела, если вопрос по нему.
Темы которые созданы в данном разделе, буду закрывать, чтобы не захламлялись, и дополнять по необходимости.

#6 Multik

Multik

    Новичок

  • Пользователи
  • Pip
  • 4 сообщений

Отправлено 06 ноября 2015 - 00:09

Может кто подсказать, в файле server_functions.sqf надо заменять от dayz_objectUID2 ={ }; и до самого низа? я так понял после этой строки надо то что под ней заменить всё правильно ?

#7 NoNameUltima

NoNameUltima

    Администратор

  • Администраторы
  • 191 сообщений
  • ГородСанкт-Петербург

Отправлено 06 ноября 2015 - 01:51

Просмотр сообщенияMultik (06 ноября 2015 - 00:09) писал:

Может кто подсказать, в файле server_functions.sqf надо заменять от dayz_objectUID2 ={ }; и до самого низа? я так понял после этой строки надо то что под ней заменить всё правильно ?

Если у тебя notepad++ просто ткни на скобочку -
{
после
dayz_objectUID2=

и увидишь конец данной функции.
вот ее и надо заменить, а не до конца файла.

#8 Multik

Multik

    Новичок

  • Пользователи
  • Pip
  • 4 сообщений

Отправлено 06 ноября 2015 - 03:32

Просмотр сообщенияNoNameUltima (06 ноября 2015 - 01:51) писал:

Если у тебя notepad++ просто ткни на скобочку -
{
после
dayz_objectUID2=

и увидишь конец данной функции.
вот ее и надо заменить, а не до конца файла.
Блин я так и сделал, но почему то у меня после рестарта сервера, все векторные постройки становятся в положение стандартного строительства((

#9 NoNameUltima

NoNameUltima

    Администратор

  • Администраторы
  • 191 сообщений
  • ГородСанкт-Петербург

Отправлено 30 ноября 2015 - 23:19

Просмотр сообщенияMultik (06 ноября 2015 - 03:32) писал:

Блин я так и сделал, но почему то у меня после рестарта сервера, все векторные постройки становятся в положение стандартного строительства((
Смотри в БД после установки объекта как он там прописался.
Если без векторов - значит ты не доделал чтото - скорее всего клиент(скрипт стройки в миссии) шлет стандартные координаты без векторов.

#10 Multik

Multik

    Новичок

  • Пользователи
  • Pip
  • 4 сообщений

Отправлено 31 января 2016 - 11:30

Подскажите, как сделать что бы двери вектором перевёрнутые при улучшение не улетали в верх в стандартное положение?




Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных