Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zolantris opened this issue Dec 21, 2023 · 3 comments

Comments

@zolantris
Copy link

zolantris commented Dec 21, 2023

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

@sirskunkalot
Copy link
Owner

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.

@sirskunkalot
Copy link
Owner

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.

@zolantris
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants