Thank you!TheLacus wrote:Hi, you must define a material, see First Person Weapons section here.
Please tell me if you need more specific help
Modding Tutorials: Asset-Injection
- Igor
- Posts: 32
- Joined: Sun Nov 19, 2017 10:06 am
Re: [GUIDE] Mesh, Texture and Sound replacement
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Modding Tutorials: Asset-Injection
Starting from the most recents builds, textures can also be imported from dfmods. Priority order follows mods load order, with loose files in the last position. Everything that come last, override textures from the previous mod position. A typical situation is to have a few big texture pack mods at the top, and then smaller mods and loose files for individual texture swaps. This should be particularly helpful for texture translations.
You can refer to Lypyl tutorial for mod building. Is to note that UI, billboard and terrain images (of any format supported by unity) are included as simple textures. For textures used on 3d meshes (buildings and props) you need to create a material (archive_record-frame.mat, like individual textures). This is very handy if you want to set physical properties such as smoothness, normal map etc. When you build the mod select only the material, do not include individual textures applied to it.
If a texture is not shown correctly and the log says it couldn't be edited because it was read-only, you need to tick Read/Write Enabled option in Unity inspector for specific texture. Be warned that this increase ram usage so enable it only when necessary (ex: UI texture cut to get individual buttons).
You can refer to Lypyl tutorial for mod building. Is to note that UI, billboard and terrain images (of any format supported by unity) are included as simple textures. For textures used on 3d meshes (buildings and props) you need to create a material (archive_record-frame.mat, like individual textures). This is very handy if you want to set physical properties such as smoothness, normal map etc. When you build the mod select only the material, do not include individual textures applied to it.
If a texture is not shown correctly and the log says it couldn't be edited because it was read-only, you need to tick Read/Write Enabled option in Unity inspector for specific texture. Be warned that this increase ram usage so enable it only when necessary (ex: UI texture cut to get individual buttons).
Spoiler!
- Kamer
- Posts: 583
- Joined: Mon Mar 05, 2018 9:26 pm
Re: Modding Tutorials: Asset-Injection
What do you use to edit xml files? I can't seem to get them to work at all with Notepad++ so I'm assuming I need a different program.
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Modding Tutorials: Asset-Injection
XML files are plain text files that can be edited using any text editor. Some will make it easier by providing folding and syntax highlighting etc.
What do you mean when you say you can't get it to work?
What do you mean when you say you can't get it to work?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Modding Tutorials: Asset-Injection
Did you take the xml from website? For some reason it shows a wrong char
Code: Select all
<?xml version=”1.0″?>
Code: Select all
<?xml version="1.0"?>
- Kamer
- Posts: 583
- Joined: Mon Mar 05, 2018 9:26 pm
Re: Modding Tutorials: Asset-Injection
I'm trying to get a sprite to scale to twice the height. You were right, some of them weren't formatted correctly so that would seem to be a fix but I still can't manage to actually get the sprites to scale.
They are saved in the right format and placed with the textures in the StreamingAssets folder but it seems that they are ignored.
Code: Select all
<?xml version="1.0"?>
<info>
<scaleX>1</scaleX>
<scaleY>2</scaleY>
</info>
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Modding Tutorials: Asset-Injection
Please tell me which sprite and i will test it
- Kamer
- Posts: 583
- Joined: Mon Mar 05, 2018 9:26 pm
Re: Modding Tutorials: Asset-Injection
I'm trying it out on Villager sprites at the moment. 386 and 455. I'm trying to fix sprites getting parts cut off and adding some horseback riders. On this particular code I'm trying to scale horseback riders to replace select citizens in the game.
- Kamer
- Posts: 583
- Joined: Mon Mar 05, 2018 9:26 pm
Re: Modding Tutorials: Asset-Injection
New issue I've found. When you replace all of a villager's sprites, they start disappearing and reappearing when you walk so far away. This only happens when all the sprites are replaced. Not sure if having an xml file will help.
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Modding Tutorials: Asset-Injection
Custom scale is implemented for interior npcs and enemies but not for mobile persons. I can do it but i need to take care of vertical alignment on ground for individual billboards. The idea is to set position according to first frame size, after person is set and texture is chosen. Then is up to modder to be consistent with all frames.
@Interkarma
I would assign position to billboard gameobject in UpdateMobiles, just after call to RandomiseNPC(). AlignBillboardToGround should handle applying position due to custom scale as well as set original position after recycle since it uses current size. I don't see any evident issues from testing, do you foresee any trouble?