Jump to content

How to get ride of IGUI_ItemsCat_...


Makishimu

Recommended Posts

Hi ! 

 

I am creating a mod to change the name of the item category.
For example in an unmoded game, a scissors will be in the category weapon but after modification it will be in the category tailoring.


The idea is to combine these changes with the mod manage container ( https://steamcommunity.com/sharedfiles/filedetails/?id=2650547917 ) for me and my friend to fully enjoy it without having to modify one by one each container.

 

 

So far, I have succeeded and I know how to change the category names of items.
I simply copied and pasted the items_food.txt file, from the game directory ( C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\items_food.txt ) to my mod repertory and in it I only change the DisplayCategory. 

 

Here is an exemple of the code for one item.

 

 
 


 

module BetterCategory {
    imports {
        Base
        }

 

item Dogfood
    {
        DisplayName = Dog Food,
        DisplayCategory = Armoirebis,          /***<------ the only thing I change is this before Amoirebis it was write Food ****/
        Type = Food,
        Weight = 0.8,
        Icon = Dogfood,
        CannedFood = TRUE,
        CantEat = TRUE,
        Packaged = TRUE,
        Calories = 498,
        Carbohydrates = 77.56,
        Lipids = 12.58,
        Proteins = 16.04,
        WorldStaticModel = CanClosedDogFood,
        Tags = HasMetal,
    }}

 

.[/code] [/spoiler] 

 

So in game it work fine, my Dog Food is now consider by the mod Manager Container as an Armoirebis Category but there's still one little thing that still there and I can't find how to deal with it.

 

image.thumb.jpeg.fdcd3ef2c8afd25ab1ce55736a06b85e.jpeg

As can be seen on the screenshot, the name of the category is IGUI_ItemCat_Armoirebis and not Armoirebis only...

 

 

 

I don’t know what I can do to display the name correctly. 

I often found on other topic the IGUI thing with translation but I have no idea of what need to be do.
I found too on a similar mod of mine this line of code but I’m not sure what to do with it..

 

 
 		

		 		

		IGUI_EN = { 		

		IGUI_ItemCat_Appear = "Appearance", 		

		IGUI_ItemCat_Cleaning = "Cleaning", 		

		IGUI_ItemCat_Cloth = "Clothing", 		

		IGUI_ItemCat_ClothA = "Clothing - Accessory", 		

		IGUI_ItemCat_ClothB = "Clothing - Bag", 		

		...		

		 		

		[/spoiler] 

 


If anyone has any idea what I need to do and the patience to explain myself in detail. 

Like if I have to create a txt file in a precise folder etc ect

 

Thanks ! And sorry for my english, I am native french.

Edited by Makishimu
Can't make the [spoiler] [code] work correctly
Link to comment
Share on other sites

Hi again ! 

 

I've done a lot of research on google, I even download mod on nexus to see how people do the translation thing.

But I complety forgot that sometime the best answer is realy close, like for example in the game files..

 


So to get ride of IGUI thing, you just need to go there : C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\shared\Translate\EN\IG_UI_EN.txt

 

There's every IGUI translation possible in english like :

 

 

-IGUI_ItemsCat_...

-IGUI_invpanel_...

-IGUI_char_...

-IGUI_ContainerTitle_...

 

And much more ! 

 

I've personaly copy, paste the whole file in my mod folder.

I'm pretty sure it's not necessary to have it all but as I don't want any problem I took everything ^^

 

 

And then, you just need to add your own code like :

 

  IGUI_ItemsCat_Armoire = "Armoire",  

 

 

And your good to go !

 

 

 

Sorry for the quick double post, I should have sleep before post at first.. 
And for every other beginner like I am, I hope my mistake will help you !

 

 

Again sorry for my english.

 

 

 

Link to comment
Share on other sites

On 4/18/2023 at 12:37 PM, Hugo Qwerty said:

For info, you can use Lua to edit vanilla items without needing to redeclare them.

 

Something like:

local scriptItem = ScriptManager.instance:getItem("Base.DogFood")
if scriptItem then
	scriptItem:DoParam("DisplayCategory = Armoirebis")
end

 

 

 

 

 

Oooh thanks for the info, I could use it realy realy soon like right now ahah
I'm currently working on a new mod, where I add a function to an already existing item. The function I add is an Attachment type, the item doesn't have it in vanilla.
So could this kind of thing work :
 

scripItem:DoParam("AttachmentType = Holster") 

 

And sorry to ask a lot of question, I'm a total beginner but in which folder in the LUA folder I have to write this ? And I guess I can name the txt file as I want, it's not like I was redeclaring something right ?

 

 


    /****************************** HandBag ******************************/         

    item Lunchbag
    {
        DisplayName = Lunchbag,
        DisplayCategory = HandBag,
        Type = Container,
        Weight = 0.1,
        WeightReduction = 10,
        Icon = Paperbag,
        Capacity = 5,
        CloseSound = CloseBag,
        OpenSound = OpenBag,
        PutInSound = PutItemInBag,
        WorldStaticModel = Paperbag_Ground,
    }

    /****************************** FrozenVegetables ******************************/         

    

    item CornFrozen
    {
        DisplayName = Packaged Corn,
        DisplayCategory = FrozenVegetables,
        Type = Food,
        Weight = 0.6,
        Icon = Frozen_Corn,
        EvolvedRecipe = Soup:10;Stew:10;Stir fry Griddle Pan:10;Stir fry:10;Roasted Vegetables:10;RicePot:10;RicePan:10;Omelette:5;Burrito:5;Taco:5,
        FoodType = Vegetables,
        EvolvedRecipeName = Corn,
        Packaged = TRUE,
        DaysFresh = 3,
        DaysTotallyRotten = 5,
        HungerChange = -20,
        ThirstChange = -5,
        Calories = 396,
        Carbohydrates = 94,
        Lipids = 5,
        Proteins = 15,
        WorldStaticModel = CornFrozen_Ground,
    }

    item MixedVegetables
    {
        DisplayName = Mixed Vegetables,
        DisplayCategory = FrozenVegetables,
        Type = Food,
        Weight = 0.6,
        Icon = Frozen_MixedVegetables,
        EvolvedRecipe = Soup:10;Stew:10;Stir fry Griddle Pan:10;Stir fry:10;Roasted Vegetables:10;RicePot:10;RicePan:10;Omelette:5,
        FoodType = Vegetables,
        EvolvedRecipeName = Vegetable,
        Packaged = TRUE,
        DaysFresh = 3,
        DaysTotallyRotten = 5,
        HungerChange = -20,
        ThirstChange = -5,
        Calories = 271,
        Carbohydrates = 37,
        Lipids = 0,
        Proteins = 9,
    }

     /****************************** Alcool ******************************/       
    
   
   item WineInGlass
    {
        DisplayCategory = Alcool,
        Type = Food,
        DisplayName = in a Glass,
        Icon = GlassWine,
        Weight = 0.3,
        EatType = Can,
        ReplaceOnUse = GlassWine,
        CustomEatSound = DrinkingFromMug,
        WorldStaticModel = GlassWine_Ground,
        CustomContextMenu = Drink,
        Tags = AlcoholicBeverage;LowAlcohol,
    }
    
    item Beer
    {
        DisplayName = Poured in a Tumbler,
        DisplayCategory = Alcool,
        Type = Food,
        Weight = 0.3,
        Icon = GlassTumbler,
        EatType = Can,
        ReplaceOnUse = GlassTumbler,
        CustomEatSound = DrinkingFromMug,
        WorldStaticModel = GlassTumbler_Ground,
        CustomContextMenu = Drink,
        EvolvedRecipeName = Beer,
        Tags = LowAlcohol,
    }

    item Beer2
    {
        DisplayName = Poured in a Glass,
        DisplayCategory = Alcool,
        Type = Food,
        Weight = 0.3,
        Icon = PlasticCup,
        EatType = Can,
        ReplaceOnUse = PlasticCup,
        CustomEatSound = DrinkingFromCan,
        WorldStaticModel = PlasticCup_Ground,
        CustomContextMenu = Drink,
        EvolvedRecipeName = Beer,
        Tags = LowAlcohol,
    }

 

 

 

To comeback on the base subject and your answer. 
As I change the category of all items, I feel like it will be done faster the way I did it instead of yours. Am I write ?

I'll show you how look like a little part of the code.

 

 

I've took time first to sort them even if it wasn't necessary but it's clear now and easier for me to naviguate threw and after that I've just copy paste each category in few minutes.
The reason I ask you this question is to now and learn things from it. I've never try modding before and I kinda enjoy do it, I know it's not a complicated code that I did but it was fun haha and I'd like to avoid mistake like this in the future.

Thanks again for your anwser !

Edited by Makishimu
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...