SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

`MasterBundle:AssetPath` format not supported in `MasterBundleReference<T>.TryParse` #4300

Closed Curly0-brackets0 closed 4 months ago

Curly0-brackets0 commented 5 months ago

A weather .asset file I'm making is not showing the default rain particle system no matter what I change. Puddles show up as expected; I assume because of the Legacyraincomponent component_type, but there are no raindrops visible in-game at all. Everything else works fine. Syntax is correct as I have understood it. Is this a masterbundle issue?

File path: image

Component_Type: image

Prefab: image

What could be the issue here, and is there a way I can diagnose it?

Thanks in advance, Curly.

GazziFX commented 5 months ago

I think it try to load asset from your masterbundle because its not in built-in assets

Curly0-brackets0 commented 5 months ago

@GazziFX Yeah I though so too, nelson mentions in the documentation for masterbundleptrs this: image but based on the syntax he uses it seem like that is for .dat files not .asset files, do you know how to point to the core masterbundle for a .asset file?

SDGNelson commented 5 months ago

The default masterbundle is the one found in the file hierarchy, so in your case you will need to explicitly specify the core masterbundle with "core.masterbundle:path/to/file.extension"

Curly0-brackets0 commented 5 months ago

image Assuming this is how, it still doesn't get the particles. Do I also need to add exclude_from_master_bundle in the .asset file when I use an override like this for it to work?

SDGNelson commented 5 months ago

Off the top of my head that looks right. Can you attach your asset file please and I'll try loading it up?

Curly0-brackets0 commented 5 months ago

Github seemingly doesn't support attaching .asset files, I have attached a .zip file which contains the .asset file instead :/ Urals Storm.zip For replicability: The folder path is map/bundles/assets/weather/Urals Storm.asset and the "bundles" folder contains all the masterbundle files for the map. I was testing it in-game by calling it with the GUID, the map I tested it on I have uploaded to the workshop in the past.

SDGNelson commented 5 months ago

Thanks for the example asset! My bad: It looks like the mb:path format was supported in the old .dat parser but not the new .dat parser, and somehow wasn't caught until now. I will add support for that in the next update.

In the meantime I double-checked and this is parsed correctly:

Replace:

"Prefab" "core.masterbundle:Effects/Weather/DefaultRainParticles.prefab"

With:

Prefab
{
    MasterBundle core.masterbundle
    AssetPath Effects/Weather/DefaultRainParticles.prefab
}
Curly0-brackets0 commented 5 months ago

Ah thanks a lot!