wogz187 1086 Posted November 16, 2020 (edited) Here's a couple fire related functions,you_createFire, Spoiler //"_size": "small", "medium", "big" //"_type": "fire", "smoke" //"_pos": object to set on fire //"_arr": array to save effects into you_createFire= { params [["_size", "", []], ["_type", "", []], ["_pos", objNull, []], ["_arr", [], []]]; private _fireType= format ["%1Destruction%2", _size, _type]; private _emitter = "#particlesource" createVehicle (getPos _pos); _emitter setParticleClass _fireType; _arr pushBack _emitter; }; //button [player, "Set Fire", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "alive _this", "isNull objectParent _this", {}, {}, { private _obj= cursorObject; ["medium", "fire", _obj] call you_createFire; }, {}, [], 5, 12, false, false, true] call BIS_fnc_holdActionAdd; Not super-useful. The interesting part is the method of formatting emitter class. *Updated you_fnc_houseFire (demo), Burn buildings to the ground! Spawn one central fire with smoke and a number of FX fires (performance) in the building. The building takes damage over time. Once the building is destroyed the performance fires are deleted and later the main fire. Fire will spread based on the distance supplied to the function ("_dist"). Use the parameter "_damage" (default true) to make persistent fire that does not damage the building over time or spread to other buildings.* Use parameter "_time" to determine how long each building will burn (default: 10, demo: 1). 1 second is equal to 20 seconds total burn (each iteration is %10 damage) and the main fire burns for the same amount of time again (1x10x2). The default value is 10 or 200 seconds (100 to collapse and 100 more to extinguish). 1) create a helper object on/near the building(s) ** 2) paste the function in init.sqf (or wherever) 3) see call methods in demo init.sqf * keep track of effects in the supplied array ** editor placed buildings may be "_caller" Have fun! Edited November 17, 2020 by wogz187 updated (fire propagation, lighting) 6 1 Share this post Link to post Share on other sites
wogz187 1086 Posted November 17, 2020 Added fire propagation to you_fnc_houseFire and updated demo. Calling the function with a short distance (~10m) will prevent the fire from spreading. Calling a far distance (~200) will enable the fire to spread across a whole town. The fire will extinguish itself when it runs out of targets. Have fun! 1 Share this post Link to post Share on other sites
froggyluv 2135 Posted November 17, 2020 Hey nice man -does this fire burn units as well? 1 Share this post Link to post Share on other sites
wogz187 1086 Posted November 17, 2020 (edited) @froggyluv, The fire will not spread to units (it won't set them on fire) but it does damage and so do collapsing buildings. *update The lighting effect had to match the performance theme of the script. This turned out to be pretty easy. The default "big fire" light is sufficient and we only spawn one at a time. Have fun! Edited November 17, 2020 by wogz187 added lighting 4 Share this post Link to post Share on other sites
zagor64bz 1225 Posted November 18, 2020 Wow..this is FUN!! Good job, as usual, my friend. 2 Share this post Link to post Share on other sites
Melody_Mike 130 Posted April 8, 2021 Great script! Have a question, however. I am attempting to burn down a series of tents. The fire starts, damages, and spreads fine between buildings and regular tents (Land_MedicalTent_01_white_generic_inner_F and related). But not for Connector Tent objects (Land_ConnectorTent_01_white_open_F and Land_ConnectorTent_01_white_cross_F). My first guess was that the two family of classnames used in _buildingARR ( ["House", "Building"] ) didn't include those. However isKindOf "Building" returns true for the connector tents. Anyone got any ideas? Thanks! PS And is there any way of getting the fire to branch out and burn multiple buildings? Share this post Link to post Share on other sites
mattis 147 Posted April 8, 2021 Will damage stay persistent, meaning, will a burned out building stay in the damaged state over a series of missions in the same area? Share this post Link to post Share on other sites
Melody_Mike 130 Posted April 8, 2021 @mattis Although the "garbage collector" removes dead AI and vehicles outside of player range, as long as the mission runs, damage to vegetation and terrain objects remain. You can do tasks, without this kind of damage re-setting. Or did you mean something else? Share this post Link to post Share on other sites
wogz187 1086 Posted April 8, 2021 @Melody_Mike, The script is looking for a minimum number of building positions within the selected building, perhaps the connector tent doesn't have enough positions (it's 2, I think). You're more than welcome to comment the line below and see if that allows these objects to burn-- it almost certainly will-- but may also cause other nearby non-building type things to burn (like random fences). _buildingARR = [_buildingARR, [], {_x distance _caller}, "ASCEND",{count (_x buildingPos -1) > 1}] call BIS_fnc_sortBy; @mattis, There is no mechanism in the script to record building damage in a meaningful way. That sure is an interesting idea though... Have fun! 2 Share this post Link to post Share on other sites
Melody_Mike 130 Posted April 8, 2021 Thank you for the reply. Were you referring to this line: _pos = _pos call BIS_fnc_arrayShuffle; ? I commented that out, but did not really change the behavior of the function. Just thinking out loud: could I just call another instance of you_fnc_houseFire after some time, in order to get multiple tents to burn simultaneously (from a single source)? 1 Share this post Link to post Share on other sites
wogz187 1086 Posted April 8, 2021 @Melody_Mike I posted the wrong line. This is the line that filters out non-building buildings, _buildingARR = [_buildingARR, [], {_x distance _caller}, "ASCEND",{count (_x buildingPos -1) > 1}] call BIS_fnc_sortBy; And yes you can have multiple instances running simultaneously. Share this post Link to post Share on other sites
Melody_Mike 130 Posted April 9, 2021 Yes, that was the line. The function did a pretty spectacular job of burning down my camp =]! And yes, as warned, it also put the metal fences and concrete barriers on fire. If only there was another way to filter those out, or predefine a burn area. You've helped enough. I will try to figure this out on my own. Thanks! 1 Share this post Link to post Share on other sites
mattis 147 Posted April 9, 2021 1 hour ago, Melody_Mike said: @mattis Although the "garbage collector" removes dead AI and vehicles outside of player range, as long as the mission runs, damage to vegetation and terrain objects remain. You can do tasks, without this kind of damage re-setting. Or did you mean something else? Yes, but my question wasn't worded correctly or specifically enough. If the mission is on the server, but the mission is stopped to run a training mission say for example and the same original mission file is restarted to continue the original Operation, would building reset to normal view? (I suspect so, but I want to make sure) Share this post Link to post Share on other sites
wogz187 1086 Posted April 9, 2021 @mattis, Sure. The script has no mechanism to accomplish this so it would be based on the default behavior of the engine or the specific behavior of the scenario. It seems to me that recording damage states and reapplying this state when the scenario is reinitialized would be totally do-able. Reapplying the burning status to buildings would be achieved in a similar way. Like I said, it's a great idea. I've never seen that on this forum-- recording environmental damage to a profile nameSpace or some persistent variable-- but of course this can be done. 1 Share this post Link to post Share on other sites
The Real Bunc 137 Posted April 11, 2021 This is a good effect. I had a script once ( I think I downloaded it from somewhere) that gave a chance of starting a bushfire if you were shooting tracer rounds or through explosions and there was low humidity and the bush fire could spread to trees. I'm sure I have it somewhere but haven't been able to find it again. Yours is a nice effect for towns. 1 Share this post Link to post Share on other sites