question about replacing vanilla wood floor.

Started by keylocke, April 24, 2017, 10:18:48 PM

Previous topic - Next topic

keylocke

is it possible?

i was able to ADD new wooden floors, using this :

<TerrainDef  ParentName="FloorBase">
    <DefName>WoodPovertyFloor</DefName>
    <label>wood poverty floor</label>
    <RenderPrecedence>250</RenderPrecedence>
    <Description>Wood floor with 100% more poverty.</Description>
    <texturePath>Terrain/Surfaces/WoodPovertyFloor</texturePath>
    <statBases>
      <WorkToBuild>85</WorkToBuild>
    </statBases>
    <CostList>
      <WoodLog>1</WoodLog>
    </CostList>
    <constructEffect>ConstructWood</constructEffect>
    <designationHotkey>Misc7</designationHotkey>
  </TerrainDef>


^which let's me build some really crappy wooden floors, and it seems to work fine.


(WIP. gonna redo the floor coz it's kinda crap.)(edit : changed line colors. this one seem a bit less crap)

problem is i can't seem to replace vanilla wooden floor using this texture path :

<TerrainDef  ParentName="FloorBase">
    <DefName>WoodPlankFloor</DefName>
    <label>wood floor</label>
    <RenderPrecedence>250</RenderPrecedence>
    <Description>Wood plank flooring. For that warm, homey feeling.</Description>
    <texturePath>Terrain/Surfaces/WoodFloor</texturePath>
    <statBases>
      <WorkToBuild>85</WorkToBuild>
    </statBases>
    <CostList>
      <WoodLog>3</WoodLog>
    </CostList>
    <constructEffect>ConstructWood</constructEffect>
    <designationHotkey>Misc7</designationHotkey>
  </TerrainDef>


this is a problem for me coz i don't wanna add more new items (i play with tons of mods that adds new items, and the build menu practically covers my entire screen)

i can add new floors, i can replace textures and masks of vanilla furniture (i tried this awhile ago for hospital bed and it works fine. except for the rescaling issue)

but does vanilla WoodFloor actually have a different texture path? what am i doing wrong?

need help again.. plz.

----

edit : as for the rescaling issue, some of the images in a16 art source seem to get rescaled when imported into game. (ie : the hospital bed in there is a 256x256 graphic) which gets skewed in-game.

i could use old artsource, which seems to be more accurate, but there are many new items that isn't part of that.

any suggestions how to find out the right dimension in-game for each item? (other than actually testing each of them out)

jamaicancastle

Quote from: keylocke on April 24, 2017, 10:18:48 PMany suggestions how to find out the right dimension in-game for each item? (other than actually testing each of them out)

Look up the drawSize property of the building you're looking at. If there isn't one, then it's the same as the physical size.

The hospital bed, for instance, has a drawSize of (3,4), compared to its size of (1,2). This is so its graphic can overhang the edge of the squares it occupies slightly. No matter what size the graphic it uses is, it will be scaled to fit a 3x4 space in-game. You'll notice the hospital bed has a lot of blank padding around the edge of its graphic because it doesn't actually use the full 3x4 area.

keylocke

Quote from: jamaicancastle on April 25, 2017, 03:33:36 PM
Look up the drawSize property of the building you're looking at. If there isn't one, then it's the same as the physical size.

The hospital bed, for instance, has a drawSize of (3,4), compared to its size of (1,2). This is so its graphic can overhang the edge of the squares it occupies slightly. No matter what size the graphic it uses is, it will be scaled to fit a 3x4 space in-game. You'll notice the hospital bed has a lot of blank padding around the edge of its graphic because it doesn't actually use the full 3x4 area.

ah.. thanks for this.

anyways, for my other problem. the current "fix" i have to replace vanilla textures for the floors is to directly place my textures into the vanilla core folder.  :-\


^i replaced vanilla wood floor by placing my texture in core folder. coz i can add new custom floor textures in my mod folder, but i can't seem to replace vanilla texture of wood floor within mod folder. (i have no idea why)

is there a better way of doing this?

dburgdorf

#3
Is there a reason why you need to replace the texture with one that has the exact same name as the default?

Why not just call your new floor graphic, "WoodFloorV2.png" or something, and have the WoodPlankFloor def point to "Terrain/Surfaces/WoodFloorV2" for its graphic?

(Yes, this would require copying over the XML def into your mod folder, but it isn't "adding a new thing," so it should still be consistent with your desire.)
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

keylocke

Quote from: dburgdorf on April 26, 2017, 09:28:38 AM
Is there a reason why you need to replace the texture with one that has the exact same name as the default?

Why not just call your new floor graphic, "WoodFloorV2.png" or something, and have the WoodPlankFloor def point to "Terrain/Surfaces/WoodFloorV2" for its graphic?

(Yes, this would require copying over the XML def into your mod folder, but it isn't "adding a new thing," so it should still be consistent with your desire.)

this creates a new floor, rather than replace the vanilla texture.

the problem with this is coz i tend to use plenty of mods that adds new stuff, so the build menu would look overly crowded.

i guess, i'll put a pin on this issue for now and just focus finishing on the art assets. (still plenty to do.)

then i'll go start learning how to mod the dlls.

dburgdorf

#5
Quote from: keylocke on April 26, 2017, 10:59:26 AMthis creates a new floor, rather than replace the vanilla texture.

If you just copy the WoodPlankFloor def into your mod's XML files, changing nothing but the texture definition, you are *not* creating a new item. You're simply editing the default wood floor, as your definition of the item with the defName "WoodPlankFloor" will overwrite the core definition of the item with that defName. ;)
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

keylocke


minimurgle

Glad you got the help you needed. Textures are looking great BTW
Don't mind the questions. I'm probably just confused.

keylocke

#8
thanks. i'm mostly done with the beds, animal beds, chairs, and the tables. but i'm not content with what i have so far.

ie : there are designs that look good for wood (like logs). but look awkward with stone or metal.

so i wanted to be able to create a code that will change the texture path to point to different sets of graphics eventually. (ie : wood or metal or stone or leather or fabric furniture graphic set) <--- adding this to my to do list. (i'll try to finish doing the graphics first before learning to mod the code)

another one on my to do list would be able to change from poorly crafted to well crafted designs depending on construction skill. (ie : if builder's construction skill is 0-10 : builder will construct the "poverty aesthetic" version of the furniture. but if construction skill is 11-20 : then builder will construct the "well crafted" version. with the appropriate texture pack)

^which means at the completion of this project :

-poverty aesthetic : wood, metal, stone, leather, fabric texture packs
-well crafted : wood, metal, stone, leather, fabric texture packs

meaning, it's gonna be 10 texture packs all rolled into one, using the appropriate texture pack depending on material used and skill level of builder.

-----

but for now, i'll finish just 1 assorted texture pack for the furniture/buildings/walls/floors/.

then overhaul humanoid pawns and apparel next.