Jump to content

How to change the texture and name of a item.


Killerdoom14

Recommended Posts

Hi, title says most of the question.

 

I would like to change the in game picture and texture of a item and the name as well, how would I do this? I would hate to go searching in the files of the game and edit stuff that may break it.. I will write a example below.

 

I want to get rid of the item Canned soup, if I couldent take it out of the game, how would I go about changing the name to "Discard" and the picture to "A smiley face" ?

 

Any help would be apprieciated!

Link to comment
Share on other sites

First of all: why?

The only thing you can change is the display name. Find the items.txt in the game base files and change this line for the CannedSoup item:

DisplayName = FooBarStuff
.

Changing the icon would require you to unpack the icon files first and then repack them which isn't trivial. Removing the item should work too, if you also edit the spawn tables (which should be defined on the lua side).

Link to comment
Share on other sites

  • 2 weeks later...

Actually, this can be done, and done without unpacking any textures.  The trick is to create a mod that modifies the base item and then set it to use the texture of your choice.  I have seen other examples in mods of modifying items.  I just tested the process because I was curious if it could be done after reading this thread.  This is how I did it:

 

First, create a folder for your mod.  Put in the usual mod.info and poster.png files.

 

You will need a media/scripts and a media/textures folder.

 

In media/textures, put your replacement texture and name it something like "Item_smiley.png".  A size of 32x32 pixels is good for this example.  Note that you need the "Item_" portion on the name to make it work.

 

In media/scripts you will need a text file for the item itself.  The name doesn't matter.  I used "Test.txt".  The code that goes into it adds onto the Base from items.txt and is then simply replacing the definition for the can of soup.  Notice that I only changed the values for DisplayName and Icon, leaved the others as what I copied and pasted from "items.txt".

module Base{    imports    {        Base    }    item TinnedSoup    {        Weight	=	0.8,        Type	=	Normal,        DisplayName	=	Worthless Item,        Icon	=	smiley.png,    }}

I then went into Project Zomboid, turned the mod on, and loaded up a saved game.  When I went to the cabinet where I had some cans of soup stored, they now showed the new icon and name.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...