News:

Welcome to World of Banished!

Main Menu

Texture Problem

Started by Maldrick, January 22, 2018, 02:54:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Maldrick

Quote from: Discrepancy on January 24, 2018, 04:19:57 PM
The footprints do finish off a model nicely, adding the dirt (or other) look to the ground below the model. It is not necessary, but also helps players know where the building is just after they've set the footprint down....
I also still have a lot of buildings that don't have one or are invisible.

If you are making an F-key variant, you will need to duplicate the model in the .fbx file and assign the 2nd texture to it - you need to do this as the game will look for the material name when it tries to compile.

So you have your first house: for example right now you would have the mesh within the .fbx calling up the material texture, names used for example 'MaldrickSmallHouse', the modkit links this to a MaterialInstance file of the same name: 'MaldrickSmallHouse.rsc', this calls up another file called 'MaldrickSmallHouseTexture.rsc', which calls up your ''MaldrickSmallHouse.png' texture file.

For you to add a 2nd textured home, you must make the same again but obviously named different.
So you will have copied the house model you made (you can do it in the export blender file, just select the house that you have already made in object mode and press Shift+D), name it something different, and attach the 2nd texture you have made, you will then need to do the same Models and MaterialInstance files to call up the texture.

Right...I was about to do that.  But just to experiment I tried just altering the png and recompliled without changing anything in blender and it worked.  So thought I'd ask if it was possible to do just that for F-variants.  Was looking at the template rsc and everything it points to and seems like it would.

But no worries...I'll go do that.  Just thought I'd ask about that.  Thank you!
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

Discrepancy

It won't work if you change the name of the texture, so if you add another texture image, the model won't call it up, and the modkit will end up just duplicating the first house.
There is a MaterialInstance file call from the Models/MaldricksHouseMesh.rsc, but  only affects the damaged look of the house - so when it catches on fire.

RedKetchup

you absolutely need to go in blender to duplicate it, change the name of the duplicated mesh, and change the names of the textures. an fbx doesnt store any textures, only names.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maldrick

"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

Maldrick

Thank you all again for all of the help.  And apologies for the endless questions while I was wrapping my head around how it all goes together.  After going through everything again doing the F-variants it made a lot more sense.  Getting comfortable navigating the modkit, finally.

So I finished everything up and it compiled on the first try. :)  Spent a couple hours tweaking textures a bit and got the toolbar set up.  Just need to make some icons to replace the temporaries I have slugged in and this one is all set.

One last question, since we were discussing F-variants...

The template has this bit of code..

DecalLocation _decalLocations
[
{
float _x0 = 0.0;
float _y0 = 0.0;
float _x1 = 256.0;
float _y1 = 320.0;
}
{
float _x0 = 256.0;
float _y0 = 0.0;
float _x1 = 512.0;
float _y1 = 320.0;
}
{
float _x0 = 512.0;
float _y0 = 0.0;
float _x1 = 768.0;
float _y1 = 320.0;
}
{
float _x0 = 768.0;
float _y0 = 0.0;
float _x1 = 1024.0;
float _y1 = 320.0;

}
{
float _x0 = 0.0;
float _y0 = 320.0;
float _x1 = 256.0;
float _y1 = 640.0;
}
{
float _x0 = 256.0;
float _y0 = 320.0;
float _x1 = 512.0;
float _y1 = 640.0;
}
]
}


Copied that from the woodenhouse template in the kit for this.  What do you do for the float values if you are doing more than 6 variants?  Not really sure what they do.  Not anything I need to do anytime soon, was just curious.

And if anyone has any tips about making icons I'd love to hear them.  I'm not the best at that kind of thing, to say the least. lol
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

RedKetchup

#50
x0 and y0 = the point the most top left of your .png
x1 and y1 = is the most right bottom of your .png

this is the square you define where start your footprint, and where it stops.

a 256x256 that use the entire png will have a float _mapWidth = 256.0 and wil start at x0=0 y0=0 and will end at x1=256 and y1=256

but if your footprint .png is as big as 1024x1024 and subvised by 4 footprints by 4 footprints of 256 each..., where it start ? and where it end ?
if it is the 3rd in row by the 2nd column... it can start x0=512 and end at x1=768 and on y0 = 256 and end at y1= 512....
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maldrick

Oh, right!  And we came full circle.  Thank you I was thinking of something else.  It's starting to run together a bit. lol

And I didn't do a footprint for this one so hadn't worked with that yet.  Awesome.  Thank you. )
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

Maldrick

Last question, I promise. :)

Trying to rename my mod...What the pkm will be.  Changing the name in the package.rsc does it but the mod doesn't work and I'm having the worst time tracking down what else I need to change.  I'm guessing this is the same reason you can't directly rename a pkm. Is there an easy way to do this?
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

RedKetchup

did you changed the name of resource file too ? (and names inside the .bat)

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Maldrick

No but I'll try that.  Thank you.
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

Maldrick

Doesn't compile if I rename the resource file.
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

Discrepancy

make sure you have everything correct.


So you rename the mod to 'MaldricksMod'

make sure the folder it is in is called 'MaldricksMod'

within that folder you will have to edit:

MaldricksModResources.rsc
MaldricksMod.rsc
Package.rsc

within each of those files make sure you have renamed everything to match the names of the .rsc files above

within Package.rsc ensure the topline is matching PackageFile MaldricksMod

within your .bat file/s:

build.bat
..\..\bin\x64\Tools-x64.exe /build MaldricksModResources.rsc:resource /pathres ../MyMods/MaldricksMod /pathdat ../MyMods/MaldricksMod/bin
pause

run.bat
..\..\bin\x64\Application-x64-profile.exe /ref MaldricksModResources.rsc:resource /pathres ../MyMods/MaldricksMod /pathdat ../MyMods/MaldricksMod/bin
pause

package.bat
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:MaldricksMod /pathres ../MyMods/MaldricksMod /pathdat ../MyMods/MaldricksMod/bin
pause


Discrepancy

 :)

and by all means, if you have trouble send me a link and I can check the code.

Maldrick

Awesome, thanks @Discrepancy.  I tried all of that except the directory name.  Been a while since I used .bat files like this so I forgot about that.  Didn't make a difference otherwise, oddly, but I'll give it a go.
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze

Maldrick

Yeah, it's still hanging on the resource file.  Thanks for your help.  I've been at this for hours and think I'll go over it again tomorrow.  The exact last thing I wanted to do. lol

You mind if I post this as "small town homes"? lol  Doesn't really fit the theme of where they wound up but I've kind of had it with trying to figure this out.
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze