0.3.9.0545

new function EPOCH_swapBuilding
This commit is contained in:
vbawol 2016-06-28 21:37:11 -05:00
parent 086102c63e
commit 1ec9d344be
40 changed files with 47 additions and 43 deletions

View File

@ -33,7 +33,7 @@ class CfgWorldInteractions {
wreck = 1;
};
class barrelwater_f_p3d : Water {};
class water_source_f_p3d : Water {};
class waterbarrel_f_p3d : Water {};

View File

@ -1 +1 @@
build=544;
build=545;

View File

@ -1 +1 @@
build=544;
build=545;

View File

@ -37,12 +37,8 @@ if (isText _staticClassConfig) then {
// Secure and insecure storage
_vehiclePos = getposATL _vehicle;
_vectorDirAndUp = [vectordir _vehicle, vectorup _vehicle];
deleteVehicle _vehicle;
_storageObj = createVehicle[_staticClass, [0,0,0], [], 0, "CAN_COLLIDE"];
_storageObj setVectorDirAndUp _vectorDirAndUp;
_storageObj setposATL _vehiclePos;
_storageObj = [_staticClass,_vehicle] call EPOCH_swapBuilding;
if (getNumber(_cfgBaseBuilding >> _staticClass >> "isSecureStorage") == 1) then{
_storageObj setVariable["EPOCH_Locked", false, true];

View File

@ -12,7 +12,7 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simToStatic.sqf
*/
private ["_worldspace","_newObj","_class","_objSlot","_cfgBaseBuilding","_lastPosition","_currentPosition","_entities"];
private ["_newObj","_class","_objSlot","_cfgBaseBuilding","_lastPosition","_currentPosition","_entities"];
_entities = allMissionObjects "Constructions_modular_F";
{
_lastPosition = _x getVariable["LAST_POS", []];
@ -24,14 +24,9 @@ _entities = allMissionObjects "Constructions_modular_F";
_class = getText(_staticClassConfig);
_objSlot = _x getVariable["BUILD_SLOT", -1];
if (_objSlot != -1) then {
_worldspace = [_currentPosition,(vectordir _x),(vectorup _x)];
deleteVehicle _x;
_newObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
_newObj = [_class,_x] call EPOCH_swapBuilding;
_newObj setVariable ["BUILD_SLOT",_objSlot,true];
_newObj call EPOCH_server_buildingInit;
_newObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)];
_newObj setposATL (_worldspace select 0);
};
};
};

View File

@ -12,7 +12,7 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf
*/
private["_classConfig","_cfgClass", "_worldspace", "_newObj", "_return", "_class", "_oemType", "_cfgBaseBuilding", "_object", "_objSlot", "_damage", "_color", "_textureSlot"];
private["_classConfig","_cfgClass", "_newObj", "_return", "_class", "_oemType", "_cfgBaseBuilding", "_object", "_objSlot", "_damage", "_color", "_textureSlot"];
params [["_object",objNull,[objNull]],["_static",false,[false]]];
_return = _object;
_objSlot = _object getVariable ["BUILD_SLOT", -1];
@ -33,10 +33,10 @@ if (_objSlot != -1) then {
_textureSlot = _object getVariable["TEXTURE_SLOT", 0];
_damage = damage _object;
_worldspace = [getposATL _object,vectordir _object,vectorup _object];
deleteVehicle _object;
//_worldspace = [getposATL _object,vectordir _object,vectorup _object];
//_newObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
_newObj = [_class,_object] call EPOCH_swapBuilding;
_newObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
_newObj setVariable ["BUILD_SLOT",_objSlot,true];
_newObj call EPOCH_server_buildingInit;
@ -54,12 +54,12 @@ if (_objSlot != -1) then {
if (isText _ammoClass) then {
_ammoClass = getText _ammoClass;
_ammoObj = createVehicle [_ammoClass, [0,0,0], [], 0, "CAN_COLLIDE"];
_ammoObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)];
_ammoObj setposATL (_worldspace select 0);
//_ammoObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)];
//_ammoObj setposATL (_worldspace select 0);
_ammoObj attachTo [_newObj,[0,0,0]];
_newObj setVariable ["EPOCH_TRAP_OBJ",_ammoObj];
};
_newObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)];
_newObj setposATL (_worldspace select 0);
_newObj setDamage _damage;
_return = _newObj;
};

