How to replace an image?

Started by Spudfuzz, October 08, 2014, 02:31:19 AM

Previous topic - Next topic

Spudfuzz

Hi guys. Sorry for such a noob question. I've tried looking on the wiki and the forum, unless I've missed it I can't find the information.  I've never modded any games before and I'm pretty computer illiterate. I painted a new raspberry bush to replace the old image but I have no idea how to actually implement it into the game to test it out. The only image in the game folder is of a Muffalo. What do I do?

AHare

#1
You'll need to overwrite the original path using the def file. Find the def file of what you want to replace, make a copy of it in your own mod folder, and change the graphic path to match your new texture in your own texture folder.. I'd also say take out all the extra <ThingDef> entries but I guess you don't have to.

Shinzy

You could also manually recreate the right path in the textures folder
Core/Textures/Things/Plant/Raspberry

and put your png in the Plant folder and call it Raspberry
but plants as I found out work bit differently so you might only see a glitched image in this case

cause they use graphic path <graphicPathFolderRandom>
and I'm not sure what that does

so the most convenient way would be to do what AHare suggested
Only change the graphic path thing to
<graphicPathSingle>FolderWhereMyRaspberrybushIs/MYRaspberry</graphicPathSingle>

You can find the needed def file from the Core/Defs/Thingdefs/Plants_Wild_Temperate

and then do what AHare said!

mrofa

<graphicPathFolderRandom>
Works similar to graphicMulti, it takes the name and search of it in given path, then it choose randome element from all files that have same name.
I did only try this in old versions of a3-a4 so it might work a bitr diffrent now, but theoretical example of my theory would be :D
You have 5 textures named "BushA" to "BushE"
So in path as a file name you would write "Bush"
If it makes any sense to you at all :D
All i do is clutter all around.

Shinzy

Quote from: mrofa on October 08, 2014, 03:56:29 AM
<graphicPathFolderRandom>
Works similar to graphicMulti, it takes the name and search of it in given path, then it choose randome element from all files that have same name.
I did only try this in old versions of a3-a4 so it might work a bitr diffrent now, but theoretical example of my theory would be :D
You have 5 textures named "BushA" to "BushE"
So in path as a file name you would write "Bush"
If it makes any sense to you at all :D

Ohh! that's nice to know, thanks mroffy!

And Spuduffzzzfz! Don't hesitate to try making the graphical change
it may sound really complex if you really are computer illiterate =P
that's a strooong choice of words
It actually is pretty simple! especially if you look at some other people's mods
specifically anything that adds new plants for example
you can make out how to work it quite easily

And these guys are always extremely helpful around here! :D

skullywag

Grab my materialcrops mod. Its quite large but it has a lot of the info youre after. Feel free to chuck questions here and ill do my best to answer them. :)
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Spudfuzz

#6
Thanks for the responses guys. My boyfriend looked over the random folder thing and said it was like an array or list of random textures to pull from for the sake of variation. I thought that was interesting and decided to test it out, so I have 5 varied Raspberry bushes without changing the script and it worked. However, I still have the old image of the raspberry bush I don't want showing up. How would I go about finding it to delete it? Do I need to decompile the game or should I just change the script?

Rikiki

The original image is part of the core game and you cannot access it (in short it is "hardcoded").

If you want to get rid of it, you need to override the plant def. So you need to create a mod that declares the same Raspberry and change the texture path so it will only look into the given folder.

Basically you need to:

  • copy for example the materialcrops mod (found here)
  • edit the Defs/ThingDefs/MaterialCrops.xml file, line 43 and replace MeadowSweet by Raspberry
  • adapt the texture path line 50
  • tweak other parameters like harvestedThingDef and growthPer20kTicks (20k ticks correponds to 24h in-game)