Some modding questions #4319
-
Continued from (#4317) The question addressed there is that changes in the master bundle cannot be reflected without restarting the game, and how to use AssetBundleCustomData. However, when AssetBundleCustomData is added and uploaded, it does not work properly. (When workshopfileids and workshopfileid are specified at the same time, or when only fileids is specified, AssetBundleCustomData file is root directory) Added inventory-related mod hooks to create unique items. I then created and applied a MonoBehavior script to process it, but the script cannot be found and does not work. And scripts I found elsewhere don't seem to work either. (Example: https://github.com/olie304/UnturnedScripts) How do I fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
The way that script 'hack' works is by tricking unity into loading the script from the already in-game class instead of the one you defined. Most of the ones in that repo should work. If you want to double check you can either decompile the game or check this repository run by DiFFoZ: https://github.com/Unturned-Datamining/Unturned-Datamining (only the ones with You can define any field, method, or property in your version of the script that's defined in the original script and it should reference the in-game version when bundled. Other than those, you just can't use custom scripts in mods, no way around it (other than using ModHooks and stuff). As for asset bundle custom data, I was under the impression it worked but have never tested it so it's possible it's broken. |
Beta Was this translation helpful? Give feedback.
The way that script 'hack' works is by tricking unity into loading the script from the already in-game class instead of the one you defined.
Most of the ones in that repo should work. If you want to double check you can either decompile the game or check this repository run by DiFFoZ: https://github.com/Unturned-Datamining/Unturned-Datamining (only the ones with
namespace SDG.Something
near the top of the file will show up in there though.)You can define any field, method, or property in your version of the script that's defined in the original script and it should reference the in-game version when bundled.
Other than those, you just can't use custom scripts in mods, no way around it (o…