Graz 1 Posted January 17, 2013 The title says it all. I've tried a few ways, dropping vehicles on them, spawning grenades using a script. It doesn't feel very efficient, is there a way to set the damage on buildings in the editor? I'm talking about the buildings that come with maps, not ones you put in yourself! In particular I'd like some partial destruction to the buildings, similar to if they'd been hit by a tank shell, does anyone know a way to do this? Share this post Link to post Share on other sites
cuel 25 Posted January 17, 2013 Game logic with init: {_x setDamage 1} forEach nearestObjects [getPos this,["House"],50] Where "1" is the damage and "50" is the radius. There's also this: http://community.bistudio.com/wiki/BIS_fnc_destroyCity Requires the functions module placed in the mission. Share this post Link to post Share on other sites
Graz 1 Posted January 18, 2013 Oh that's lovely! Tested and leveled a whole town, which is just amazing. How about partial destruction? Would it just be simplest to spawn an artillery shell where I want the damage? Share this post Link to post Share on other sites
cuel 25 Posted January 18, 2013 IIRC BIS_fnc_destroyCity does random damage. You could also do something like {_x setDamage (random 1)} forEach nearestObjects [getPos this,["House"],50] Share this post Link to post Share on other sites
Graz 1 Posted January 18, 2013 (random 1) is completely healthy or destroyed correct? To damage a building you need fractions such as .8 or .5. Maybe ((random 2) x .5)? Share this post Link to post Share on other sites
cuel 25 Posted January 18, 2013 It's any value between 0 and 1 (or 0.99999?) where 1 is destroyed and 0 unharmed. Example output of (random 1): 0.544556 0.723143 0.28362 0.646472 0.619013 0.952674 0.586006 0.996777 0.76457 0.679428 0.449635 Share this post Link to post Share on other sites
Graz 1 Posted January 18, 2013 Yahtzee, Any idea what seed means? I must be automatically writing floor into the random, which would be why it's being more extreme! Hopefully I can use a combination of destroy cities function and the leveling one. Share this post Link to post Share on other sites
cuel 25 Posted January 18, 2013 http://en.wikipedia.org/wiki/Random_seed Share this post Link to post Share on other sites