Jump to content
Sign in to follow this  
ziiip

Setting damage value of buildings?

Recommended Posts

Hi guys, can someone tell me how to set the damage value of buildings in the mission editor? I wanna make a "ghost town" with all the houses partially or completely destroyed right from the start. Thanks!

Share this post


Link to post
Share on other sites

Level a town:

Place a logic in the middle of the town.

Put this into its init field:

{_x setDamage 1} forEach (nearestObjects [this, ["House"], 100]);

(Where 100 is the destruction radius)

Share this post


Link to post
Share on other sites

Can I do the same to fences? Loosk kinda funny that all houses have been dozered but every fence is standing.

Share this post


Link to post
Share on other sites
Can I do the same to fences? Loosk kinda funny that all houses have been dozered but every fence is standing.

Sure. Do you see that array with "House" in it?

{_x setDamage 1} forEach (nearestObjects [this, ["House"], 100]);  

Feel free to put as many classes in there as you like. Fences, walls,.. just look it up in the CfgVehicles.

Share this post


Link to post
Share on other sites

I checked the armaholic unit library but didnt find the fence, only the wooded gates. :confused:

Share this post


Link to post
Share on other sites
I checked the armaholic unit library but didnt find the fence, only the wooded gates. :confused:

Please people read. You are supposed to look for CfgVehicles and not some armaholic unit library... (where did that come from?!).

There you will find the class names you're looking for, though I suggest you simply use "Building", which includes Houses and Fences and many other stuff.

And really, is it too much to ask, that you look up the command you're using by yourself? All the information needed is there. Just RTFM.

A list of ClassName types (Tanks eg) can be found in CfgVehicles

It's right there... nearestObjects.

always these lazy bones in here... :rolleyes:

Edited by ruebe

Share this post


Link to post
Share on other sites

It's all good ziip, the stuff you're looking for isn't exactly as easy to find as changing weapons on a unit or something. :) Plus biki's seach tool is worthless, so even if you know exactly what you're looking for you can't find it sometimes.

Share this post


Link to post
Share on other sites
Can I do the same to fences? Loosk kinda funny that all houses have been dozered but every fence is standing.

_objects = (nearestObjects[_pos, [], _blast_radius]) - (nearestObjects[_pos, ["All"], _blast_radius]);

{ 
 _x setDamage 1;
} forEach _objects;

Share this post


Link to post
Share on other sites

Replacing "Houses" or "All" with [] will make it include every imaginable object, not just the ones with classnames.

Share this post


Link to post
Share on other sites

The code finds the objects with no class - like trees and fences. It works exactly as intended.

Share this post


Link to post
Share on other sites

Your help is deeply appreciated guys. :)

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  

×