thy_ 169 Posted February 12, 2023 Hi there. Not sure what I'm missing but the smoke sources (from Wiki) is not spawn on Dedicated Server. It should be called multiple times to create a fake artillery impact zone. As a hosted server, it works well. On the dedicated server, the shell craters and debris are fine, but the smoke is not shown. In the first file, I am: spawn { //<lot of code> [_kzPos, _kzRadius] spawn THY_fnc_ETH_cosmetic_UXO_impact_area; //<lot of code> }; And here is the function supposed to create the smoke sources through a radius: Down below, same block but editable if you want to copy lines: THY_fnc_ETH_cosmetic_UXO_impact_area = { // This function just creates a fake bomb impact area in a limited area pre-configured. Smoke templates: https://community.bistudio.com/wiki/Particles_Tutorial#Full_examples // Returns nothing. params ["_kzPos", "_kzRadius"]; private ["_smokePos", "_smokePosASL", "_smoke", "_grassRemover", "_terrainObjects"]; // Generate a random position inside a circle: _smokePos = _kzPos getPos [_kzRadius * sqrt random 1, random 360]; _smokePosASL = ATLToASL _smokePos; // if the smoke position is in the water, the current impact area creation is canceled: if ( (_smokePosASL select 2) < 0.2 ) exitWith {}; // 'select 2' = Z axis. // This remove the grass around: [_smokePos] spawn THY_fnc_ETH_cosmetic_grass_remover; // Crater decoration: //"Land_Decal_ScorchMark_01_small_F" createVehicle _smokePos; "Land_ShellCrater_01_F" createVehicle _smokePos; "Land_ShellCrater_02_debris_F" createVehicle _smokePos; // Remove all selected terrain objects from around the impact area: _terrainObjects = nearestTerrainObjects [_smokePosASL, ["FENCE", "TREE", "SMALL TREE", "BUSH", "WALL"], 2, false]; // [position ASL, [types], radius, sort, 2Dmode] { // forEach _terrainObjects: if ( isMultiplayer ) then { _x hideObjectGlobal true } else { _x hideObject true }; } forEach _terrainObjects; // Creating the smoke source: _smoke = "#particlesource" createVehicle _smokePos; _smoke setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 16, 0], "", "Billboard", 1, 8, [0, 0, 0], [0, 0, 1.5], 0, 10, 7.9, 0.066, [1, 3, 6], [[0.5, 0.5, 0.5, 0], [0.5, 0.5, 0.5, 0.15], [0.5, 0.5, 0.5, 0.15], [0.5, 0.5, 0.5, 0.1], [0.75, 0.75, 0.75, 0.075], [1, 1, 1, 0]], [0.25], 1, 0, "", "", _smoke]; _smoke setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; _smoke setDropInterval 0.05; // Return: true; }; 🤕 Share this post Link to post Share on other sites
Harzach 2518 Posted February 12, 2023 I believe the issue is that while createVehicle is GE, all of the "setParticleX" commands are LE, so they need to be remoteExec'd. 1 Share this post Link to post Share on other sites
POLPOX 779 Posted February 13, 2023 A particle effect is a local object and cannot be a remote object. You need to create it to every other machines as well. 3 1 Share this post Link to post Share on other sites
Harzach 2518 Posted February 13, 2023 So in that case, I guess createVehicleLocal should be used, along with remoteExec. *edit* - or call the function locally 2 Share this post Link to post Share on other sites
thy_ 169 Posted February 13, 2023 https://community.bistudio.com/wiki/createVehicleLocal and then: Should I get worried as my script is executed like this? // File: THY_ETH_functions.hpp class THY_ETH_functions { tag = "THY"; class ETHICSMinefields { file = "ETHICSMinefields"; class ETH_management { preInit = 1; }; class ETH_globalFunctions { preInit = 1; }; }; }; Share this post Link to post Share on other sites
Harzach 2518 Posted February 13, 2023 The createX command isn't being instigated from within either of those functions, and you aren't creating any vehicles that are from a mod/addon, so from my admittedly limited understanding you should be fine. 1 1 Share this post Link to post Share on other sites
pierremgi 4915 Posted February 13, 2023 On 2/13/2023 at 2:18 PM, thy_ said: https://community.bistudio.com/wiki/createVehicleLocal and then: Should I get worried as my script is executed like this? Probably. This warning worth for mods. Just try it in your case. Particle effects should stay local for better performance. Generally it's useless trying to synchronize server and clients with that stuff. That don't mind if all players can't see the exact same clouds/particles/smokes... So, DON'T REMOTEEXEC anything like this. I wrote a nuke with mushroom, lightnings, hashes, working locally and no performance issue. You just need to RUN THE CODE EVERYWHERE, at the right time. Note: weather is also demanding, so "periodically synchronized with the server". I duno the periodicity. 2 Share this post Link to post Share on other sites
thy_ 169 Posted February 13, 2023 In hosted server, the code down below is working fine, but not been tested in my Dedicated server yet (waiting to understand better how to use the RemoteExec here). The cosmetic smokes get started here: // Creating cosmetic impact craters with smokes: if ( ETH_cosmeticSmokesUXO ) then { // Updating values: _players = call THY_fnc_ETH_players; // Looping: for "_i" from 1 to 10 do { // each crater and debris: _impactPos = [_kzPos, _kzRadius] call THY_fnc_ETH_cosmetic_UXO_impact_area_crater; //for some reason if I use SPAWN instead of CALL that's printing an error: typed script, expected array. // each smoke for each player: { [_x, _impactPos] spawn THY_fnc_ETH_cosmetic_UXO_impact_area_smoke } forEach _players; }; }; And through that FOR looping, these 2 steps down below happen: Step 1/2 = Global result: THY_fnc_ETH_cosmetic_UXO_impact_area_crater = { // This function just creates a fake bomb impact crater in a limited area pre-configured. // Returns _impactPos: array [x,y,z] params ["_kzPos", "_kzRadius"]; private ["_impactPos", "_impactPosASL", "_terrainObjects"]; // Generate a random position inside a circle: _impactPos = _kzPos getPos [_kzRadius * sqrt random 1, random 360]; _impactPosASL = ATLToASL _impactPos; // if the smoke position is in the water, the current impact area creation is canceled: if ( (_impactPosASL select 2) < 0.2 ) exitWith { _impactPos = []; _impactPos /*returning*/ }; // This remove the grass around: [_impactPos] spawn THY_fnc_ETH_cosmetic_grass_remover; // Crater decoration: "Land_ShellCrater_01_F" createVehicle _impactPos; "Land_ShellCrater_02_debris_F" createVehicle _impactPos; // Remove all selected terrain objects from around the impact area: _terrainObjects = nearestTerrainObjects [_impactPosASL, ["FENCE", "TREE", "SMALL TREE", "BUSH", "WALL"], 5, false]; { // forEach _terrainObjects: if ( isMultiplayer ) then { _x hideObjectGlobal true } else { _x hideObject true }; } forEach _terrainObjects; // Return: _impactPos; }; Step 2/2 = Local result: THY_fnc_ETH_cosmetic_UXO_impact_area_smoke = { // This function creates a smoke source in a limited area pre-configured. Smoke templates: https://community.bistudio.com/wiki/Particles_Tutorial#Full_examples // Returns nothing. params ["_player", "_impactPos"]; private ["_impact"]; // Error handling: if ( ((count _impactPos) == 0) OR (_player == objNull) ) exitWith {}; // Creating the smoke source (crucial the smoke be created in local players because particle effect cannot be global): _impact = "#particlesource" createVehicleLocal _impactPos; _impact setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 16, 0], "", "Billboard", 1, 8, [0, 0, 0], [0, 0, 1.5], 0, 10, 7.9, 0.066, [1, 3, 6], [[0.5, 0.5, 0.5, 0], [0.5, 0.5, 0.5, 0.15], [0.5, 0.5, 0.5, 0.15], [0.5, 0.5, 0.5, 0.1], [0.75, 0.75, 0.75, 0.075], [1, 1, 1, 0]], [0.25], 1, 0, "", "", _impact]; _impact setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; _impact setDropInterval 0.05; // Return: true; }; By the way, just to let you know, folks, I have no clue how to convert the line below to remoteExec format, and after @pierremgi message, I think remoteExec is not needed anymore (!?) or is there space for more ideas/methods? _impact = "#particlesource" createVehicleLocal _impactPos; Share this post Link to post Share on other sites
thy_ 169 Posted February 13, 2023 I already tried, but not working even in the hosted server... just errors like "type string, expected object". _impact = [_impactPos] remoteExec ["createVehicleLocal", _player, "#particlesource"]; _impact = ["#particlesource"] remoteExec ["createVehicleLocal", _player, _impactPos]; _impact = [_impactPos, "#particlesource"] remoteExec ["createVehicleLocal", _player]; _impact = ["#particlesource", _impactPos] remoteExec ["createVehicleLocal", _player]; Someone can gimme a support about this conversion to removeExec syntax? Share this post Link to post Share on other sites
Larrow 2827 Posted February 14, 2023 (edited) // Creating cosmetic impact craters with smokes: if ( ETH_cosmeticSmokesUXO ) then { // Looping: for "_i" from 1 to 10 do { // each crater and debris: _impactPos = [_kzPos, _kzRadius] call THY_fnc_ETH_cosmetic_UXO_impact_area_crater; //you cannot spawn it as you require a return value of impact pos // local particle effect for all clients [_impactPos] remoteExec [ "THY_fnc_ETH_cosmetic_UXO_impact_area_smoke", [ 0, -2 ] select isDedicated ]; }; }; Remote execute the particle function on all machines (0) or every client (-2) if it's a dedicated server. May want to include JIP? EDIT: Not the tidiest way to achieve it as each time you are creating 10 remote calls (and possibly 10 items in the JIP queue) but quickest as an example using your code. No need to know the player in the function so removed from the above remoteExec for THY_fnc_ETH_cosmetic_UXO_impact_area_smoke, so function params need to change to match... THY_fnc_ETH_cosmetic_UXO_impact_area_smoke = { // This function creates a smoke source in a limited area pre-configured. Smoke templates: https://community.bistudio.com/wiki/Particles_Tutorial#Full_examples // Returns nothing. params ["_impactPos"]; //snip [_impactPos] remoteExec [ "THY_fnc_ETH_cosmetic_UXO_impact_area_smoke", [ 0, -2 ] select isDedicated, true ]; passed params function to call where to call also for JIP Edited February 14, 2023 by Larrow 1 1 Share this post Link to post Share on other sites
thy_ 169 Posted March 10, 2023 Thanks, @Larrow I'll try to test this on the dedicated server in the next days and, of course, I'll come back with the result. Share this post Link to post Share on other sites