Light Entity Component .Color property doesnt sync in multiplayer
As per title, the .Color property of a IMyLightingComponent (Ingame/PB namespace) retrieved from a block (such as the Farm Plot) does not sync to connected clients in multiplayer.
To reproduce:
1. Connect to a multiplayer session/server with scripts enabled, and sufficient privileges to be able to use scripts
2. Have a grid with a Farm Plot, power source, and Programmable block
3. Ensure the Farm Plot is named "Farm Plot" (so that the script can find it).
4. Place the following script in the programmable block:
public void Main(string argument, UpdateType updateSource) { var farmplotBlock = GridTerminalSystem.GetBlockWithName("Farm Plot"); IMyLightingComponent lightcomp; if (farmplotBlock != null) { if (farmplotBlock.Components.TryGet(out lightcomp)) { lightcomp.Color = Color.Red; } } }5. Compile and run the script.
6. Examine the Farm Plot. It should still be emitting white light (or whatever it was emitting before)
7. Reconnect (f5).
8. Re-examine the Farm Plot. It should now be emitting red light.
In Singleplayer (or as the host in a hosted multiplayer session?) after the first examination of the Farm Plot it would be emitting red light, but not so in multiplayer
A Comparison between the IMyLightingComponent and IMyLightingBlock interfaces and their implementing types suggests that the Entity Component interface is missing the interaction with the Sync object for Color.
Replies have been locked on this page!