Jump to content
Sign in to follow this  
Graz

Damaging buildings on mission start

Recommended Posts

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

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

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

(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

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×