sirskunkalot/PlanBuild

[ValheimRAFT] PlanBuild using global coordinates for object of RAFT parent which get out of sync

zolantris opened this issue · 3 comments

Hello, I created a patch for PlanBuild, but I'm hoping this can be directly integrated into the mod.

Patch is located here: https://github.com/zolantris/ValheimRaft/blob/main/src/ValheimRAFT/ValheimRAFT.Patches/PlanBuildPatch.cs. It does a check to see if the Piece is a child of a RAFT and if so it uses the netview.transform.localPosition instead of world position.

I also noticed a few possible problems with the vector calculation. The vector only applies for the last item that sets it instead of using the vector position per item.

https://github.com/zolantris/ValheimRaft/blob/main/src/ValheimRAFT/ValheimRAFT.Patches/PlanBuildPatch.cs#L119-L135

Hey, thanks for the input. If you want you can open a PR against this repo. It's open source and I am not sure why you used the decompiled code for your patch. It makes it hard for me to merge your changes to my code.

I checked your code and this is not as easy implementable in PlanBuild. If I reference the class MoveableBaseRootComponent in PlanBuild when ValheimRAFT is not installed it throws an exception. I am not sure how to tackle this best yet.

Yeah it would have to be done via a patch. I'll look at this again. If this were done on this side we would want to do a abstraction file that only is imported if the raft mod exists in chain loader dependencies.