Vehicles Cannot be MountedSolved

Hello, I am using this plugin and with the recent update it seems to make vehicles unmountable.  When I remove the plugin and spawn a new vehicle the vehicles works correctly.  Any idea why this could be happening?

If it helps at all, when a player jumps on the car after trying to mount it will kill them and a message appears in the server console, "no valid dismount".

Further info, the message seems to come out if you just walk up to the vehicle and try to mount.

I can look into this tomorrow. Most likely, it's related to the feature that determines car modules.

I was using v2.0.3 and don't have problems. I upgraded to v2.3.0 and spawned a 3module_car_spawned still no problems.

Why would the client be trying to mount it just because it's around it?

Okay so given discodeFan's feedback I turned on "vanilla presets" and it worked correctly.  It seems to only happen when I setup custom presets in the config json.

Should always share configs and oxide log when you have problems. Might of been able to spot the problem from the get go. Also always going back to a default setup will help you determine if it's on your end or not.

Very true.  I still think there is an interaction issue.  Should be able to use custom presets right?  That is one of the awesome features of this plugin.

Merged post

{
"Engine parts": {
"Tier 1 chance": 100,
"Tier 2 chance": 50,
"Tier 3 chance": 10,
"Min condition percent": 50.0,
"Max condition percent": 100.0
},
"Min fuel amount": 10,
"Max fuel amount": 50,
"Min health percent": 15.0,
"Max health percent": 50.0,
"Module presets": {
"2 sockets": {
"Use vanilla presets": false,
"Custom presets": [
[
{
"Item short name": "vehicle.1mod.cockpit.with.engine",
"Item skin ID": 0
},
{
"Item short name": "vehicle.1mod.flatbed",
"Item skin ID": 2829491848
}
]
]
},
"3 sockets": {
"Use vanilla presets": true,
"Custom presets": []
},
"4 sockets": {
"Use vanilla presets": true,
"Custom presets": []
}
}
}

Merged post

This is using the CustomModules plugin as well.

This plugin actually uses the same logic for spawning vanilla modules and custom modules. It always takes control of adding the modules, but consults the config to determine which modules to spawn (either vanilla only, custom only, or both).

I tested with your above config, and I was not able to reproduce the issue. I spawned multiple cars with spawn 2modular_car and was able to mount them successfully every time. Therefore, I think the issue is caused by another plugin.

I see you are using the 2829491848 skin which corresponds to the auto turret module from the CustomModules plugin. I tested adding an auto turret to the flatbed module via the Car Turrets plugin, and I was still able to mount the car. I also tested with a custom AutoTurretModule plugin (which just adds an auto turret if the flatbed has that skin) which I prototyped when developing the ability for this plugin to add skinned modules, and I was also able to mount the car. There must be something specific about how the CustomModules plugin adds the turret that prevents mounting. Most likely, it needs to run the following code for each turret it spawns.

turret.gameObject.layer = (int)Rust.Layer.Vehicle_Detailed;

If you want to test this, search the CustomModules plugin code for the "assets/prefabs/npc/autoturret/autoturret_deployed.prefab". There is probably a resulting variable called turret or similar, so just insert the above code on a new line after that variable is defined.

Thank you WhiteThunder, that fixed it.  I added that line of code to the CustomModules and that got it working.

Locked automatically