Texture loading problem

Started by Sandy, February 03, 2018, 04:38:09 AM

Previous topic - Next topic

Sandy

Hi guys. i saw that 2 tile door mod request and tried to make one. it was somehow easy. i edited the door's def file into double door. the menu icon, blueprint and construction all went fine. even pawns were able to use it. the double door opens and closes fine.
the problem is the graphics. i'll attach the def code below and some pics too.
please tell me where i went wrong.
Thanks in advance.





<?xml version="1.0" encoding="utf-8" ?>
<Defs>


  <!--========================= DoubleDoors =============================-->

  <ThingDef ParentName="BuildingBase" Name="DoubleDoorBase" Abstract="True">
    <thingClass>Building_Door</thingClass>
    <blueprintClass>Blueprint_Door</blueprintClass>
    <category>Building</category>
    <blueprintGraphicData>
      <texPath>Things/Building/Door/DoubleDoor_Blueprint</texPath>
    </blueprintGraphicData>
    <altitudeLayer>DoorMoveable</altitudeLayer>
    <fillPercent>1</fillPercent>
    <useHitPoints>true</useHitPoints>
    <stuffCategories>
      <li>Metallic</li>
      <li>Woody</li>
      <li>Stony</li>
    </stuffCategories>
    <statBases>
      <MaxHitPoints>350</MaxHitPoints>
      <Flammability>1.0</Flammability>
    </statBases>
    <leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
    <selectable>true</selectable>
    <tickerType>Normal</tickerType>
    <rotatable>true</rotatable>
    <soundImpactDefault>BulletImpactMetal</soundImpactDefault>
    <terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
    <designationCategory>Structure</designationCategory>
    <holdsRoof>true</holdsRoof>
    <staticSunShadowHeight>1.0</staticSunShadowHeight>
    <blockLight>true</blockLight>
    <drawerType>RealtimeOnly</drawerType>
    <building>
<isInert>true</isInert>
<canPlaceOverWall>true</canPlaceOverWall>
      <soundDoorOpenPowered>DoorOpenPowered</soundDoorOpenPowered>
      <soundDoorClosePowered>DoorClosePowered</soundDoorClosePowered>
      <soundDoorOpenManual>DoorOpenManual</soundDoorOpenManual>
      <soundDoorCloseManual>DoorCloseManual</soundDoorCloseManual>
    </building>
    <comps>
      <li Class="CompProperties_Forbiddable"/>
    </comps>
<placeWorkers>
<li>PlaceWorker_DoorLearnOpeningSpeed</li>
</placeWorkers>
  </ThingDef>

  <ThingDef ParentName="DoubleDoorBase">
    <defName>DoubleDoor</defName>
    <label>double door</label>
    <description>Divides rooms. Must be manually opened and closed, which slows people down.</description>
<size>(2,1)</size>
    <statBases>
      <WorkToBuild>1200</WorkToBuild>
    </statBases>
    <graphicData>
      <texPath>Things/Building/Door/DoubleDoor_Mover</texPath>
      <graphicClass>Graphic_Single</graphicClass>
  <drawSize>(2,1)</drawSize>
      <damageData>
        <!--  no damage marks because they don't move with the door
        <rect>(0,0.12,1,0.76)</rect>-->
        <enabled>false</enabled>
      </damageData>
    </graphicData>
    <uiIconPath>Things/Building/Door/DoubleDoor_MenuIcon</uiIconPath>
    <costStuffCount>40</costStuffCount>
  </ThingDef>

</Defs>


Edit-1:
i managed to edit the texture and made it look like this. but its still not covering the full space.

Sandy

Bump.. still need help plz..

Sandy

Bumping everyday until it grabs someone's attention. (sorry)

am i doing something wrong here? like, not giving enough details?

sulusdacor

#3
first off, i never really looked into the whole door problem in detail so i might be wrong on some points here.

some general points:
from what i got in the past when looking over wider door thread, i think the problem is not the you can't visualy make a wider door. it is a pathfinding problem and that 2 pawns will not move through the wider door in the manner it should be. for the game it is still "one" door. no matter how wide. this does not mean you can not make wider door just for the looks.

in your xml your missing the buildingsbase abstract. if you refer to ParentName="BuildingBase" you should include these in your xml files. this can cause some problems. see here: https://ludeon.com/forums/index.php?topic=27433.msg277961#msg277961
(sadly not pinned, but quite important, forgot this myself when starting out^^)

for textures:
there is a linkable doors mod at the steamworkshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1206943745
i would assume it works properly (never used it myself, so not sure there). but i would check that out and look there to get further into this.

QuoteEdit-1:
i managed to edit the texture and made it look like this. but its still not covering the full space.
my question would be how exactly you edited the texture? bigger to 128x64?
(changing the texture to the 2x1 square size - 128pixels by 64 pixels - would be my first step in the hope that i would not have to mess with the code^^)

the doors use Building_Door as the thingclass and otherwise use the graphicclass single. most other objects have single as graphic class and it does not include the door mechanic (meaning changing the texture from open to closed). this would suggest that this is operated by the thingclass Buildling_Door. the follow up question here would be which textures and especially which size of textures is this thingclass using. i would guess that it is only using the 64x64. it might not even work with others. you would have to check out the code for the doors.

if the problem is code related you probably can create a workable version out of the linkable door mod and the vanilla class, since the mod faces a similar problem. but you will need custom code for that. it is not an xml only mod.

good luck ;)

edit: just saw you already got a bunch of feedback in another thread. i totaly missed that XD

Sandy

Quote from: sulusdacor on February 08, 2018, 06:00:35 AM
i think the problem is not the you can't visualy make a wider door. it is a pathfinding problem and that 2 pawns will not move through the wider door in the manner it should be. for the game it is still "one" door. no matter how wide. this does not mean you can not make wider door just for the looks.

first, thanks for ur help.
and no, thats the problem. im ok with the game considering it as "one" door. but no matter how big of a texture i add, the visual door never covers the 2x1 tiles fully. i know door is hardcoded to 1x1 tile. thats why im already looking into the codes.

and as for the xml, i did defined the BuildingBase at the top of the page. in the code i gave above, i had the Bases in a seperate file, but now i merged them into one. so thats not the issue.

yes, i edited the texture to 128x64 and then 256x128. both didnt work. bcoz door has hardcoded texture size, due to its opening/closing animation.

if i use Building_Door as thingClass, my xml code and texture works. but when i use my custom class, it doesnt. thats what im trying to solve now.

i also joined the modder's discord. but i also appreciate any help i get in the forums too.