Jump to content

Recommended Posts

8 hours ago, Woomymaster said:

Ive been digging for hours ive found that when i add a component it should go in component.lua and be able to edit it in tuning.lua but i need to make a separate tuning.lua in the mod itself but WHERE DO I PUT IT please im dyin' here

The best way to "edit tuning.lua" from a mod would be to overwrite a value or values it sets, a simple way to do this would be inside your modmain.lua. Let's say we want to edit TUNING.SANITY_HUGE. Normally, tuning.lua defines it as 50, but if we do

GLOBAL.TUNING.SANITY_HUGE = 128 -- only works inside modmain.lua

inside our modmain.lua, now TUNING.SANITY_HUGE is 128. If you wanna do this from a component, or basically any file that isn't modmain.lua, lose the GLOBAL. at the beginning, to get

TUNING.SANITY_HUGE = 128 -- works elsewhere

 

You can do this to as many values as you want, and change them just like any other variable, just keep in mind that it will effect vanilla items and mechanics if you edit these values.

  • Like 1
43 minutes ago, Woomymaster said:

ok i got that but say i add new variables and mechanics where would i put those, also in modmain.lua?

 

What kind of mechanics? New items should always go in their own script files, not in modmain.lua

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