Help us make VIO and DREAM actually compatible
- King of Worms
- Posts: 4753
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Help us make VIO and DREAM actually compatible
Ok, so...
Dream and VIO are not compatible. And both me and Kamer are bombarded with bug reports ever since...
It because VIO makes changes in the sprite atlas and swaps things around. And Dream uses modded high-res sprites, and they are - since modded - not in that atlas anymore, but somewhere else.
Thats what I understand is going on.
Is that even right?
Is there any chance some change either in DFU or VIO or DREAM can change this situation?
Thanks a lot
DREAM http://forums.dfworkshop.net/viewtopic. ... 7fd1187dcf
VIO http://forums.dfworkshop.net/viewtopic. ... 7fd1187dcf
Dream and VIO are not compatible. And both me and Kamer are bombarded with bug reports ever since...
It because VIO makes changes in the sprite atlas and swaps things around. And Dream uses modded high-res sprites, and they are - since modded - not in that atlas anymore, but somewhere else.
Thats what I understand is going on.
Is that even right?
Is there any chance some change either in DFU or VIO or DREAM can change this situation?
Thanks a lot
DREAM http://forums.dfworkshop.net/viewtopic. ... 7fd1187dcf
VIO http://forums.dfworkshop.net/viewtopic. ... 7fd1187dcf
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
-
- Posts: 1409
- Joined: Mon Aug 12, 2019 4:32 pm
- Contact:
Re: Help us make VIO and DREAM actually compatible
I would have to see the code, but he should be able to change out the code that swaps the atlas changes with code that grabs your hi-res sprites from whatever object/path they are held at/in. Null errors will continue to hit your mods until VIO loads your mod objects/hi-res sprites and updates the billboard swapping code to grab your sprite objects instead of the atlas objects.
Magicon had this issue in a different way with my mod. We had to load my mod raw scripts via namespace, so his mod had access to my objects for use in his CalculateAttackDamage formula code/object. Sounds like the same issue of not having access to your objects and not having a coded patch that pulls your sprite objects in place of the default atlas ones.
Magicon had this issue in a different way with my mod. We had to load my mod raw scripts via namespace, so his mod had access to my objects for use in his CalculateAttackDamage formula code/object. Sounds like the same issue of not having access to your objects and not having a coded patch that pulls your sprite objects in place of the default atlas ones.
My Daggerfall Mod Github: l3lessed DFU Mod Github
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.
- King of Worms
- Posts: 4753
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: Help us make VIO and DREAM actually compatible
Thanks a lot for reply and idea I3lessed I will redirect Kamer here, I hope he will drop by when he has some time.
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Help us make VIO and DREAM actually compatible
Maybe Kamer can use a different approach when custom textures are available. For example mod authors can override and take control of NPCs look by extending MobilePersonAsset. I might be able to give a more on point answer with precise information on how VIO works.King of Worms wrote: ↑Sun Dec 20, 2020 6:03 pm Is there any chance some change either in DFU or VIO or DREAM can change this situation?
- Kamer
- Posts: 583
- Joined: Mon Mar 05, 2018 9:26 pm
Re: Help us make VIO and DREAM actually compatible
Its just one line that changes the mseh of the Gameobject.TheLacus wrote: ↑Tue Dec 22, 2020 3:07 pmMaybe Kamer can use a different approach when custom textures are available. For example mod authors can override and take control of NPCs look by extending MobilePersonAsset. I might be able to give a more on point answer with precise information on how VIO works.King of Worms wrote: ↑Sun Dec 20, 2020 6:03 pm Is there any chance some change either in DFU or VIO or DREAM can change this situation?
Code: Select all
gameObject.GetComponentInChildren<MeshRenderer>().material.mainTexture = guardTorchTexture;
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Help us make VIO and DREAM actually compatible
You can use TextureReplacement.TryImportTexture(Int32, Int32, Int32, out Texture2D) to import a texture from mods. If you only want to know if a texture exists, you can combine TextureReplacement.TextureExistsAmongLooseFiles(Int32, Int32, Int32, TextureMap) (which doesn't import it) and ModManager.TryGetAsset<Texture2D>(String, false, out tex) (which relies on a cache).Kamer wrote: ↑Tue Dec 22, 2020 7:26 pmIts just one line that changes the mseh of the Gameobject.TheLacus wrote: ↑Tue Dec 22, 2020 3:07 pmMaybe Kamer can use a different approach when custom textures are available. For example mod authors can override and take control of NPCs look by extending MobilePersonAsset. I might be able to give a more on point answer with precise information on how VIO works.King of Worms wrote: ↑Sun Dec 20, 2020 6:03 pm Is there any chance some change either in DFU or VIO or DREAM can change this situation?
Its simple, and straight to the point. It also lets me add in graphics without having to replace anything specifically.Code: Select all
gameObject.GetComponentInChildren<MeshRenderer>().material.mainTexture = guardTorchTexture;
If custom texture exists, material.mainTexture should be a single texture instead of an atlas, so you should be able to handle these two cases as needed.
I'd still suggest to look into extending MobilePersonBillboard and override SetPerson(Races race, Genders gender, int personVariant, bool isGuard) so you can alter this process directly.
- King of Worms
- Posts: 4753
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: Help us make VIO and DREAM actually compatible
Have you tried the solutions mentioned here Kamer?
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- Kamer
- Posts: 583
- Joined: Mon Mar 05, 2018 9:26 pm
Re: Help us make VIO and DREAM actually compatible
I think what I'm looking for is this:
TextureExistsAmongLooseFiles(Int32, Int32, Int32, TextureMap)
Problem is, it always returns false. It doesn't detect dreams texture replacement. I'm thinking this is because, as the name suggests, it only looks in loose files. Since Dreams is a DFMOD, it makes it obsolete in detecting.
- XJDHDR
- Posts: 258
- Joined: Thu Jan 10, 2019 5:15 pm
- Location: New Zealand
- Contact:
Re: Help us make VIO and DREAM actually compatible
From what I can see, it does indeed only look for loose file textures:
Edit: I would say try follow TheLacus' advice about using TryGetAsset() to see if the textures exist. That is what TryImportTexture() uses internally to check for and retrieve dfmod textures.
Code: Select all
static readonly string texturesPath = Path.Combine(Application.streamingAssetsPath, "Textures");
public static bool TextureExistsAmongLooseFiles(int archive, int record, int frame = 0, TextureMap textureMap = TextureMap.Albedo)
{
return DaggerfallUnity.Settings.AssetInjection
&& File.Exists(Path.Combine(texturesPath, GetName(archive, record, frame, textureMap) + extension));
}
My DF Unity mods:
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
-
- Posts: 1409
- Joined: Mon Aug 12, 2019 4:32 pm
- Contact:
Re: Help us make VIO and DREAM actually compatible
This is correct. When the mod is built, the assets will be bundled into it. You then need to use the getasset object from the loaded mod, here dream mod, and then setup a null check to stop errors and find non-existence textures.
If not null, then load it instead of the default. If null, then use your current default load method for said texture.
You're trying to load loose files from a directory, instead of checking the mod and then loading it.
You can check my Github and go to ambidexteritymanager.cs under the ambidexterity mod. You can see how I use the get asset object to load my packed particle prefab and inject it into the engine. Check the start routine and properties to see how it is executed code wise.
Lastly, your original getchild method is pretty cpu/script wasteful. You are telling it to scan every object loaded into the engine, including non-npc objects, to find the necessary object to swap the texture for. I recommend using the methods provided by the lucas, so it doesn't start bogging down script loads when players add tons of stuff to their build.
If not null, then load it instead of the default. If null, then use your current default load method for said texture.
You're trying to load loose files from a directory, instead of checking the mod and then loading it.
You can check my Github and go to ambidexteritymanager.cs under the ambidexterity mod. You can see how I use the get asset object to load my packed particle prefab and inject it into the engine. Check the start routine and properties to see how it is executed code wise.
Lastly, your original getchild method is pretty cpu/script wasteful. You are telling it to scan every object loaded into the engine, including non-npc objects, to find the necessary object to swap the texture for. I recommend using the methods provided by the lucas, so it doesn't start bogging down script loads when players add tons of stuff to their build.
My Daggerfall Mod Github: l3lessed DFU Mod Github
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.