Qiiiii

Save values set in console

Recommended Posts

Qiiiii    0

I can
TUNING.SPIDER_HEALTH = 110
in console to change spider health to 110 (default is 100).
print(TUNING.SPIDER_HEALTH)
shows that value is changed.

But after game reload all values are set back to default. print(TUNING.SPIDER_HEALTH) shows 100.

How can I save these values to current game?

 

 

Share this post


Link to post
Share on other sites
krylincy    43

you need to write that in a (personal tuning) mod

 

for your modmain.lua

function custom_tuning()
    TUNING["SPIDER_HEALTH "] = 110
end

AddGamePostInit(custom_tuning)
AddSimPostInit(custom_tuning)

I dont know which of the to add functions are right, I use both.

Share this post


Link to post
Share on other sites
penguin0616    8

@krylincy "AddGamePostInit" triggers when controllers are being loaded or unloaded.
"AddSimPostInit" triggers when the world has loaded, and also provides a player argument. 

Edited by penguin0616
  • Thanks 1

Share this post


Link to post
Share on other sites
Qiiiii    0

Mod wouldn't do it, because values should be changed often during game. I want to increase monster values randomly little by little so that I have reason to hurry and hop worlds. Actually, mod for this would be great, but it is far beyond my capabilities.

I figirued you can save and just copy-past all your settings in bulk every time game is loaded. It is fine, I was afraid I need to do it line by line.

It is strange that they don't need any delimiter, it works even without new line.
 

 

 

 

 

Edited by Qiiiii

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