Jump to content
LoseBummer

Hide map objects Junk, Garbage and Wrecks with Script [Done]

Recommended Posts

What p3d path are you using for the createSimpleObject?  There's one for on and one for off.

Share this post


Link to post
Share on other sites

The ON one.

Search off model = "A3\Structures_F\Civ\Lamps\LampSolar_off_F.p3d";

Replace with on model = "A3\Structures_F\Civ\Lamps\LampSolar_F.p3d";

Share this post


Link to post
Share on other sites

As Wiki says. Built in lights R not featured with createSimpleObject

  • Like 1

Share this post


Link to post
Share on other sites

Same concept to fix walls and fences, searchs for terrain objects and replace it with the intact one.

One issue to overcome is placing a pillar in the gaps, in fences too.

EDIT: not working right. Tried to offset per model xyz but the offset its in relation of the xyz of the map coordinates and not between objects.

 

gamelogic>init

null = ["MARKERNAME"] ExecVM "wff.sqf";

wff.sqf

_marker = _this param [0,"CENTER",[""]];
_Size = markerSize _marker;
_markerSize = _Size select 1;
medianera = [["CITY_8MD_F","Land_City_8m_F"],
			 ["CITY2_8MD_F","Land_City2_8m_F"],
			 ["CITY2_PILLARD_F","Land_City_4m_F"],
			 ["INDFNC_3_D_F","Land_IndFnc_3_F"],
			 ["INDFNC_3_HOLE_F","Land_IndFnc_3_F"],
			 ["MIL_WIREDFENCED_F","Land_Mil_WiredFence_F"],
			 ["NET_FENCED_8M_F","Land_Net_Fence_8m_F"],
			 ["NEW_WIREDFENCE_10M_DAM_F","Land_New_WiredFence_10m_F"],
			 ["STONE_8MD_F","Land_Stone_8m_F"],
			 ["WALL_INDCNC_4_D_F","Land_Wall_IndCnc_4_F"],
			 ["WIRED_FENCE_4MD_F","Land_Wired_Fence_4m_F"],
			 ["WIRED_FENCE_8MD_F","Land_Wired_Fence_8m_F"]
			];
for "_i" from 0 to(count medianera-1) do {
	_Current = (medianera select _i) select 0;
    _Replacement = (medianera select _i) select 1;
    {
		if ((toUpper(str _x) find _Current) >= 0) then {
        hideObjectGlobal  _x;
        _myReplacement = createVehicle [_Replacement, getPosATL _x, [], 0, "CAN_COLLIDE"];
        _myReplacement setDir (getdir _x);
        _myReplacement setPosATL (getPosATL _x) ;
        _myReplacement enableSimulationGlobal true;
		};
    } forEach nearestTerrainObjects [markerpos _marker, ["WALL", "FENCE"], _markerSize];
};
  • Like 1

Share this post


Link to post
Share on other sites

As Wiki says. Built in lights R not featured with createSimpleObject

 

Oh I see, the lights look on, but don't actually cast light.  Had NVGs on and didn't notice a difference heh.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Losebummer. I've been using a variation on this theme to do some tree pruning on maps for a bit of FPS boost for some time. Works a real treat on Dyala:

{
if random 10 < 5 then
{
_x hideobject true;
_x enablesimulation false;
};
} forEach nearestTerrainObjects [player, ["Tree","Small Tree","Bush"], 1000, false];

I just attach it to a radio command, and type 0,0,0 when I want to do some gardening.

  • Like 1

Share this post


Link to post
Share on other sites

Ok I got things working on my end. After reading into things more carefully I realized my marker was named "center" but the trigger was calling "myMarker".

Share this post


Link to post
Share on other sites

So I can't get this to work on the Zargabad map. I am trying to replace some buildings with other ones. I remember that someone had once showed me a way to delete objects based on ID, i think there was a code put into a game logic, but stupid me deleted it from the missions I was building. Does this seem familiar to anyone?

Share this post


Link to post
Share on other sites

The map ID number thing is going away, so don't get used to it.  Just use filters like "HOUSE" and "FENCE" and "HIDE" to remove things.  This will make it a desert wasteland (except for the stubborn mosque I can't seem to delete...):

{ 
    hideObjectGlobal _x;
    _x enableSimulation false; 
} forEach nearestTerrainObjects [player, ["HOUSE", "FENCE", "HIDE", "POWER LINES"], 1000];

Share this post


Link to post
Share on other sites

So no removing specific building types? If not I can make this work.

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

×