Jump to content

I need help translating the mode. Refurbish your items and remove their repair stacks.


jangforce

Recommended Posts

I need help translating the mod. 

Refurbish (repair stacks begone!)

[spoiler][code]

    
    if item and item:getContainer() == player:getInventory() and (item:getCondition() ~= item:getConditionMax() or item:getHaveBeenRepaired() > 1) and item:getCategory() ~= "Clothing" and item:getCategory() ~= "Food" then
        if (item:getCategory() == "Weapon" and item:isAimedFirearm()) then --shooty shooty bang bangs, use toothbrush and a piece of cloth to clean
            local tool = "Toothbrush"
            local fixer = "RippedSheets"
            local skill = Perks.Reloading
            local skillLvl = 3
            local anim = CharacterActionAnims.Craft
            local time = 1200 + 400 * item:getHaveBeenRepaired()
            local repAmount = 0.1
            FixerWithContext.createInventoryObjectMenuEntry(player, context, item, tool, fixer, skill, skillLvl, anim, time, repAmount); --open context menu
            return;
        elseif (item:getCategory() == "Weapon" and not item:isAimedFirearm()) then  -- Any other melee weapon, repair with rods and a blowtorch
            --item:getCategories():contains("Spear") -- TODO maybe create 1 entry for each weapon type? would be cool
            local tool = "BlowTorch"
            local fixer = "WeldingRods"
            local skill = Perks.Maintenance
            local skillLvl = 2
            local anim = CharacterActionAnims.Craft
            local time = 1200 + 400 * item:getHaveBeenRepaired()
            local repAmount = 0.2
            FixerWithContext.createInventoryObjectMenuEntry(player, context, item, tool, fixer, skill, skillLvl, anim, time, repAmount); --open context menu
            return;
        else --everything else we just slam it into Maintenance lvl 3
            local tool = "Screwdriver"
            local fixer = "Screws"
            local skill = Perks.Maintenance
            local skillLvl = 3
            local anim = CharacterActionAnims.Disassemble
            local time = 800 + 400 * item:getHaveBeenRepaired()
            local repAmount = 0.4
            FixerWithContext.createInventoryObjectMenuEntry(player, context, item, tool, fixer, skill, skillLvl, anim, time, repAmount); --open context menu
            return;
        end
    end
end




[/code][/spoiler]

Its "Refurbish" mod it can refurbish items and remove their repair stacks.

 

but problem is that the lua file differs slightly from the other MOD. There is NO TRANSLATE FOLDER. there is JUST ONE lua file.

If the toothbrush is required in normal mode, 

Maybe, Itemname_base_Toothbrush,

but this mod is just   [            local tool = "Toothbrush"]

 

I tried to replace the Toothbrush w ith another language, but it failed.

 

I need help translating.
I asked the person who created the mod, but he said he gave up managing the mod

Edited by jangforce
Link to comment
Share on other sites

  • 2 weeks later...

i'll try to understand but my english is poor... try to translate "Toothbrush"? in the lua folder you can create a folder called "shared" and inside another folder called "Translate"

inside create a last folder and call... what language you want? for example "ES" into spanish language. Inside put your translate files... spanish example is a file called "items_Name_ES" but russian and other languages is diferent (search inside translate in this forum). The code is like

ItemName_ES = {
    ItemName_Toothbrush = "Cepillo de dientes",
}

or maybe this

ItemName_ES = {
    ItemName_base.Toothbrush = "Cepillo de dientes",
}

 

Some items need another file for displayed name, spanish example is a file called "items_ES" and the code is like

ItemName_ES = {    
    DisplayName_Toothbrush = "Cepillo de dientes",
}

or maybe this

ItemName_ES = {    
    DisplayName_base.Toothbrush = "Cepillo de dientes",
}

Don't forget save as ANSI both files.

Link to comment
Share on other sites

  • 6 months later...

im very sorry reply too late.

 

Use a method like [Itemname_base_Toothbrush] to describe an item you need in normal mod. You can see how this works by looking at the translation folders of the different mods.

However, this mod has a slightly different lua file.
It just says [local tool = "Toothbrush"].

This is not possible with the Tooltip_EN = { } method you mentioned.

Link to comment
Share on other sites

On 2/18/2023 at 8:30 AM, Hermago said:

i'll try to understand but my english is poor... try to translate "Toothbrush"? in the lua folder you can create a folder called "shared" and inside another folder called "Translate"

inside create a last folder and call... what language you want? for example "ES" into spanish language. Inside put your translate files... spanish example is a file called "items_Name_ES" but russian and other languages is diferent (search inside translate in this forum). The code is like

ItemName_ES = {
    ItemName_Toothbrush = "Cepillo de dientes",
}

or maybe this

ItemName_ES = {
    ItemName_base.Toothbrush = "Cepillo de dientes",
}

 

Some items need another file for displayed name, spanish example is a file called "items_ES" and the code is like

ItemName_ES = {    
    DisplayName_Toothbrush = "Cepillo de dientes",
}

or maybe this

ItemName_ES = {    
    DisplayName_base.Toothbrush = "Cepillo de dientes",
}

Don't forget save as ANSI both files.

im very sorry reply too late.

 

Use a method like [Itemname_base_Toothbrush] to describe an item you need in normal mod. You can see how this works by looking at the translation folders of the different mods.

However, this mod has a slightly different lua file.
It just says [local tool = "Toothbrush"].

This is not possible with the Tooltip_EN = { } method you mentioned.

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...