Buildings destroyed by 3DEN Editors "Edit Terrain Object" module are not working properly in multiplayer missions on dedicated servers. Target building doesn't appear destroyed for players but instead ruins are shown in addition to original building which appears undamaged.
- Operating System
- Windows 7 x64
- Operating System Version
- Create multiplayer mission and put "Edit Terrain Object" module on some building that is originally in the map.
- Select "destroyed" state from module attributes.
- Run mission on dedicated server.
- Undamaged target building and its ruins are both visible for players.
Problem doesn't occur in singleplayer or in multiplayer if client is same than server. Only on dedicated servers for non-local players.
EDIT, more info: Occurrance of problem is dependant on player count. Propability of problem occurring rises when there are bigger amount of players on server.
Would to confirm that I have too experienced this on a dedicated server I run. The player count did not make any difference to the results described here (tested 1 and 12 players).
The same is true for the state of the doors. Open/close are more or less random on dedicate server.
The solution is known. Instead of a "server only" module trying to execute some weird EG (effect global) commands, it could be far more efficient to run a script locally, at least for destruction which is not supposed to evolve during game. the module must be global.
See the workaround here for destroyed building.
@Wulf It's been almost a year and this is still broken. The "Enable Damage" checkbox is also affected. The problem as far as I can tell is that the code is executed locally to the host. The below workaround is why I believe that.
@PiepMGI A better workaround, although I haven't tested it on the damage states, is to run whatever code is necessary through the "Global Object Init". For example I leave the "Enable Damage" checkbox checked and then enter in the Global Object Init _this allowDamage false;. For the damage states one could try _this setDamage 0.5;. However having to manually script the functions kind of defeats the purpose of the module if you ask me.
I've probably managed to find the source of this issue, it's the buildings locality of course. Building is destroyed using _building setDamage [1,false];, everything should be ok as it's AG/EG function. @veteran29 helped me with pointing out that every player has his own copy of the building with the same ID. So we thought that when executing damage function on building, the server object is damaged/destroyed and synchronized but player's building wasn't really touched (it's a different object but with the same ID, right?), that's why we have building duplication. Later we've found out that only the destruction doesn't work and remoteExec'ing the setdamage made it work on dedicated (but not in 3den).
I've extracted the code function from module "init" switch case, placed a module on a building (but without setting anything) and call the edited function in the server init box of the module (the first one). Changing _building setDamage [1,false]; to [_building, [1, false]] remoteExecCall ["setDamage", 0, true]; removed the issue on dedicated server. However, that didn't work properly in 3den, building was not destroyed (the module of course worked fine in 3den).
This is the effect on the dedicated server:
1 - Building damaged using module
2 - Building destroyed using module (duplication can be seen)
3 - Building damaged using module function changed to use [_building, ["Hitzone_1_hitpoint",1,false]] remoteExecCall ["setHitPointDamage", 0, true]; instead of _building setHitpointDamage ["Hitzone_1_hitpoint",1,false];
4 - Nothing interesting
5 - Building destroyed using module function changed to use [_building, [1, false]] remoteExecCall ["setDamage", 0, true]; instead of _building setDamage [1,false]; (no duplication)
6 - Building not destroyed using module function without changing to remoteExecCall
Attached is the mission file + functions I used for testing.