JohnKalo 657 Posted October 23, 2019 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
killzone_kid 1333 Posted October 23, 2019 find windows hitpoints and iterate setting damage 1 on them 1 Share this post Link to post Share on other sites
JohnKalo 657 Posted October 23, 2019 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
killzone_kid 1333 Posted October 23, 2019 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]] 1 Share this post Link to post Share on other sites
JohnKalo 657 Posted October 24, 2019 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 Share this post Link to post Share on other sites
pierremgi 4906 Posted October 24, 2019 try something like: ((nearestTerrainObjects [player,["house","building","tourism"],20])#0) setHit ["glass_1", 1]; 1 Share this post Link to post Share on other sites
JohnKalo 657 Posted October 24, 2019 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
pierremgi 4906 Posted October 24, 2019 which classname? Share this post Link to post Share on other sites
JohnKalo 657 Posted October 25, 2019 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
pierremgi 4906 Posted October 25, 2019 Checked. (Nice map btw) ((nearestTerrainObjects [[12604.1,17779.2,0],["house"],5])#0) setHit ["glass_1", 1]; 1 1 Share this post Link to post Share on other sites
JohnKalo 657 Posted October 27, 2019 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
Cartoonrboy 0 Posted March 8, 2020 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