Jump to content
Sign in to follow this  
zakiechan

Reset Fallen walls?

Recommended Posts

Curious if anyone knows how to reset a knocked over/demo'd walls.

I tried using deletevehicle and setdamage 0, but no luck, maybe im not using the right names?

example code

{_x setDamage 0;} forEach (nearestObjects [getPos player, ["Building", "Structures", "Fortifications","Structures_Cultural", "Structures_Walls", "Ruins", "Structures_Fences", "Signs","Structures_Town" ], 100]);

Thanks

Share this post


Link to post
Share on other sites

They're considered destroyed when they are fallen over, what you would do is actually for the first time use hideObjectGlobal.

Then recreate the object and then you can delete it when it dies and recreate it from there.

ZAK_fnc_rebuildBuidling = {
_building = _this select 0;
if (isNil {_building}) exitWith {};
_newBuilding = [typeOf _building, position _building, [], 0, "CAN_CONLIDE"];
deleteVehicle _building;
_newBuilding addEventHandler ["Killed",{
	[(_this select 0)] spawn ZAK_fnc_rebuildBuidling
}];
};

ZAK_fnc_removePlacedBuildings = {
_unit = _this select 0;
if (isNil {_unit}) exitWith {};
{
	if (damage _x > 0.99) then 
	{
		_x hideObjectGlobal true; 
		[_x] spawn ZAK_fnc_rebuildBuidling;
	};
} forEach (nearestObjects [getPos _unit, ["Building", "Structures", "Fortifications","Structures_Cultural", "Structures_Walls", "Ruins", "Structures_Fences", "Signs","Structures_Town" ], 100]);  
};

try that, put it in a script or just in debug console like that and then use it like this in debug console.

[player] spawn ZAK_fnc_removePlacedBuildings

--Edit--

never mind that doesn't work on fences.

let me see if I can find that command

Edited by Lala14

Share this post


Link to post
Share on other sites

I appreciate the attempt!

For added clarity this is the entry from cfg vehicles empty for the wall in question

https://community.bistudio.com/wiki/Arma_3_CfgVehicles_EMPTY

 	Land_City_8mD_F	City Wall (Long, Destroyed)	CIV	Default	Structures_Walls	1				
A3_Structures_F_Walls

It can be seen on the eastern end of the chruch compound along the coast, north of molos airfield

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×