theend3r 83 Posted July 26, 2016 The best option would be to create it in the editor and just enable / disable is as needed. Is there a function like that? I think you can activate a module with a trigger but probably not deactivate it. So far I have a trigger with a repeatable condition of player not being in a mortar (will also add the condition of no mortar rounds in air later), this in on activation: simMan = "logic" createVehicle (getPos player); simMan setVariable ["radius", 100]; // for testing purposes, will be 1500 in mission simMan setVariable ["excludeAir", true]; simManHandle = [simMan] spawn BIS_fnc_moduleSimulationManager; and this on deactivation: terminate simManHandle; deleteVehicle simMan; I have three problems: It doesn't work I'm not sure if the setVariable command should be used like this, I tried to understand the function by reading it but... ugh The deactivation part would probably leave everything frozen (can't confirm) Share this post Link to post Share on other sites
jwllorens 43 Posted July 27, 2016 I might be able to help. I am new to ArmA scripting but I have a functional cerebrum and I am working on an ArmA project of my own. If you could explain some aspect of your question, I think we could both benefit. What does "BIS_fnc_moduleSimulationManager" do and more importantly, what are you "expecting" it to do? Also, is this intended for multiplayer? It seems like you want to disable simulation on some distant units or objects, but enable simulation on them if the player is in a mortar or if any projectiles fired by a mortar vehicle occupied by the player still exist. This would make sense if your mission has a lot of units and you are trying to limit overhead by only simulating the ones within a certain range of the player. However, since artillery has an enormous range, exceptions would need to be made for this. In multiplayer, however, I see nothing wrong with leaving simulation disabled on distant units unless another player is near the units that are being targeted by the artillery, though this could be circumvented as well if needed. Share this post Link to post Share on other sites
theend3r 83 Posted July 27, 2016 It's for SP / co-op. The enemy has some mortars placed in camps which the player can use to do some blind fire on expected enemy positions (the mission starts with a halo jump so you see a lot with ENVGs). I have quite high density of units leading to bad performance which increases dramatically when you use simulation manager. Anyway, I just need to be able to enable / disable the module (a general solution for all modules would be the best, if possible) or at least delete and spawn it as needed. Extending the range beyond the AO would work too, I guess. I'm not sure that's even possible, though. Share this post Link to post Share on other sites
Larrow 2822 Posted July 31, 2016 simManHandle = [simMan] spawn BIS_fnc_moduleSimulationManager; This will not return the handle of the FSM but the handle of the spawned code BIS_fnc_moduleSimualtionManager. A FSM compiled via the functions library is in fact a script that all it does is execFSM the FSM and returns the handle so you need to call it to get the returned handle.. simManHandle = [simMan] call BIS_fnc_moduleSimulationManager; The handle returned from execFSM is actually a number not a script handle and is used in completedFSM and get/setFSMVaraible. There is no way that i am aware of to terminate a FSM unless it has been programmed with an exit condition, of which the simulation manager does not have. To do what you want to do there is a global variable called BIS_persistent that you can fill with units/vehicles that you do not want the simulation manager to handle. This can be updated on the fly and will cause the simulation manager to update its hidden objects. So you could try a couple of things.. Either when the player gets in a mortar update the simulation managers range using setFSMVariable on _freezeDist to encompass the mortars capable distance. This could lead to a lot of unneeded units being revealed. Or monitor any fired rounds and approximate its impact position, capture all units/vehicles in explosive area and add them to BIS_persistent, after the round has become null remove the units from BIS_persistent. Share this post Link to post Share on other sites