Issue replacing city wall model

Discuss modding questions and implementation details.
Alth
Posts: 16
Joined: Wed Feb 20, 2019 9:59 pm

Issue replacing city wall model

Post by Alth » Wed Jan 22, 2020 8:22 am

I'm trying to use asset injection to replace the city wall model that is used in Daggerfall and probably other cities too. The issue is that I can't figure out how you're supposed to accomplish this. I have tried with model 445 and 446, am I not looking at the right model or something?

I have followed the tutorial but it doesn't do anything. Unity imports the FBX when I place it in "assets/resources/models/445" but there is no materials folder being created like the tutorial states. It will not show up in the game. Are all models able to be replaced?

Thanks.

User avatar
King of Worms
Posts: 2765
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Issue replacing city wall model

Post by King of Worms » Fri Jan 24, 2020 10:53 am

This model is replaced in Alexander Sigs Handpainted models MOD.

Maybe ask around there, or download his mod and look? Im not sure u can look inside DFMOD package tho, I never needed that.

Sorry I cant help more :)

Alth
Posts: 16
Joined: Wed Feb 20, 2019 9:59 pm

Re: Issue replacing city wall model

Post by Alth » Sat Jan 25, 2020 1:26 am

King of Worms wrote:
Fri Jan 24, 2020 10:53 am
This model is replaced in Alexander Sigs Handpainted models MOD.

Maybe ask around there, or download his mod and look? Im not sure u can look inside DFMOD package tho, I never needed that.

Sorry I cant help more :)
Hmm I downloaded it, copied the files to my project and built the mod. I put the dfmod file in StreamingAssets/Mods and enabled the mod. No change in the game but I do get a message about no mod loaders found for the mod. Do I need a mod loader? I don't know why this system confuses me so much.

User avatar
Hazelnut
Posts: 2006
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Issue replacing city wall model

Post by Hazelnut » Sat Jan 25, 2020 11:56 am

Can you post your .dfmod.json file created by the mod builder - it defines what goes into the dfmod when you build it.

And don't feel that it's just you that is confused by the mod system, there's quite a lot to get your head around and learn. I know it took me a while.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

BadLuckBurt
Posts: 296
Joined: Sun Nov 05, 2017 8:30 pm

Re: Issue replacing city wall model

Post by BadLuckBurt » Sat Jan 25, 2020 12:26 pm

That tutorial is quite confusing. Materials are probably only created if theyre embedded in the FBX. I have always had to creafe them by hand when importing a model.

Your folder structure is probably off but tge dfmod json file will show if thats the case

Alth
Posts: 16
Joined: Wed Feb 20, 2019 9:59 pm

Re: Issue replacing city wall model

Post by Alth » Wed Jan 29, 2020 2:28 am

BadLuckBurt wrote:
Sat Jan 25, 2020 12:26 pm
That tutorial is quite confusing. Materials are probably only created if theyre embedded in the FBX. I have always had to creafe them by hand when importing a model.

Your folder structure is probably off but tge dfmod json file will show if thats the case

Code: Select all

{
    "ModTitle": "test",
    "ModVersion": "1",
    "ModAuthor": "me",
    "ContactInfo": null,
    "DFUnity_Version": "0.10.18",
    "ModDescription": null,
    "GUID": "0d419844-1b98-49e3-84be-37b3a7bb7af5",
    "Files": [
        "Assets/Test/City walls/444.prefab",
        "Assets/Test/City walls/444 actual doors.fbx",
        "Assets/Test/City walls/444_winter.prefab",
        "Assets/Test/City walls/446.prefab",
        "Assets/Test/City walls/445.prefab",
        "Assets/Test/City walls/445 city wall actual door.fbx",
        "Assets/Test/City walls/445 wall.fbx",
        "Assets/Test/City walls/445_winter.prefab"
    ],
    "Contributes": null,
    "Dependencies": null
}

BadLuckBurt
Posts: 296
Joined: Sun Nov 05, 2017 8:30 pm

Re: Issue replacing city wall model

Post by BadLuckBurt » Fri Jan 31, 2020 6:04 pm

Alth wrote:
Wed Jan 29, 2020 2:28 am
- snip
OK, so the folder structure definitely isn't correct. What I recommend doing:

Read the ReadMe.txt file that's in Assets/Game/Mods

and then:

1. Create a folder for your mod in Assets/Game/Mods (for example: WallReplacer)
2. Within that folder create a folder names Assets (the full path would look like Assets/Game/Mods/WallReplacer/Assets
3. In that Assets-folder, create a folder named Models and place your FBX / prefab files there (the path would end up looking like Assets/Game/Mods/WallReplacer/Assets/Models)
4. Building a mod with the above structure should allow the models to show up in game.

However, you do not have any materials defined so they'll either be white or pink (missing texture). There are enough tutorials on how to create a material in Unity so I'm skipping that here. Once you have created your materials and select an FBX model, the right-hand pane that shows you details for the model should have the following buttons: Model, Rig, Animation and Materials. Go to the Materials tab and drag the materials to the appropriate slots. You should see the preview of your model become textured if this is done successfully.

When the model is showing the textures as it should, you can then create a prefab (I recommend placing that in the Models folder as well).

I see you're trying to make them climate / season aware. As far as I know, it's not enough to specify just the season (but I could be wrong). The prefabs of models I have that are climate / season aware all follow this name scheme:

57050_MountainWinter
57050_SwampWinter
57050_TemperateWinter

Give this a go and let me know how it turns out. I'm not sure if you need a mod loader but once you have a correct folder structure we can tackle that if need be.

User avatar
TheLacus
Posts: 1063
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Issue replacing city wall model

Post by TheLacus » Fri Jan 31, 2020 10:25 pm

Folder structure is a suggestion, but not strictly needed. The only thing needed is a GameObject (a prefab or model itsef) with the correct name, which i believe is what you are already doing. Any material used by the model will be automatically included when you select it from Mod Builder. The documentation for the modding system is available here. It is possible to provide variations for different climates/seasons, but is not mandatory.

I'd suggest to upload a .unitypackage with the minimum content required to test the model (ie model, materials and textures), as well as a save made where the model is supposed to appear. Someone might be able to test and check for possible issues. :)
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

Alth
Posts: 16
Joined: Wed Feb 20, 2019 9:59 pm

Re: Issue replacing city wall model

Post by Alth » Sat Feb 01, 2020 12:02 am

BadLuckBurt wrote:
Fri Jan 31, 2020 6:04 pm
{
"ModTitle": "WallReplacer",
"ModVersion": "0.1",
"ModAuthor": "Alth",
"ContactInfo": null,
"DFUnity_Version": "0.10.18",
"ModDescription": null,
"GUID": "a371f767-5d78-428d-8091-7077090152a2",
"Files": [
"Assets/Game/Mods/WallReplacer/Assets/Models/445/Materials/SummerWall.mat",
"Assets/Game/Mods/WallReplacer/Assets/Models/445/445.fbx",
"Assets/Game/Mods/WallReplacer/Assets/Models/445/445.prefab"
],
"Contributes": null,
"Dependencies": null
}

BadLuckBurt
Posts: 296
Joined: Sun Nov 05, 2017 8:30 pm

Re: Issue replacing city wall model

Post by BadLuckBurt » Sat Feb 01, 2020 6:56 am

Id drop the 445 folder and just put it in Models but TheLacus implies the folder structure isnt necessary and that this should work already? Ratter confusing to me but he knows more about the system than I do so maybe try the unitypackage thing he talks about, I have no idea what it is or how to make one

Post Reply