Jump to content

Help with starting up


Recommended Posts

Now I know you don't wanna spend more time helping another "noob" but hear me out. I've done all the things the forums have suggested (sort of learnt lua, researched existing mods etc.) but there is one mayor thing I haven't found a tutorial for and that is how the mod interacts with existing files.
    When making a new character you get all the files, put them in the mod folder and your pretty much good to go and I've made that work. What I CAN'T get to work is easy stuff like changing properties of the regular items ingame.
    For example: If I want to make my axes have double durability. Do i have to refer the original prefabs as assets. How much code does a thing like that take?

 

I just want an idea of where to start and how to think. All help is much appreciated.

Link to comment
Share on other sites

@Lasermite,

just use postinit functions in your modmain(they get called for the prefab after it's been initiated):

AddPrefabPostInit("axe",function(inst)inst.components.finiteuses:SetMaxUses(2*GOBAL.TUNING.AXE_USES)inst.components.finiteuses:SetUses(2*GLOBAL.TUNING.AXE_USES)end)
Edited by Seiai
Link to comment
Share on other sites

@Lasermite,

just use postinit functions in your modmain(they get called for the prefab after it's been initiated):

 

AddPrefabPostInit("axe",function(inst)inst.components.finiteuses:SetMaxUses(2*GOBAL.TUNING.AXE_USES)inst.components.finiteuses:SetUses(2*GLOBAL.TUNING.AXE_USES)end)

Sorry, since I'm new to this forum aswell I don't know how to tag someone.

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
 Share

×
  • Create New...