revide 33 Posted July 12, 2016 Hey community. Is there a way to get ALL destroyed buildings on a Map and auto-rebuild them, like a Map reset, but without restart. I've seen solutions with triggers on the buildings itself, which is not quite suitable if the whole map should be affected. Open for any ideas, thanks. Share this post Link to post Share on other sites
badluckburt 78 Posted July 12, 2016 The most efficient way would be to register destroyed building positions in an array. I don't know if there is an eventHandler for destroying buildings, had a quick glance at the BIKI but it doesn't look like it: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers Then again, since we're all verhicles in the Armaverse, maybe buildings also trigger the Killed event? And there's always brute-force: call nearestBuildings with a sufficiently large radius, loop through the returned buildings and resurrect whatever needs resurrecting. Share this post Link to post Share on other sites
revide 33 Posted July 12, 2016 yea thats what I thought as well, but the efficiency is quite a pain in the ***. :') MP or SP? MP but There are no MP handlers doing that. @BI that would be awesome, eventHandler for buildings. Im going to look into the killed thing with building, maybe they call it. Share this post Link to post Share on other sites
sarogahtyp 1108 Posted July 12, 2016 I would save all map buildings in an array at mission start and use that to check for destroyed buildings later. Share this post Link to post Share on other sites
das attorney 858 Posted July 12, 2016 Have a read through this. http://killzonekid.com/arma-scripting-tutorials-scripted-charges-v2/ You might want to check yourself but setDamage on the destroyed buildings does not sync for JIP players (as map objects are local to everyone) so you end up with different people seeing different things. (Unless you don't have JIP and then it's not a problem). But if you do try and sync it all up (esp over the whole map) then you end up with bandwidth problems. I was doing a similar thing a while ago and gave up as once you add a few players during the game, it red-chains like crazy. Share this post Link to post Share on other sites
revide 33 Posted July 12, 2016 Read through it, I like the shockwave simulation :D. Well his PostScript says that setDamage is now JIP compatible. I would now just have to cache in all the builds that got destroyed and reset them to setDamage 0. Well an event Handler would make that possible. Share this post Link to post Share on other sites
das attorney 858 Posted July 12, 2016 Ok cool I didn't know that had changed. In that case, add a killed EH to every building during init and build an array through the game. Then access the array when you run your reset command and every destroyed building should be back to normal. Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted July 13, 2016 Or use an EntityKilled missionEventhandler, no idea if it works for buildings though. Cheers Share this post Link to post Share on other sites
barbolani 198 Posted July 22, 2016 Im at work, but I would say nonononono to almost everything. Yes, you can add an EH to buildings. I've done it to Radio Towers in Antistasi. The owner of the buildings regarding the EH is the server. But you cannot do a super simple _building setDamage 0; Because in arma engine, the alive object seems to no longer exist and it is replaced with another object with the damaged model. So. You need to store in the array the exact position, model, dir etc.. of the building. Then, hideObjectGlobal the destroyed model (you won't be able to do it with every kind of building, at least RT no) and createVehicle a new one with the params you stored. Share this post Link to post Share on other sites
revide 33 Posted July 22, 2016 Im at work, but I would say nonononono to almost everything. Yes, you can add an EH to buildings. I've done it to Radio Towers in Antistasi. The owner of the buildings regarding the EH is the server. But you cannot do a super simple _building setDamage 0; Because in arma engine, the alive object seems to no longer exist and it is replaced with another object with the damaged model. So. You need to store in the array the exact position, model, dir etc.. of the building. Then, hideObjectGlobal the destroyed model (you won't be able to do it with every kind of building, at least RT no) and createVehicle a new one with the params you stored. Yea ran into that as well, didn't bothered to post this. But this is kinda screwed up. BI pls, give us some commands for hardReset whole map. Similar to the deadCorpseHandler that manages the disappearance of dead corpses. Just reset a building after it has been destroyed after certain circumstances. Share this post Link to post Share on other sites
Tajin 349 Posted July 22, 2016 Can't help but wonder why exactly you don't want to do a restart? If the map really got messed up then this would be much better for performance, especially in the long run. Just save any variables and settings you need, make a quick restart and load your data again. ps.: I've read your thread about that project you're working on (I assume this is related)... maybe we should talk :) Share this post Link to post Share on other sites