Page 12 of 21

Re: [GUIDE] Mesh, Texture and Sound replacement

Posted: Thu Feb 22, 2018 10:23 am
by Igor
TheLacus wrote:Hi, you must define a material, see First Person Weapons section here.
Please tell me if you need more specific help ;)
Thank you!

Re: Modding Tutorials: Asset-Injection

Posted: Thu Apr 26, 2018 10:44 am
by TheLacus
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).

Spoiler!
TextureImportExample.png
TextureImportExample.png (372.12 KiB) Viewed 5031 times

Re: Modding Tutorials: Asset-Injection

Posted: Sun May 27, 2018 6:39 am
by Kamer
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.

Re: Modding Tutorials: Asset-Injection

Posted: Sun May 27, 2018 9:46 am
by Hazelnut
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?

Re: Modding Tutorials: Asset-Injection

Posted: Sun May 27, 2018 12:26 pm
by TheLacus
Kamer wrote: Sun May 27, 2018 6:39 am 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.
Did you take the xml from website? For some reason it shows a wrong char

Code: Select all

<?xml version=”1.0″?>
as opposed to

Code: Select all

<?xml version="1.0"?>
This doesn't happen if i set text as "preformatted" rather than quote, so i'll go for it now.

Re: Modding Tutorials: Asset-Injection

Posted: Sun May 27, 2018 2:30 pm
by Kamer
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.

Code: Select all

<?xml version="1.0"?>
<info>
	<scaleX>1</scaleX>
	<scaleY>2</scaleY>
</info>
They are saved in the right format and placed with the textures in the StreamingAssets folder but it seems that they are ignored.

Re: Modding Tutorials: Asset-Injection

Posted: Sun May 27, 2018 3:11 pm
by TheLacus
Please tell me which sprite and i will test it :)

Re: Modding Tutorials: Asset-Injection

Posted: Sun May 27, 2018 8:35 pm
by Kamer
TheLacus wrote: Sun May 27, 2018 3:11 pm Please tell me which sprite and i will test it :)
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.

Re: Modding Tutorials: Asset-Injection

Posted: Mon May 28, 2018 2:40 am
by Kamer
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.

Re: Modding Tutorials: Asset-Injection

Posted: Tue May 29, 2018 8:27 pm
by TheLacus
Kamer wrote: Sun May 27, 2018 8:35 pm
TheLacus wrote: Sun May 27, 2018 3:11 pm Please tell me which sprite and i will test it :)
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.
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?