How to change the texture and name of a item.
1 1

5 posts in this topic

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!

Share this post


Link to post
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).

Share this post


Link to post
Share on other sites

How would one go about removing a item from the game? If its easily found by just a google search then I will do that, although Im not sure if there is a huge difference in location of files between different games.

Share this post


Link to post
Share on other sites

You can just remove it from the items.txt file. But as I said you might have to do some bugfixing after that (at the very least you should remove the references to the item in the suburbsdistribution file too).

IIRC it will also only work for new worlds.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
1 1