Jump to content

overwrite a PrefabFiles


Recommended Posts

Hello,

 

I have a doubt, if I want overwrite a default PrefabFiles (ex : scripts/prefabs/beefalo.lua) with my custom prefab beefalo.lua, i must do write in my modmain.lua :

 

PrefabFiles = {

  "beefalo",

}

 

(etc...)

 

for it to be loaded or it is not necessary ?

 

 

(sorry for my bad english :o)

Link to comment
Share on other sites

as Kzisor said, you better to not overwrite. Just modify some strings, functions etc. which you want. That's how f.e. AddRecipe works - it just modify recipes (adds one more), but not overwrite the whole file.

+ you can replace the whole function with your custom one, or just replace some strings. f.e. Spear uses is 150 (can't remember). You may add strings to just increase uses:

inst.components.finiteuses:SetMaxUses(TUNING.SPEAR_USES * 2)    inst.components.finiteuses:SetUses(TUNING.SPEAR_USES * 2)

it will replace the old strings

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