Electrical wires not being copiedSolved
I still have all the same issues as my original post sadly. Your trick with incrementing number of .sav file for the server did work out, though, so I still have all my work there. But save file is still about half size of the previous, even if I have only added more electronics to it if I copy it, and wires are invisible. Tried to make a small test house from scratch with just some basic lighting, and got same issue. Also tried leaving the server running for a bit and restarting the client after a while to see if they turned up, but still nothing. So I might just have to wait for your completely re-written version, and hope that fixes it for me. I am wondering if it works fine for anyone else, though.. I might have to do a cleanup in other mods and see if some others may be interfering in some way.
ye me too dont worry he said he will rewrite :) just need some time
all wires are invisible and lights and some other electrical stuff dont work anymore thats kinda bad
It's not a Rust bug. It's a bug in Copy Paste. The IOEntity output line points (elecrtical wires) coordinates are being transformed by Copy Paste. The line points should not be transformed because the line points are relative to the origin of each IOEntity. Copy directly the list of line points, and wires will appear at the correct location in the game world.
" Copy directly the list of line points, and wires will appear at the correct location in the game world. "

what ?
I failed to direct that statement at the plugin owner. In EntityData():

var linePoints = new List<Vector3>();
if (output.linePoints != null)
{
    // Since Vector3 is struct should be able to simply save the Vecot directly.
    foreach (Vector3 linePoint in output.linePoints)
    {
        linePoints.Add(NormalizePosition(copyData.SourcePos, linePoint, copyData.RotCor));
    }
}
ioConnection.Add("linePoints", linePoints);​

can be replaced with:

ioConnection.Add("linePoints", output.linePoints ?? new List<Vector3>);​
i dont know how todo this just update the plugin?
5d826ae6d4a1a.png WhiteDragon
I failed to direct that statement at the plugin owner. In EntityData():

var linePoints = new List<Vector3>();
if (output.linePoints != null)
{
    // Since Vector3 is struct should be able to simply save the Vecot directly.
    foreach (Vector3 linePoint in output.linePoints)
    {
        linePoints.Add(NormalizePosition(copyData.SourcePos, linePoint, copyData.RotCor));
    }
}
ioConnection.Add("linePoints", linePoints);​

can be replaced with:

ioConnection.Add("linePoints", output.linePoints ?? new List<Vector3>);​

Very interesting! I made some sort of mistake though because when compiling, it gives me this error:

(22:41:21) | Error while compiling: CopyPaste.cs(722,89): error CS1525: Unexpected symbol `)', expecting `(', `[', or `{'
(22:43:11) | Error while compiling: CopyPaste.cs(722,89): error CS1525: Unexpected symbol `)', expecting `(', `[', or `{'

My code is this one:

                List<object> outputs = new List<object>();
                foreach (IOEntity.IOSlot output in ioEntity.outputs)
                {
                    Dictionary<string, object> ioConnection = new Dictionary<string, object>
                    {
                        {"connectedID", output.connectedTo.entityRef.uid },
                        {"connectedToSlot", output.connectedToSlot },
                        {"niceName", output.niceName },
                        {"type", (int)output.type },
                    };

                    //	var linePoints = new List<Vector3>();
                    //if (output.linePoints != null)
                    //{
                        // Since Vector3 is struct should be able to simply save the Vecot directly.
                    //    foreach (Vector3 linePoint in output.linePoints)
                    //    {
                    //        linePoints.Add(NormalizePosition(copyData.SourcePos, linePoint, copyData.RotCor));
                    //    }
                    //}
                    ioConnection.Add("linePoints", output.linePoints ?? new List<Vector3>);
					//correction for the electric cables made by whitedragon

                    outputs.Add(ioConnection);
                }
                ioData.Add("outputs", outputs);
                ioData.Add("oldID", ioEntity.net.ID);
                var electricalBranch = ioEntity as ElectricalBranch;​

Where the heck I did the mistake?? :D
There was an error in my fix. I have updated it:
ioConnection.Add("linePoints", output.linePoints?.ToList() ?? new List<Vector3>());​

 

Similarly, replace the following in PasteLoop():
// Get the relative positions (normalized) and convert it to an actual position.
var normalizedPos =
    pasteData.QuaternionRotation * (new Vector3(
        Convert.ToSingle(linePoint["x"]),
        Convert.ToSingle(linePoint["y"]) + pasteData.HeightAdj,
        Convert.ToSingle(linePoint["z"]))) + pasteData.StartPos;
lineList.Add(normalizedPos);​

With this:
lineList.Add(new Vector3(
    Convert.ToSingle(linePoint["x"]),
    Convert.ToSingle(linePoint["y"]),
    Convert.ToSingle(linePoint["z"])));​
can we go back to the original problem ? i dont understand one word 
Keep in mind that buildings were saved with corrupted wiring paths, so there is no way to recover the original wiring paths for those copies. The above will work only for pasted buildings that were copied after the CopyPaste wiring fix was applied.
Herb
can we go back to the original problem ? i dont understand one word 

If you don't know how to copy/paste and how to search chunks of code inside a file, maybe you better don't try to modify the plugin. Basically you have to search for the piece of code and replace with the one given by WhiteDragon. You have to do this thing in thee *.cs file, then upload it in your server and make it start again keeping in mind what has been said about the buildings copied BEFORE the modification.

But then again: if you don't know how to copy/paste and how to search chunks of code inside a file, maybe you better don't try to modify the plugin.

You risk to break the plugin.

Hope to have been clear enough. ;-)
5d826ae6d4a1a.png WhiteDragon
There was an error in my fix. I have updated it:
ioConnection.Add("linePoints", output.linePoints?.ToList() ?? new List<Vector3>());​

 

Similarly, replace the following in PasteLoop():
// Get the relative positions (normalized) and convert it to an actual position.
var normalizedPos =
    pasteData.QuaternionRotation * (new Vector3(
        Convert.ToSingle(linePoint["x"]),
        Convert.ToSingle(linePoint["y"]) + pasteData.HeightAdj,
        Convert.ToSingle(linePoint["z"]))) + pasteData.StartPos;
lineList.Add(normalizedPos);​

With this:
lineList.Add(new Vector3(
    Convert.ToSingle(linePoint["x"]),
    Convert.ToSingle(linePoint["y"]),
    Convert.ToSingle(linePoint["z"])));​

Thank you for your correction! :-D I will try to update the plugin later. And ok... The past buildings can be sacrificed if the new ones have the correct wiring showing up! Big Thumb Up! 

:-)

Merged post

Holy Cow! It works like a charm!!! :-D
Dear sir, WhiteDragon, thank you 1024 times! ^__^
i know how to handle them lol and i never said i try to modify wtf...
i was just reporting bugs
Herb
i was just reporting bugs

" i dont understand one word" does not seem to me as "reporting bug" but hey... Whatever. :-D
And if you do know how to handle them, then what is the problem? Just paste the code provided into the proper file.

Simple as that.
Locked automatically