Jump to content
Sign in to follow this  
woodstock

BOOM! Tryin gto level an area. Need some help.

Recommended Posts

Her's the init line I'm using in a gamelogic unit:

{_x setdamage 1; } foreach nearestObjects [0,0,0, ["ANY"],25];

Where:

{_x setdamage 1; } foreach nearestObjects [Position, ["ANY"],radius];

Got this from an old Arma 2 post. How can I make it work in Arma 3 to level an area?

Thanks,

Woodstock

Share this post


Link to post
Share on other sites

try this

[url="https://community.bistudio.com/wiki/nearObjects"][i]position [/i]nearObjects [i]radius [/i]or [[i]typeName[/i], [i]radius[/i]][/url]

EDIT:

Just realised I gave you the same command on this topic.....

Edited by KevsnoTrev
cross topics?

Share this post


Link to post
Share on other sites

{_x setdamage 1; } foreach nearestObjects [[0,0,0], [],25];

This will also get objects without a class. (trees, rockets and other stuff).

Passing the array ["All"] is not the same and will only return objects that have some sort of class.

Edited by mindstorm

Share this post


Link to post
Share on other sites

Mindstorm - no errors but no effect. Is this the correct syntax for ArmA 3? I'm using this as an init line in a gamelogic unit. Should the setdamage come last? I played around a bit but keep getting syntax errors.

Thank you. I'm learning from scratch here.

Woodstock

Share this post


Link to post
Share on other sites

no effect because it is at 0,0,0 coordinates and the radius is only 25 metres. you need to move it next to you to see.

Share this post


Link to post
Share on other sites

i use that and it works great. Where you place it is the center destroying most buildings, and moves outward in a circle doing less damage the further away from the center. Here's mine, Variable definitions are copy pasted from the wiki. Anyone know what seed means? I just left 42 bc its on the example in the wiki.

["epicenter1",300,42] call bis_fnc_destroyCity;

Variables

position: Array (in format position) or Object (object position) or String (marker position)

areaSize (Optional): Number - area diameter (default is 1000)

seed (Optional): Number - random seed (default is 1138)

blacklist (Optional): Array of blacklisted objects (default is an empty array)

Share this post


Link to post
Share on other sites

So make a maker on the map where you wanna destroy a city. Call it whatever you want.

Then:

{_x setdamage 1; } foreach nearestObjects [getMarkerPos "yourmakername", [],500];

Alternatieve you can use the above function soolie named:

["yourmakername",500,42] call bis_fnc_destroyCity;

The seed is a random used to calc the amount of damage done. Just to make sure the destroy looks different each time.

Share this post


Link to post
Share on other sites

OK. What the hell? Neither of these work.

1. We're talking ArmA 3 right?

2. I'm using the code as init in a game logic unit.

3. Using code verbatim as above and inserting the name of my game logic unit, or another object, as the "yourmarkername" variable.

No damage at all. Am I missing something I need to move over from ArmA 2?

Woodstock

Share this post


Link to post
Share on other sites

put this in your player init field

player allowDamage false; {if (_x != player ) then {_x setdamage 1;} } foreach nearestObjects [position player, [], 500];

it will destroy everything that can be destroyed in 500 metres radius

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  

×