Production Benches Texture Sizing And Activate Masking

Started by jabbamonkey, August 06, 2017, 02:19:36 PM

Previous topic - Next topic

jabbamonkey

DIMENSIONS
I used the source graphics to recreate some production tables... However, when the images are brought into the game, they are squished to fit other dimensions... I am using 256x128, and then using the original image to determine the spacing around the image (so the image is 256x128, but the drawn area is smaller and inside those dimensions)

See the image below. The electric kitchen stove is a good example (the one with 4 circles stove grills) ... you can see that the height is the same as the ingame  image ... but the width is stretched (making the final image look odd.

Does anyone know the exact dimensions I should be using so the image doesn't "squish"??? And, does anyone know the dimensions of the artwork that needs to be inside the image (what spacing around the image)?

MASKING
As for masking... refer to the images below. The butcher table is a good example (the one with the blood stains). When I choose WOOD, the butcher table is brown ... and so are all the other elements on the table. I created a mask and uploaded it, but the mask is not active. How do I make the mask active?

I know I need to do something with an XML file. (I saw an article about coloring a deer). The deer example shows how to color an object a SPECIFIC color ... but I need the color to be the color of the material used to create the object ...

Also, what do I name this XML file, and where do I put it in my mod folder? Do I need to add all other XML information for THAT production bench in my MODS xml file ... or just use the masking info, and the other info will be pulled from the core xml file? And, does each workbench need it's own XML file to designate a mask, or can I use a single XML file and add references to each workbench that I edit?


Please help. I have ALOT of graphics that I am redoing. Some look great, but I have all these issues that I need to deal with.

[attachment deleted by admin: too old]

skullywag

For thr mask you need to define a shaderType inside the graphicData of cutoutcomplex see something that uses a mask like the bed or something as an example for the xml. As ive put elsewhere on your threads now see the drawsize for how the texture is skewed.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

jabbamonkey

#2
If you can, please help with the other questions in the post ... (note: I am a designer, not a programmer, so this may be simple for you).

So, I open Buildings_Production.xml (core), and I find the TableButcher info (line 127 through line 188). I create a new blank file called "Buildings_Production.xml", and put it in my folder "MyModName/Defs/ThingDefs/Buildings_Production.xml".  Then I edit this document with my changes...

Then, with my blank Buildings_Production.xml, do I have to enter ALL the info about the TableButcher (every line from 127 through 188) and make my edits to the code. Or can I just include ONLY the info that I am changing...

<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>
<ThingDef ParentName="BenchBase">
    <DefName>TableButcher</DefName>
    <label>butcher table</label>
    <graphicData>
      <texPath>Things/Building/Production/TableButcher</texPath>
      <graphicClass>Graphic_Multi</graphicClass>
      <drawSize>(3.5,1.5)</drawSize>
      <shaderType>CutoutComplex</shaderType>
    </graphicData>
</ThingDef>
</ThingDefs>

And, if my mod's Building_Production.xml only contains info about the TableButcher (and none of the other production tables), do the other tables stop working?  Or does the game pull the rest of the info from the core files?

jamaicancastle

Quote from: jabbamonkey on August 07, 2017, 09:27:49 AM
Then, with my blank Buildings_Production.xml, do I have to enter ALL the info about the TableButcher (every line from 127 through 188) and make my edits to the code. Or can I just include ONLY the info that I am changing...

And, if my mod's Building_Production.xml only contains info about the TableButcher (and none of the other production tables), do the other tables stop working?  Or does the game pull the rest of the info from the core files?
There are two ways to do this. One is through directly overwriting the XML, as you have above. The other is to use xpath patching, which is somewhat more complicated but also works better with other mods attempting to change the same def.

If you are directly writing new XML, it must include all of the original XML (aside from any changes or deliberate omissions, obviously). If you are using patching, the patches will describe only new, removed, or changed items and not the bulk of the XML.

In neither case will you need to include anything from a complete def that's not changed. That is, if you modify the butchering table, you don't need to include, say, the stonecutting table even though they're in the same file.

kaptain_kavern

Hey Jabba sorry for the delay.

I'm volunteering for doing any code works for you (If it's not something you want to struggle with - I'm not sure what you'll prefer)

Shinzy

Quote from: kaptain_kavern on August 09, 2017, 09:47:12 AM
Hey Jabba sorry for the delay.

I'm volunteering for doing any code works for you (If it's not something you want to struggle with - I'm not sure what you'll prefer)
the xpath patching would complement proper texture packs a bunch
changing the shadertype and drawsize etc

could be really good groundwork for anyone else wishing to create a simple texture pack mod that can just be toggled on in the mod menu and not having to worry about breaking other mods etc

kaptain_kavern

Totally what I had in mind. But Jabba already said he is not a coder and XML patching is way less "intuitive" than overwriting defs, hence why I volunteering.

