Where to place new graphic images...

Started by jabbamonkey, November 05, 2014, 10:39:47 AM

Previous topic - Next topic

jabbamonkey

So, I am looking to replace certain graphics ... but can't find the correct folder to put the new graphics in.

I am trying to replace the metal in the game. So, I created 3 metal graphics ...
MetalA.png
MetalB.png
MetalC.png
... and placed them in the following forlder:
Mods/Core/Textures/Things/Items/Resource/Metal/

When I play the game, half of the metal in the game is replaced. Half of the metal still uses the old graphic. I tried restarting the game, but that didn't solve the issue.

Any idea where to place these new metal images?

mrofa

Make your own mod that uses same defnames they will replace vanilia ones.
So basicly make a mod and copy .xml files from core mod and change thier texture path
All i do is clutter all around.


jabbamonkey

Quote from: JuliaEllie on November 05, 2014, 07:07:52 PM
you might want to have a look at this https://ludeon.com/forums/index.php?topic=7135.0 :)

Been meaning to take a look at this... too busy recreating graphics...

jabbamonkey

Quote from: mrofa on November 05, 2014, 11:37:39 AM
Make your own mod that uses same defnames they will replace vanilia ones.
So basicly make a mod and copy .xml files from core mod and change thier texture path

I was hoping to avoid copying the XML files (every time there is an update, I'll have to redo it ... and with alot of graphics, this could be problematic). I was hoping there was an alternative solution...

skullywag

I wouls wait for A8 Tynans done some changes to how textures are loaded, it could make life easier for this sort of thing.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

jabbamonkey

Quote from: JuliaEllie on November 05, 2014, 07:07:52 PM
you might want to have a look at this https://ludeon.com/forums/index.php?topic=7135.0 :)

I checked out the texture mod. I recreated graphics for the 3 metal, the 3 rock images, and the 3 scrap metals ... the new graphics didn't show up in the game using the mod.

Igabod

#7
Quote from: jabbamonkey on November 09, 2014, 02:28:44 PM
Quote from: JuliaEllie on November 05, 2014, 07:07:52 PM
you might want to have a look at this https://ludeon.com/forums/index.php?topic=7135.0 :)

I checked out the texture mod. I recreated graphics for the 3 metal, the 3 rock images, and the 3 scrap metals ... the new graphics didn't show up in the game using the mod.

To replace the default images your images have to have the same name as the default images do. You should name them RockLowA and MetalDebrisA.

[edit to add] Nevermind, I saw in your other thread that you did name them correctly. I don't know what the problem is apparently so I'll let JuliaEllie respond.

Tynan

Quote from: skullywag on November 06, 2014, 03:09:30 AM
I wouls wait for A8 Tynans done some changes to how textures are loaded, it could make life easier for this sort of thing.

Nothing I've done as of yet will make this use case easier. I'm afraid that if you want to change graphics, in the current system you do have to copy all the XML defs and change the graphics paths to your own. There's no specific way to mod graphics only.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

skullywag

Ehh copying the defs wouldnt take too long to change them all.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

jabbamonkey

Quote from: skullywag on November 10, 2014, 03:13:41 AM
Ehh copying the defs wouldnt take too long to change them all.

I'm less worried about copying the defs and editing them (even though that is a part I struggle with). My concern is updates, and possibly having to redo everything each time the game is updated (if the mod stops working, and the source xmls are changed) ...

jabbamonkey

So, if you followed any of my posts, I'm a designer and not a programmer ... I just wanted to declare that before I post my messy code below...    ;)

So, I tried to create a mod to use my metal and the chunks images...

I copied Items_Chunks.xml and placed it in my Mods/MyMod/Defs/ThingDefs/ folder .... then I renamed it Chunks.xml
<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>

  <ThingDef Name="ChunkBase" Abstract="True">
    <eType>Chunk</eType>
    <category>Item</category>
    <thingClass>Thing</thingClass>
    <altitudeLayer>Item</altitudeLayer>
    <passability>PassThroughOnly</passability>
    <fillPercent>0.4</fillPercent>
    <statBases><MaxHealth>300</MaxHealth><Flammability>0</Flammability></statBases>
    <selectable>true</selectable>
    <neverMultiSelect>true</neverMultiSelect>
    <pathCost>55</pathCost>
    <overdraw>false</overdraw>
    <drawerType>MapMeshOnly</drawerType>
    <randomizeRotationOnSpawn>true</randomizeRotationOnSpawn>
    <designateHaulable>true</designateHaulable>
    <storeCategories>
      <li>Chunks</li>
    </storeCategories>
    <saveCompressible>true</saveCompressible>
    <stackLimit>1</stackLimit>
  </ThingDef>

  <ThingDef ParentName="ChunkBase">
    <defName>ChunkRock</defName>
    <label>rock chunk</label>
    <graphicPathFolderRandom>Things/Item/Chunk/ChunkRock</graphicPathFolderRandom>
    <soundDrop>ChunkRock_Drop</soundDrop>
  </ThingDef>

  <ThingDef ParentName="ChunkBase">
    <defName>ChunkSlag</defName>
    <label>slag chunk</label>
    <graphicPathFolderRandom>Things/Item/Chunk/ChunkSlag</graphicPathFolderRandom>
    <soundDrop>ChunkSlag_Drop</soundDrop>
  </ThingDef>

</ThingDefs>


Then I copied Items_Resources.xml to the same folder and renamed it Metal.xml ... I edited it so only the metal info is in there (not sure if that was correct). Below is what was left...

<eType>Item</eType>
<resourceReadoutPriority>Middle</resourceReadoutPriority>

<useStandardHealth>true</useStandardHealth>
<selectable>true</selectable>
<altitudeLayer>Item</altitudeLayer>
<stackLimit>75</stackLimit>

<tradersCarry>true</tradersCarry>
<comps>
<li>

<compClass>CompForbiddable</compClass>
</li>
</comps>
<alwaysHaulable>true</alwaysHaulable>
<drawGUIOverlay>true</drawGUIOverlay>

<rotatable>false</rotatable>
<pathCost>15</pathCost>

</ThingDef>

<ThingDef Name="ResourceVerbBase" ParentName="ResourceBase" Abstract="True">
    <eType>Equipment</eType>
<thingClass>Equipment</thingClass>

<equipmentType>Primary</equipmentType>

<techLevel>Neolithic</techLevel>
<comps>

<li>
<compClass>CompForbiddable</compClass>

</li>
</comps>

</ThingDef>






<!--=============== METAL ====================-->




<ThingDef ParentName="MiscResourceBase">
   
<defName>Metal</defName>

<label>metal</label>
<description>Raw material for building tools and weapons. Needs to be refined in the Metal Synthesizer to be able to use for Buildings and most items.</description>
    <graphicPathFolderRandom>Things/Item/Resource/Metal</graphicPathFolderRandom>

  <soundInteract>Metal_Drop</soundInteract>

  <soundDrop>Metal_Drop</soundDrop>
   
<baseMarketValue>3.2</baseMarketValue>

<useStandardHealth>false</useStandardHealth>
   
<storeCategories>
     
<li>ResourcesRaw</li>
   
</storeCategories>

<stuffProps>
     
<canMakeBuildings>false</canMakeBuildings>
     
<constructEffect>ConstructMetal</constructEffect>

<color>(102,102,105)</color>

<soundImpactStuff>BulletImpactMetal</soundImpactStuff>

<statFactors>
<MarketValue>1</MarketValue>
<MaxHealth>1</MaxHealth>
<Beauty>1</Beauty>

<Flammability>0.2</Flammability>

</statFactors>
   
</stuffProps>
 
</ThingDef>


And, of course, when I activate the mod and run the game, it crashes.  Can someone help?

skullywag

#12
You seem to be missing most of the top of the file. Attach the whole file to a post so we can see the whole thing.

Also if you copy the while file as is and just change the texture line on metal itll work fine. (If you redefine the def without changing anything itll do nothing and work as per normal) Once youve done that just do the other if you need them if not delete that chunk of xml. I can do an example later on when im home if itll help.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Igabod

#13
I had a few minutes to kill before I go out for the night so I figured I'd slap this together in a mod for jabbamonkey. All I did was change one line in two files and put the textures in folders and throw an about.xml file. I loaded it up quickly just to see if I messed anything up and it seems to work just fine. I didn't see any of the vanilla textures being loaded for those three items so it should be good to go. This should serve as an example of how simple it is to mod the textures if you compare the vanilla game xml file to the ones I provided here. Odds are that you won't ever have to worry about updating this unless Tynan changes things drastically.

(please note, you must be logged in to see the attachment)

[attachment deleted by admin: too old]

jabbamonkey

Quote from: Igabod on November 10, 2014, 06:42:37 PM
I had a few minutes to kill before I go out for the night so I figured I'd slap this together in a mod for jabbamonkey. All I did was change one line in two files and put the textures in folders and throw an about.xml file. I loaded it up quickly just to see if I messed anything up and it seems to work just fine. I didn't see any of the vanilla textures being loaded for those three items so it should be good to go. This should serve as an example of how simple it is to mod the textures if you compare the vanilla game xml file to the ones I provided here. Odds are that you won't ever have to worry about updating this unless Tynan changes things drastically.

AWESOME!  I'll take a look when I get back home.