store spawned objects as netID

This is to try to make sure damaged buildings and other damaged objects are deleted upon mission completion.
This commit is contained in:
Chris Cardozo 2020-10-04 15:51:28 -04:00
parent 34204ccdc6
commit ca8105c492
5 changed files with 6 additions and 5 deletions

View File

@ -40,7 +40,7 @@ if !(isNull _group) then
_building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"]; _building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"];
_building setPosATL (_bldRelPos vectorAdd _center); _building setPosATL (_bldRelPos vectorAdd _center);
_building setDir _bldDir; _building setDir _bldDir;
_buildingsSpawned pushBack _building; _buildingsSpawned pushBack (netID _building);
_staticsSpawned = [_building,_group,_statics,_men,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_ATL; _staticsSpawned = [_building,_group,_statics,_men,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_ATL;
}forEach _garrisonedBuilding_ATLsystem; }forEach _garrisonedBuilding_ATLsystem;
}; };

View File

@ -43,7 +43,7 @@ if !(isNull _group) then
_x params["_bldClassName","_bldRelPos","_bldDir","_s","_d","_p","_noStatics","_typesStatics","_noUnits"]; _x params["_bldClassName","_bldRelPos","_bldDir","_s","_d","_p","_noStatics","_typesStatics","_noUnits"];
if (_typesStatics isEqualTo []) then {_typesStatics = ["B_HMG_01_high_F"]}; if (_typesStatics isEqualTo []) then {_typesStatics = ["B_HMG_01_high_F"]};
_building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"]; _building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"];
_buildingsSpawned pushBack _building; _buildingsSpawned pushBack (netID _building);
_building setPosATL (_bldRelPos vectorAdd _center); _building setPosATL (_bldRelPos vectorAdd _center);
[_building, _bldDir] call blck_fnc_setDirUp; [_building, _bldDir] call blck_fnc_setDirUp;
_staticsSpawned = [_building,_group,_noStatics,_typesStatics,_noUnits,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_relPos; _staticsSpawned = [_building,_group,_noStatics,_typesStatics,_noUnits,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_relPos;

View File

@ -40,5 +40,5 @@ _smoke setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
_smoke setPos _posWreck; _smoke setPos _posWreck;
_smoke attachto [_fire, [0,0,1.5]]; _smoke attachto [_fire, [0,0,1.5]];
_objs = [_fire,_smoke]; _objs = [netID _fire,netID _smoke];
_objs _objs

View File

@ -40,7 +40,8 @@ private _hiddenObjs = [];
}; };
_obj = createVehicle[_className,[0,0,0],[],0,"CAN_COLLIDE"]; _obj = createVehicle[_className,[0,0,0],[],0,"CAN_COLLIDE"];
_obj setPosATL _objPos; _obj setPosATL _objPos;
_newObjs pushback _obj;
_newObjs pushback (netID _obj);
[_obj, _dir] call blck_fnc_setDirUp; [_obj, _dir] call blck_fnc_setDirUp;
_obj setVectorUp [0,0,1]; _obj setVectorUp [0,0,1];
_obj enableDynamicSimulation _sim; _obj enableDynamicSimulation _sim;

View File

@ -38,7 +38,7 @@ private _hiddenObjs = [];
_obj enableSimulationGlobal false; _obj enableSimulationGlobal false;
_obj enableDynamicSimulation false; _obj enableDynamicSimulation false;
_obj setDir (_obj getRelDir _coords); _obj setDir (_obj getRelDir _coords);
_newObjs pushback _obj; _newObjs pushback (netID _obj);
sleep 0.1; sleep 0.1;
} forEach _missionLandscape; } forEach _missionLandscape;