Recommended Posts

Yakuzashi    136

Inside your [character's name].lua goes: (above master_postinit) (mod->prefabs->...)

TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.[CHARACTERNAME] = { 
"item1", "item2" --- and so...
}

local start_inv = {}
for k, v in pairs(TUNING.GAMEMODE_STARTING_ITEMS) do
    start_inv[string.lower(k)] = v.[CHARACTERNAME]
end

prefabs = FlattenTree({ prefabs, start_inv }, true)

Swap "[CHARACTERNAME]" with "JIM", "MARK", "TONY" or whatever your char's name is.

Part above is for starting items.

This part below is for stats: (above master_postinit) (mod->prefabs->...)

TUNING.[CHARACTERNAME]_HEALTH = 200
TUNING.[CHARACTERNAME]_HUNGER = 200
TUNING.[CHARACTERNAME]_SANITY = 150

and inside master_postinit:

	inst.components.health:SetMaxHealth(TUNING.[CHARACTERNAME]_HEALTH)
	inst.components.hunger:SetMax(TUNING.[CHARACTERNAME]_HUNGER)
	inst.components.sanity:SetMax(TUNING.[CHARACTERNAME]_SANITY)

EXAMPLE: (Let's say your character is named Jim)

TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.JIM = { 
"redgem", "pitchfork", "log",
}

local start_inv = {}
for k, v in pairs(TUNING.GAMEMODE_STARTING_ITEMS) do
    start_inv[string.lower(k)] = v.JIM
end

prefabs = FlattenTree({ prefabs, start_inv }, true)
TUNING.JIM_HEALTH = 200
TUNING.JIM_HUNGER = 200
TUNING.JIM_SANITY = 150
	inst.components.health:SetMaxHealth(TUNING.JIM_HEALTH)
	inst.components.hunger:SetMax(TUNING.JIM_HUNGER)
	inst.components.sanity:SetMax(TUNING.JIM_SANITY)

And that's all. Cheers!

Share this post


Link to post
Share on other sites
RoseWuffbug    0
On 10/24/2020 at 11:22 PM, Yakuzashi said:

Inside your [character's name].lua goes: (above master_postinit) (mod->prefabs->...)


TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.[CHARACTERNAME] = { 
"item1", "item2" --- and so...
}

local start_inv = {}
for k, v in pairs(TUNING.GAMEMODE_STARTING_ITEMS) do
    start_inv[string.lower(k)] = v.[CHARACTERNAME]
end

prefabs = FlattenTree({ prefabs, start_inv }, true)

Swap "[CHARACTERNAME]" with "JIM", "MARK", "TONY" or whatever your char's name is.

Part above is for starting items.

This part below is for stats: (above master_postinit) (mod->prefabs->...)


TUNING.[CHARACTERNAME]_HEALTH = 200
TUNING.[CHARACTERNAME]_HUNGER = 200
TUNING.[CHARACTERNAME]_SANITY = 150

and inside master_postinit:


	inst.components.health:SetMaxHealth(TUNING.[CHARACTERNAME]_HEALTH)
	inst.components.hunger:SetMax(TUNING.[CHARACTERNAME]_HUNGER)
	inst.components.sanity:SetMax(TUNING.[CHARACTERNAME]_SANITY)

EXAMPLE: (Let's say your character is named Jim)


TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.JIM = { 
"redgem", "pitchfork", "log",
}

local start_inv = {}
for k, v in pairs(TUNING.GAMEMODE_STARTING_ITEMS) do
    start_inv[string.lower(k)] = v.JIM
end

prefabs = FlattenTree({ prefabs, start_inv }, true)

TUNING.JIM_HEALTH = 200
TUNING.JIM_HUNGER = 200
TUNING.JIM_SANITY = 150

	inst.components.health:SetMaxHealth(TUNING.JIM_HEALTH)
	inst.components.hunger:SetMax(TUNING.JIM_HUNGER)
	inst.components.sanity:SetMax(TUNING.JIM_SANITY)

And that's all. Cheers!

just had the chance to try it, I added these, but nothing changed, and it doesn't add the items in the game anymore, I'm pretty sure I followed exactly how you said. no errors appeared too

also, how about the "Odds of survival" thing? how can I change that?

Share this post


Link to post
Share on other sites
Yakuzashi    136

I have used (inside modmain.lua)

-- The character select screen lines
STRINGS.CHARACTER_TITLES.ilya = "The Eye of Vengeance"
STRINGS.CHARACTER_NAMES.ilya = "Ilya"
STRINGS.CHARACTER_DESCRIPTIONS.ilya = "*Powerful firearms \n*Military grade equipment \n*Slower hunger rate"
STRINGS.CHARACTER_QUOTES.ilya = "\"They will pay for it!\""
STRINGS.CHARACTER_SURVIVABILITY.ilya = "большой"

You can type whatever you want in field required for "Odds of survival".

Also you can DM your mod folder in .zip/.rar and I will take a look at it.

Share this post


Link to post
Share on other sites
Hiru315    2

Have the same problems. 
We changed the stats and inventory items in modmain.lua.

It does appear in game but in character selection page it all shows as ? and nothing.

  • Like 1

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