View File

@ -38,15 +38,11 @@ _stableCount = 0;
_class = getText(_simulClassConfig);
_objSlot = _x getVariable["BUILD_SLOT", -1];
if (_objSlot != -1) then {
_vDir = vectordir _x;
_vUP = vectorup _x;
_playerUID = _x getVariable["BUILD_OWNER", "-1"];
_slot = _x getVariable["EPOCH_secureStorage", "-1"];
deleteVehicle _x;
_newObj = createVehicle[_class, [0,0,0], [], 0, "CAN_COLLIDE"];
// _newObj = createVehicle[_class, [0,0,0], [], 0, "CAN_COLLIDE"];
_newObj = [_class,_x] call EPOCH_swapBuilding;
_newObj setVariable["BUILD_SLOT", _objSlot, true];
_newObj setVectorDirAndUp[_vDir, _vUP];
_newObj setposASL _objectPos;
_newObj setVariable["BUILD_OWNER", _playerUID, true];
_newObj setVariable["EPOCH_secureStorage", _slot];
_newObj setVelocity[0, 0, -1];

View File

@ -24,15 +24,11 @@ if (_objSlot != -1) then {
_upgrades = getArray(_cfgBaseBuilding >> (typeOf _object) >> "upgradeBuilding");
if !(_upgrades isEqualTo []) then {
_upgrade = _upgrades param [_index,[]];
_objectPos = getposATL _object;
_worldspace = [(_objectPos call EPOCH_precisionPos), vectordir _object, vectorup _object];
deleteVehicle _object;
_class = _upgrade select 0;
_newObj = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
_newObj = [_class,_object] call EPOCH_swapBuilding;
_newObj setVariable ["BUILD_SLOT",_objSlot,true];
_newObj call EPOCH_server_buildingInit;
_newObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)];
_newObj setposATL _objectPos;
_newObj call EPOCH_saveBuilding;
};
} else {
@ -41,12 +37,8 @@ if (_objSlot != -1) then {
_upgrades = getArray(_cfgBaseBuilding >> (typeOf _object) >> "upgradeBuilding");
if !(_upgrades isEqualTo []) then {
_upgrade = _upgrades param [_index,[]];
_worldspace = [getposATL _object, vectordir _object, vectorup _object];
deleteVehicle _object;
_class = _upgrade select 0;
_newObj = createVehicle[_class, [0,0,0], [], 0, "CAN_COLLIDE"];
_newObj setVectorDirAndUp[(_worldspace select 1), (_worldspace select 2)];
_newObj setposATL(_worldspace select 0);
_newObj = [_class,_object] call EPOCH_swapBuilding;
};
};
};

View File

@ -0,0 +1,24 @@
// _newObj = [_class,_object] call EPOCH_swapBuilding;
private ["_objectPos","_newObj"];
params [["_class",""],["_object",objNull],["_method",0]];
_newObj = objNull;
if (!isNull _object && !(_class isEqualTo "")) then {
_objectPos = getPosWorld _object;
_newObj = createVehicle [_class, ASLtoAGL _objectPos, [], 0, "CAN_COLLIDE"];
if (!isNull _newObj) then {
_object hideObjectGlobal true;
switch (_method) do {
case 0: {
_newObj setVectorDirAndUp [vectordir _object, vectorup _object];
_newObj setPosWorld _objectPos;
};
case 1: {
_newObj attachTo [_object,[0,0,0]];
};
};
deleteVehicle _object;
};
};
_newObj

View File

@ -47,6 +47,7 @@ class CfgServerFunctions
class server_invitePlayer {};
};
class epoch_bases {
class swapBuilding {};
class saveBuilding {};
class server_loadBuildings {};
class server_saveBuilding {};

Binary file not shown.

View File

@ -1 +1 @@
build=544;
build=545;

View File

@ -1 +1 @@
build=544;
build=545;

View File

@ -1 +1 @@
544
545