Jump to content
Sign in to follow this  
ChrisFox

Destroyed buildings

Recommended Posts

Hello,

I was wondering how I can make buildings (in let's say Corazol) be destroyed without destroying them yourself (like 'wrecked' buildings). I want to let Corazol look like a warzone city, and therefore I need to have half of the buildings destroyed already at the start of the misison. How can I get that done?

THnx!

Share this post


Link to post
Share on other sites

Euhm...ok and how do I do that .. ? (note I'm a noob in scripting / editing) help.gif

Share this post


Link to post
Share on other sites

I know u can use <unitname> setDamage 1 in the Init field of objects, but for buildings you don't have such a field so....how's that done with triggers/scripts ?? icon_rolleyes.gif  Thnx

Share this post


Link to post
Share on other sites

In the editor you have a button with "Show Ids" on it. If you click that lots of numbers will show up on the map.

Use the numbers in conjunction with the nearestobject command instead of unitname.

You could place a gamelogic in corazol and name it cora1. Then put some of the id numbers within 50m of the gamelogic into the init field of the gamelogic or into a trigger/script.

fx:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">((getPos cora1) nearestObject 123456) setDamage 1;

You could also try something like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x setDamage 1} forEach (nearestObjects [cora1, ["house"], 70];

The latter might destroy all the houses in a 70 meter radius around the gamelogic...

Share this post


Link to post
Share on other sites

THnx alot. The first one works for sure smile_o.gif Pitty though BI made the ruins so flat (with hardly any walls left), but whatever :P

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  

×