I've used so much of his textures pack (and still) that I feel it's my duty to help him out ;-)

SpaceDorf

Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

jabbamonkey

Quote from: kaptain_kavern on August 09, 2017, 09:47:12 AM
I'm volunteering for doing any code works for you (If it's not something you want to struggle with - I'm not sure what you'll prefer)

I've been pushing through alot of graphics this week. I finished a bunch of UI graphics. I also have all of the production benches complete, but have to run through them AGAIN so they are resized correctly.  I also redid a ton of other resources, food and drugs. 

I've been getting some advice on how to do masking and multi-images ... I'm going to setup the mod so it works using the "complete replace" method. Then, kaptain_kavern, if you want to try and run through making everything work so it is more "mod friendly" then that would be awesome.

So, I'll finish a few more graphics and finish setting up the prelimary mod, then post it for everyone to check out...

jabbamonkey

#9
Some quick question though...

Thumbnails
When you go to build something, you see a row of thumbnails at the bottom. Many of the workbenches don't show the MASK in the thumbnails (so, a wood butcher station is all brown, with no masked elements showing clearly). So, how do I set a custom graphic for the thumbnails? An image with the mask already integrated...

Graphic Replacements not showing up...
For the UI, I replaced the textures for a bunch of items. However, some of the images aren't showing up in the game.   I am basing the file names and locations on the source art files (found here https://ludeon.com/forums/index.php?topic=2325.135 )

For example, I recreated the graphics for the following, but aren't showing up in the game. Can anyone give me the correct path and file name for each?

1. Install - \Textures\UI\Commands\Install.png
2. Reinstall At... \Textures\UI\Commands\Install.png
3. Forbid,  or Allow Sowing - \Textures\UI\Commands\Forbidden.png
4. Hold Open - \Textures\UI\Commands\HoldOpen.png
5. Chop Wood (this shows when you go to the menu, but doesn't show when I click a tree). -
\Textures\UI\Designators\HarvestWood.png
6. Gather Spot - \Textures\UI\Commands\GatherSpotActive.png
7. Draft  - \Textures\UI\Commands\Draft.png
Also, many of the MAP ui icons...
9. Form Caravan  - \Textures\UI\Commands\FormCaravan.png
10. Abandon Home  - \Textures\UI\Commands\AbandonHome.png
11. ZoomIn  - \Textures\UI\Commands\ShowMap.png
12. Merge Caravans  - \Textures\UI\Commands\MergeCaravans.png
13. Split Caravans  - \Textures\UI\Commands\SplitCaravan.png
14. Settle  - \Textures\UI\Commands\Settle.png

kaptain_kavern

Quote from: jabbamonkey on August 10, 2017, 10:43:22 PM
I'm going to setup the mod so it works using the "complete replace" method. Then, kaptain_kavern, if you want to try and run through making everything work so it is more "mod friendly" then that would be awesome.

No problem. Will gladly do  :)

jabbamonkey

Quote from: kaptain_kavern on August 11, 2017, 09:26:47 AM
No problem. Will gladly do  :)

I uploaded the current work that I've done. Everything is looking good.
http://www.classicgaming.cc/mods/rimworld/JabbamonkeyModv1.zip

Highlights include an awesome new nutrient paste dispenser. I also redid the chair and the sofa/couch (I thought they looked like real bad in the old version). All the food and meals are redone, and the drugs look really cool as well. I also redid the solar panels, geothermal generator, and all the production benches (with masks).

I'm going to continue to work on items, but this is a good start...

kaptain_kavern

OK doke. Will have a look this evening or tomorrow (I'm in my mod-mechanician mood ;-) )

I have to try to debug the Jurassic Park mod, from WIP section, as well :-D

I've got to works on mine sometimes ^^

kaptain_kavern

#13
So nearly done (doing a smokeleaf break  8) )

BTW Jabba with XML patching we can selectively change any tags from any def so if you want to change more things like the Drawsize previously mentioned by Skuly, it can be done now. The benefit will be that the mod will be compatible with everything (except another patch that targets the same def).

Even without programming knowledge I'm sure you'll catch the pattern (plus I totally still volunteers for any more code works or explanations) and witness how it is less code (and time) consuming ;-)




Ok, it's done for the XML patches. I'm now investigating about some of the UI icons that aren't displayed in-game but I clearly see in the Textures folders.

Bingo. Apparently, some needs to be drawn in 64x64 and yours are in 128x128. I have no explanations, I just compared with the extracted texture from the game and the size are different... Will do some tests ....

Looks like it wasn't that. Even by changing size it doesn't work

kaptain_kavern

The archive contains a folder named Patches.

You just have to put it in your mod folder (same place as Textures and About folders) and remove the Defs folder.




For the one that aren't working properly in-game, I haven't found why :-s

[attachment deleted by admin: too old]