Jump to content
JohnKalo

Break Windows Only

Recommended Posts

This should have been easy to find but strangely I could not find anything. What I would like is to make the windows of a building break at a specific time.

We are not talking about a vanilla building but for a building located at the Lythium map. Think it is a Jbad building too. And if possible have them break with the needed sound. If the later is not possible I will just play a sound for the players.

Share this post


Link to post
Share on other sites
Quote

find windows hitpoints and iterate setting damage 1 on them 

 

How do you do that? Was only able to find the number of windows in the config file via the editor.

Share this post


Link to post
Share on other sites

I dunno, try getAllHitpointsDamage. This is what it returns for vanilla buildings, you can see which one is window hitpoint: [["hitzone_1_hitpoint","hitzone_2_hitpoint","glass_1_hitpoint","glass_2_hitpoint","glass_3_hitpoint","glass_4_hitpoint","glass_5_hitpoint","glass_6_hitpoint","glass_7_hitpoint","glass_8_hitpoint","glass_9_hitpoint"],["dam_1","dam_2","glass_1","glass_2","glass_3","glass_4","glass_5","glass_6","glass_7","glass_8","glass_9"],[0,0,0,0,0,0,0,0,0,0,0]]

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks! It worked!!!

The audio did not but I just replaced it with a custom audio file. Oh and I could not select the particular building on the map. For some reason:

 

nearestBuilding player setHit ["glass_1", 1]; 

 

did not work. Due to that I had to hide the building and place the same on as an object. Would be better if the above worked however :scratchchin:

Share this post


Link to post
Share on other sites

try something like:

((nearestTerrainObjects [player,["house","building","tourism"],20])#0) setHit ["glass_1", 1];

 

  • Thanks 1

Share this post


Link to post
Share on other sites

It worked for another building but not for the one needed. I have got the classname of the building when placed as an object. Can that help somehow? So as to replace the nearestTerainObjects condition. The building which needs to have its windows broken will be a specific one.

Share this post


Link to post
Share on other sites

Ehm this one: land_ffaa_casa_aeropuerto_torre  . It is a building coming with the Lythium map.

Share this post


Link to post
Share on other sites

Checked. (Nice map btw)

((nearestTerrainObjects [[12604.1,17779.2,0],["house"],5])#0) setHit ["glass_1", 1];

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you so much! It worked!!!

Only thing I had to change was the ,5 to a ,10. For some reason the distance had to be bigger on my end.

Share this post


Link to post
Share on other sites

Just to expand on this a little. How would I go about smashing all windows of all the buildings within an area?

 

I've tried: 

_windows = nearestObjects [player, ["house"], 200];
nearestBuilding player setHit ["glass_1",1] forEach _windows;

But the windows within doors, and the air control tower windows are unaffected.

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

×