Changing the skin of the snowmobile will eliminate the stash.Fixed

Changing the skin of the snowmobile will eliminate the stash.

 

Use spray can and change snowmobile skin, box will be gone. What should I do?

 

I'm aware of this issue but honestly it's pretty low priority on my todo list since nobody had reported it yet. I implemented a new Oxide hook recently so that I could fix this issue, and made a corresponding fix in Vehicle Deployed Locks (to make sure the lock didn't get removed). The implementation of that fix was a bit complicated so I wasn't looking forward to doing it in this plugin since it will be even more complicated.

I'll see if I can work on it now.

Understood, I will wait patiently. I reported it because it is a big deal from my point of view. Thanks for your prompt reply. Take care of yourself.

I pushed some changes to the development branch which you can test. It was annoying and took several hours.

https://github.com/WheteThunger/VehicleStorage/tree/develop

Here's how it works in detail:

  • When the snowmobile starts being skinned, the plugin will temporarily detach the containers.
  • If the snowmobile skin process is canceled by a plugin, the plugin will reattach the containers to the snowmobile a moment later.
    • If the original snowmobile mysteriously disappeard (e.g., a plugin did its own reskin process), the items will be dropped at the snowmobile's position and the containers deleted.
  • If the snowmobile skin process succeeds, then for each container:
    • If the new snowmobile doesn't have a Container Preset of the same name in the config, or if the prefab of that preset does not match, the items are dropped next to the snowmobile and the container is deleted.
    • If the new snowmobile has a matching Container Preset in the config, the container will be attached to the new snowmobile and repositioned according to the Container Preset for the new snowmobile.

Some caveats:

  • When the containers are attached to the new snowmobile, the capacity is not updated. If you have configured different container capacity per snowmobile type, then this would be considered an issue.
  • If you want one type of snowmobile to have fewer containers than another, the above logic will essentially bypass that by allowing a container to transfer from one type of snowmobile to another even if you haven't explicitly allowed it (it will transfer as long as there is a Container Preset of the same name).

For best results, ensure that both types of snowmobiles have Container Presets with the same names and prefabs (different positions and rotation are OK), and make the rulesets for both types of snowmobiles share the same number of containers and capacity.

Also, one thing I realized late is that you didn't specifically mention that the items were lost, just that the container is gone. It sounds like you are using the permission profiles for snowmobiles, rather than using the DefaultProfile feature. This is relevant because when the snowmobile is reskinned, it basically gets respawned, so some data is lost, including the OwnerID. It's out of scope for this plugin to transfer the OwnerID, but that could probably be achieved directly in Oxide in the future, or via another plugin such as Claim Vehicle Ownership in the future. Fortunately, the way this feature was implemented, you probably don't have to worry about OwnerID transfer because the containers will transfer regardless of the OwnerID.

Thank you very much. Sorry to interrupt your few hours.

Thank you for writing a very good description. From my point of view, I didn't think that the items falling to the side was a particular problem, just the loss of the box when the snowmobile skin is changed. Since both have the same type of permissions set and the same amount of boxes set, the issue does not affect me.

My apologies for continuing to bother you, as I am not in the habit of checking the authors of plugins.

 

Locked automatically