Jump to content

Modded and original object/script priorities


Crolf

Recommended Posts

Hi.

Just wonder: how can i replace an item stats or modify scripts without needing to change original game files, so my replacements won't be affected by unavoidable updates in most cases?

I want to create a separate mod (separate files) with overwriting original content (witch priority is higher: original file records or mod file records). Is this possible at this moment or planned?

Link to comment
Share on other sites

Hi.

Just wonder: how can i replace an item stats or modify scripts without needing to change original game files, so my replacements won't be affected by unavoidable updates in most cases?

I want to create a separate mod (separate files) with overwriting original content (witch priority is higher: original file records or mod file records). Is this possible at this moment or planned?

AFAIK you can overwrite vanilla lua files.

 

For example, if you want to overwrite Project Zomboid's scripts/thingyforexample.lua, just have a folder named scripts with thingyforexample.lua in it. To answer your question, yes, the priority for mods is higher than that of vanilla.

 

For mods overwriting other mods, that's where it gets confusing. I'm not sure about the priority there, but I do know that they overwrite eachother. I'm sure one of the lua gurus here will know more :P

Link to comment
Share on other sites

Local Disk (C:) / Users / YourUserName / Zomboid / mods

You can create a folder inside there for a custom mod. You'll want to make a mod.info file inside the folder, you can view the example mod to see how to do this (maybe just copy it over and edit details inside). Then make a new series of folders inside your mod folder like such.

media / scripts

Inside, make a new notepad file, name it MyItemChanges or something, and inside you add your changes. An example.
 

module Base{    item Apple    {        HungerChange    =    -15,        Weight    =    0.2,        Type    =    Food,        DaysTotallyRotten    =    8,        DisplayName    =    Apple,        Icon    =    Apple,        DaysFresh    =    5,        EvolvedRecipe = Pie:15;Cake:10,        FoodType    =   Fruits,    }    item Lemon    {        HungerChange    =    -15,        Weight    =    0.2,        Type    =    Food,        DaysTotallyRotten    =    9,        DisplayName    =    Lemon,        Icon    =    Lemon,        DaysFresh    =    7,        EvolvedRecipe = Cake:8;Pie:8;Stir fry:8;Roasted Vegetables:8,        FoodType    =   Fruits,    }}

In that, I changed it so Apples and Lemons could be used to make pie with the evolved recipe. By having it set to module Base, it will overwrite these items in the base file.

 

Edit: I'd recommend getting Notepad++ if you don't already have it.

 

Edit 2: Still sorta waking up so not fully alert, but yah, this can be done with lua files as well naturally, as for priority between mods, no idea how that works. I personally only use one other persons mod at this time, and I compiled it into my mod. Never liked having tons of mods, and like to do things my way, so having tons of stuff in one is just simpler for me.

Link to comment
Share on other sites

  • 1 month later...

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