Jump to content
Sign in to follow this  
hypno toad

2 questions about buildings:

Recommended Posts

Is there a way to remove preset buildings and bridges? I am trying tor remove part of the overpass in corazol.

Also, I want to place fence objects, but I want them to be indestructible, how do I go about doing that?

Any help would be appreciated.

Share this post


Link to post
Share on other sites

You can destroy (setDammage) map object as well.

Back in OFP it worked with (map) IDs. Now you have to do it

in a different fashion. Cannot remember the details though.

The biki should help you.

Share this post


Link to post
Share on other sites

Hi mate,

To destroy buildings on the map if this is what u want to do can be done like this

(position gl1 nearestobject objectnumber) setdammage 1

gl1 - is the name of a gamelogic which i think needs to b placed within 50metres or sumthin of the building u want destroying,but u can name the gamelogic anything u want that was just an example....

objectnumber - is obviously the ID number of the building u want destroying.

As for fences etc....If you have editor update v102(i think) u will find fences etc....in the mission editor under empty an im pretty sure they are not destructible for some reason,cant remember but i think AI will still just walk through them as if they wernt ther,again not 100% on that but im pretty sure thats the case.

Hope this helps in some way.

All the best

Dan

Share this post


Link to post
Share on other sites

If you're going to do that, you'll also most likely be wanting to deletevehicle the ruble that's created as well.

This is something I did for a mission I recently released called No Way Out Part 1.

It converts the prison camp at Ii40 into a large fuel dump.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// This script turns the Prison Complex at Ii40 into a large fuel dump by the following means:

// 1: Destroy Prisoner Barracks.

// 2: Delete Ruble Caused by Destruction.

// 3: Place 3 Large Fuel tanks where each Barracks was.

// 4: Broadcast the New Fuel tanks in an array to all machines, to enable tracking of their status. (CSL_FuelDumpIi40Tanks)

// 5: Covers up the prisoner graves with a building and a few junk heaps behind the building.

// 1: Destroy Prisoner Barracks.

sleep 1;

_dumpPosition = [17799.4, 12394.1, 0];

_objects = _dumpPosition nearObjects ["Land_budova1", 40];

_positionArray = [];

{_positionArray = _positionArray + [getPos _x]} forEach _objects;

{_x setDamage 1} forEach _objects;

// 2: Delete Ruble Caused by Destruction.

sleep 1;

_objects = _dumpPosition nearObjects ["Land_budova1_ruins", 40];

{deletevehicle _x} forEach _objects;

if (isServer) then

{

// 3: Place 3 Large Fuel tanks where each Barracks was.

sleep 1;

{ //forEach _positionArray;

_currentPos = [(_x select 0) + 5, (_x select 1) + 5, _x select 2];

_object = "Land_Fuel_tank_big" createVehicle _currentPos; _object setPos _currentPos;

_currentPos = [(_x select 0) + 5, (_x select 1) + 0, _x select 2];

_object = "Land_Fuel_tank_big" createVehicle _currentPos; _object setPos _currentPos;

_currentPos = [(_x select 0) + 5, (_x select 1) - 5, _x select 2];

_object = "Land_Fuel_tank_big" createVehicle _currentPos; _object setPos _currentPos;

} forEach _positionArray;

// 4: Broadcast the New Fuel tanks in an array to all machines, to enable tracking of their status. (CSL_FuelDumpIi40Tanks)

_objects = _dumpPosition nearObjects ["Land_Fuel_tank_big", 40];

CSL_FuelDumpIi40Tanks = _objects;

PublicVariable "CSL_FuelDumpIi40Tanks";

// 5: Covers up the prisoner graves with a building and a few junk heaps behind the building.

_currentPos = [17712.177734, 12371.220703, 0];

_object = "Land_budova2" createVehicle _currentPos;

_object setDir 180;

_object setPos _currentPos;

_currentPos = [17704.904297, 12361.605469, 0];

_object = "Land_kostel_trosky_ruins" createVehicle _currentPos;

_object setDir 270;

_object setPos _currentPos;

_currentPos = [17708.988281, 12361.810547, 0];

_object = "Land_kostel_trosky_ruins" createVehicle _currentPos;

_object setDir 90;

_object setPos _currentPos;

};

Calling it from init.sqf, without regard as to what machine it's being run on in an mp environment, as the script takes care of that itself.

There is one catch with this though. Sometimes, arma doesn't like to replace *all* the destroyed buildings for the next mission. Stupid bug, I know, but there's basically nothing we can do about it.

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  

×