Modding Tutorials: Asset-Injection

Discuss modding questions and implementation details.
Post Reply
User avatar
Arl
Posts: 202
Joined: Sun Mar 22, 2015 10:57 am

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by Arl »

Very interesting Oracus0, and welcome to the forums!

You may want to create a topic in a more suitable place for this project of yours, maybe in General, since this is about Daggerfall Unity.
Last edited by Arl on Sat Aug 19, 2017 10:23 pm, edited 2 times in total.
My Deviantart page, I have some Daggerfall stuff in there.

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

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by TheLacus »

Hi oracus0!

Every contribution is welcome; we are currently talking about textures in this thread, i suggest you posting your work there. Also, if you haven't already, i encourage you to read the documentation which provide informations on how to import textures in game :)

And good luck with your Skyrim mod!

User avatar
quasifex
Posts: 56
Joined: Sun Aug 13, 2017 5:23 pm

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by quasifex »

Run the game up to where the building is located, then upload somewhere (like pastebin) the game log. Otherwise just paste here the last part, if there is something useful it should be there.
Umm, i can't do that. As i told in my previous post, after i leave first dungeon, screen turns gray or black. I had a save made during playtesting in editor. When i load it, there is no terrain, no buildings (except the one i added) and i start to fall in empty scene.
Also i noticed few strange things. There was this untextured plane at the start of the game:
Spoiler!
Start..jpg
Start..jpg (17.49 KiB) Viewed 4730 times
Here's the log.
output_log.7z
(8.17 KiB) Downloaded 201 times
(BTW, i can't open spoilers with my attachments)
On topic, plants actually aren't flats, they are low poly meshes...
Wait, there is still misunderstanding. I don't want to replace low-poly plants. I want to replace tex_GreenGrass and tex_BrownGrass. Y'know, those planes that always facing the player and affected by wind? I need them all replaced with my own low poly mesh, like this one:
grass.jpg
grass.jpg (203.63 KiB) Viewed 4730 times
if you want we may collaborate on this. Alternatively you can just jump into recreating daggerfall flora and replace sprites with your models as explained in the guide.
Sure, i'm glad to help any way i can. But honestly, i never modeled trees before. I'm planning to make just the models and someone else can texture them with hand-painted textures.
Last edited by quasifex on Sun Aug 27, 2017 12:23 pm, edited 2 times in total.

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

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by TheLacus »

quasifex wrote: Here's the log.
output_log.7z

It's full of errors related to shaders, I can't recognize it as an issue related to model import.
Can you confirm that it works fine as just downloaded from github and only presents this issue when you include the model?

Code: Select all

NullReferenceException at (wrapper managed-to-native) UnityEngine.Material:Internal_CreateWithShader (UnityEngine.Material,UnityEngine.Shader) at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.DaggerfallBillboardBatch.SetMaterial (Int32 archive, Boolean force) [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.Utility.GameObjectHelper.CreateBillboardBatchGameObject (Int32 archive, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.Utility.GameObjectHelper.CreateRMBBlockGameObject (System.String blockName, Boolean addGroundPlane, DaggerfallWorkshop.Utility.DaggerfallRMBBlock cloneFrom, DaggerfallWorkshop.DaggerfallBillboardBatch natureBillboardBatch, DaggerfallWorkshop.DaggerfallBillboardBatch lightsBillboardBatch, DaggerfallWorkshop.DaggerfallBillboardBatch animalsBillboardBatch, DaggerfallWorkshop.Utility.TextureAtlasBuilder miscBillboardAtlas, DaggerfallWorkshop.DaggerfallBillboardBatch miscBillboardBatch, ClimateNatureSets climateNature, ClimateSeason climateSeason) [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.Game.UserInterfaceWindows.DaggerfallUnitySetupGameWizard.CreateBackdrop () [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.Game.UserInterfaceWindows.DaggerfallUnitySetupGameWizard.ShowOptionsPanel () [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.Game.UserInterfaceWindows.DaggerfallUnitySetupGameWizard.ShowNextStage () [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.Game.UserInterfaceWindows.DaggerfallUnitySetupGameWizard.Update () [0x00000] in <filename unknown>:0 at DaggerfallWorkshop.Game.DaggerfallUI.Update () [0x00000] in <filename unknown>:0

Wait, there is still misunderstanding. I don't want to replace low-poly plants. I want to replace tex_GreenGrass and tex_BrownGrass. Y'know, those planes that always facing the player and affected by wind? I need them all replaced with my own low poly mesh, like this one:
You wold need to build the mod by yourself and include your mesh. Note that you want to use the Grass shader, which can be enabled with 'usegrassshader' in settings or editing the code directly.

This is the source code if you want to give a try.

User avatar
quasifex
Posts: 56
Joined: Sun Aug 13, 2017 5:23 pm

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by quasifex »

TheLacus wrote: It's full of errors related to shaders, I can't recognize it as an issue related to model import.
Can you confirm that it works fine as just downloaded from github and only presents this issue when you include the model?
Ok, i just downloaded github version. It seems it's more complete than the the version from unity package. The only problem in editor i get so far is this error after intro movies:
Spoiler!

Code: Select all

A game object can only be in one layer. The layer needs to be in the range [0...31]
UnityEngine.GameObject:set_layer(Int32)
DaggerfallWorkshop.Game.SetupDemoEnemy:ApplyEnemySettings(MobileGender) (at Assets/Scripts/Game/SetupDemoEnemy.cs:78)
DaggerfallWorkshop.Game.SetupDemoEnemy:ApplyEnemySettings(MobileTypes, MobileReactions, MobileGender) (at Assets/Scripts/Game/SetupDemoEnemy.cs:123)
DaggerfallWorkshop.Utility.RDBLayout:AddEnemy(RdbObject, MobileTypes, Transform, UInt64) (at Assets/Scripts/Utility/RDBLayout.cs:1273)
DaggerfallWorkshop.Utility.RDBLayout:AddRandomRDBEnemy(RdbObject, DungeonTypes, Single, Int32, Transform, DFBlock&, Boolean) (at Assets/Scripts/Utility/RDBLayout.cs:1220)
DaggerfallWorkshop.Utility.RDBLayout:AddRandomEnemies(GameObject, RdbObject[], DungeonTypes, Single, DFBlock&, Int32, Int32, Boolean) (at Assets/Scripts/Utility/RDBLayout.cs:484)
DaggerfallWorkshop.Utility.GameObjectHelper:CreateRDBBlockGameObject(String, Int32[], Boolean, DungeonTypes, Single, Int32, Int32, DaggerfallRDBBlock) (at Assets/Scripts/Utility/GameObjectHelper.cs:505)
DaggerfallWorkshop.DaggerfallDungeon:LayoutDungeon(DFLocation&) (at Assets/Scripts/Internal/DaggerfallDungeon.cs:243)
DaggerfallWorkshop.DaggerfallDungeon:SetDungeon(DFLocation) (at Assets/Scripts/Internal/DaggerfallDungeon.cs:107)
DaggerfallWorkshop.Utility.GameObjectHelper:CreateDaggerfallDungeonGameObject(DFLocation, Transform) (at Assets/Scripts/Utility/GameObjectHelper.cs:1092)
DaggerfallWorkshop.Game.PlayerEnterExit:StartDungeonInterior(DFLocation, Boolean) (at Assets/Scripts/Game/PlayerEnterExit.cs:532)
DaggerfallWorkshop.Game.Utility.StartGameBehaviour:StartNewCharacter() (at Assets/Scripts/Game/Utility/StartGameBehaviour.cs:362)
DaggerfallWorkshop.Game.Utility.StartGameBehaviour:InvokeStartMethod() (at Assets/Scripts/Game/Utility/StartGameBehaviour.cs:145)
DaggerfallWorkshop.Game.Utility.StartGameBehaviour:Update() (at Assets/Scripts/Game/Utility/StartGameBehaviour.cs:118)
I compiled it anyway and the problem persists. When i leave PH there's just nothing outside. I didn't include any models yet. Checked the output.log, still those shader errors.
Last edited by quasifex on Mon Sep 04, 2017 7:33 pm, edited 3 times in total.

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

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by TheLacus »

Unfortunately i don't now why you're receiving this error. If it's on a updated and unaltered copy of the game, without any mod or any other change, your best bet is to ask for support in Help & Support section.

Note that i'm not sure what you mean with unity package, to avoid misunderstandings i'm suggesting to delete all local files and start from scratch with this. Anyway, if we found out is not related to model import is better to move the discussion to its own topic on Support to avoid derailing this one :)

User avatar
quasifex
Posts: 56
Joined: Sun Aug 13, 2017 5:23 pm

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by quasifex »

I finally found a workaround for my problem. I simply need to turn off "Start in dungeon" in editor's game mode. This way i can start the game with world objects visible. The only issue i have now is that replaced models have rotation around wrong axis. Anybody knows how i can fix this?
Last edited by quasifex on Tue Sep 05, 2017 7:32 pm, edited 3 times in total.

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

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by TheLacus »

Since sprites don't have a fixed rotation, while models need it, a random one is assigned to ensure some variety.

Rotation is applied on the y (up) axis, check that your model is aligned correctly with this orientation.

User avatar
quasifex
Posts: 56
Joined: Sun Aug 13, 2017 5:23 pm

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by quasifex »

Ok, since this is not explained in details in the guide, I will leave this message for any future beginner modders as me to help them evade lots of trial and error i did to find out how to export correctly from few different packages to Unity.

3DMax: Setting Y-up in exporter is not enough! Go to Hierarchy tab > press "Affect Pivot Only" and rotate pivot point 90 degrees so that pivot's Y axis (green arrow) points upward. To be sure, also choose "Local" in Reference Coordinate System drop-down menu.
OR
Simply rotate your model's topside so that it's facing world Y axis

Blender: even if you set axis in exporter to Y-up, it will not transfer to Unity correctly. Maybe pivot rotation is also possible but i'm not proficient with this software.

Maya: It has same coordinate system as Unity, so there will be no problems after export.
Last edited by quasifex on Thu Sep 07, 2017 4:34 pm, edited 5 times in total.

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

Re: [GUIDE] Mesh, Texture and Sound replacement

Post by TheLacus »

Thank you for your research with 3DMax and Maya.
For Blender you can use a plugin, which is linked in the guide; alternatively you need to take care of applying the rotation.

Post Reply