Jump to content
Sertica

Replace Broken Walls

Recommended Posts

	private _terObjectList = nearestTerrainObjects [_worldCenter, ["Wall"], worldSize, false];
	{
		diag_log format ["Terrain Object: %1", _x];
		{_x setDamage 0};
	} forEach _terObjectList;

I tried this and it does not work on the walls I'm looking at.  Walls return empty class names, so I can't use that either.  The ones I'm looking for may be buried in the log list.  But it is too much hassle to figure out which ones I'm targeting.

Share this post


Link to post
Share on other sites

Difficult to help you without more info on your goal.

You could try the MEH "buildingChanged" which works fine when models have a version for ruin (you can see a ruin).

setdamage should work for the others. Try to get the model with:

_modelInfo = getModelInfo cursorObject;

This could help for your quest.

Share this post


Link to post
Share on other sites

It is part of a script that renovates the Altis map, fixing or removing all wrecks, at initialization.  I already have the houses done.  Now I need the walls.  Here is the house part:

	private _worldCenter = [worldSize/2,worldSize/2];
	private _objectList = _worldCenter nearObjects worldSize;
	{
		//diag_log format ["Found: %1, Type: %2", _x, typeOf _x];
		switch (typeOf _x) do {
			case "Land_u_House_Big_01_V1_F"		: { [_x, selectRandom ["Land_i_House_Big_01_V1_F", "Land_i_House_Big_01_V2_F", "Land_i_House_Big_01_V3_F"]] call replaceBuilding; };
			case "Land_u_House_Big_02_V1_F"		: { [_x, selectRandom ["Land_i_House_Big_02_V1_F", "Land_i_House_Big_02_V2_F", "Land_i_House_Big_02_V3_F"]] call replaceBuilding; };
			case "Land_d_House_Big_02_V1_F"		: { [_x, selectRandom ["Land_i_House_Big_02_V1_F", "Land_i_House_Big_02_V2_F", "Land_i_House_Big_02_V3_F"]] call replaceBuilding; };
			case "Land_u_Shop_02_V1_F"			: { [_x, selectRandom ["Land_i_Shop_02_V1_F", "Land_i_Shop_02_V2_F", "Land_i_Shop_02_V3_F"]] call replaceBuilding; };
			case "Land_d_Shop_02_V1_F"			: { [_x, selectRandom ["Land_i_Shop_02_V1_F", "Land_i_Shop_02_V2_F", "Land_i_Shop_02_V3_F"]] call replaceBuilding; };
			case "Land_u_Shop_01_V1_F"			: { [_x, selectRandom ["Land_i_Shop_01_V1_F", "Land_i_Shop_01_V2_F", "Land_i_Shop_01_V3_F"]] call replaceBuilding; };
			case "Land_d_Shop_01_V1_F"			: { [_x, selectRandom ["Land_i_Shop_01_V1_F", "Land_i_Shop_01_V2_F", "Land_i_Shop_01_V3_F"]] call replaceBuilding; };
			case "Land_u_House_Small_01_V1_F"	: { [_x, selectRandom ["Land_i_House_Small_01_V1_F", "Land_i_House_Small_01_V2_F", "Land_i_House_Small_01_V3_F"]] call replaceBuilding; };
			case "Land_d_House_Small_01_V1_F"	: { [_x, selectRandom ["Land_i_House_Small_01_V1_F", "Land_i_House_Small_01_V2_F", "Land_i_House_Small_01_V3_F"]] call replaceBuilding; };
			case "Land_u_House_Small_02_V1_F"	: { [_x, selectRandom ["Land_i_House_Small_02_V1_F", "Land_i_House_Small_02_V2_F", "Land_i_House_Small_02_V3_F"]] call replaceBuilding; };
			case "Land_d_House_Small_02_V1_F"	: { [_x, selectRandom ["Land_i_House_Small_02_V1_F", "Land_i_House_Small_02_V2_F", "Land_i_House_Small_02_V3_F"]] call replaceBuilding; };
			case "Land_u_Addon_02_V1_F"			: { [_x,"Land_i_Addon_02_V1_F"] call replaceBuilding; };
			case "Land_d_Addon_02_V1_F"			: { [_x,"Land_i_Addon_02_V1_F"] call replaceBuilding; };
			case "Land_d_Stone_HouseBig_V1_F"	: { [_x, selectRandom ["Land_i_Stone_HouseBig_V1_F", "Land_i_Stone_HouseBig_V2_F", "Land_i_Stone_HouseBig_V3_F"]] call replaceBuilding; };
		};
	} forEach _objectList;

 

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

×