Jump to content

Modding help, chars and hunger.


Recommended Posts

Hi, I'm quite new to modding Don't Starve and have some problems. I'm not new to programming and modding nor lua but I'm new to Don't Starve modding.

 

I have 2 problems which all of them is in the same mod.

 

The first problem:

I've looked at alot of users having problems with importing unicode/UTF-8 chars, which the result is on all of those is "We are currently limited to ASCII only". Which I understand because It takes too long time to add in 65536 characters and make the font for them. So, I look at asciitable.com to see if the chars is on the asciitable and I see they are. but when I run it ingame, those chars disappear. the chars that I've tried is %, Å, Ä and Ö. which all disappear, but still is in ASCII. if the case is (which I don't hope atall) that there's no images for those chars, I really wish the could be added, because if the wont, Swedish and other languages with other chars than english wont be able to get translated, even though their chars is on ASCII.

 

The second problem:

I am making a mod to make some tweaks/improvement/balancing on the health/hunger/sanity. I found a mod that makes the hunger go slower, but it isn't compatible with some mods that I use. So I thought I would implement my own code into my mod that is compatible with most mods. And I wonder. how do I change the speed of which you get hungry. I found some use GLOBAL:TUNING:WILSON_HUNGER_RATE but I've seen that those numbers are calculated weird.

So I wonder, is there any other way of making the hunger faster/slower and is there a way to calculate the GLOBAL.TUNING.WILSON_HUNGER_RATE? I mostly want answers about other says than the GLOBAL.TUNING variable.

 

Thanks.

 

Link to comment
Share on other sites

Regarding the first problem, I've heard of a russian font mod, but that's all I can help you with.

 

Regarding the latter issue, you seem confused about how the rate is used. You see, the hunger multiplies the time since its last update (in seconds) with the rate given to it. So if you set it to 1, the character would lose a point of hunger every second (that's fast). If you halve the default rate (the tuning value), your character takes twice the time to starve.

GLOBAL. is a prefix for global variables used from within modmain.lua, which is in its own environment.

Link to comment
Share on other sites

Thanks, Now I understand. Now there's another thing. I see that for example wilson has the hunger rate of 0.15625, (75/day), and that wolfgang has in his mighty mode, wilson's rate * 3. I found a post where another user asked something about this, and I saw a user told that it's not good to hardcode, so that we should use inst.components.hunger:SetRate(<n>) instead. I am using a custom component which gets added to the current character btw. so I'm not doing this in modmain.lua (which maybe is easier but I want it in my component because the component is used to handle such things), so back to the problem. I want something like dividing the hungerrate by 2. Could I do inst.components.hunger:SetRate(inst.components.hunger:hungerrate / 2); or is there another way? Because I want it to be compatible with all vanilla characters.

Link to comment
Share on other sites

Thanks, Now I understand. Now there's another thing. I see that for example wilson has the hunger rate of 0.15625, (75/day), and that wolfgang has in his mighty mode, wilson's rate * 3. I found a post where another user asked something about this, and I saw a user told that it's not good to hardcode, so that we should use inst.components.hunger:SetRate(<n>) instead. I am using a custom component which gets added to the current character btw. so I'm not doing this in modmain.lua (which maybe is easier but I want it in my component because the component is used to handle such things), so back to the problem. I want something like dividing the hungerrate by 2. Could I do inst.components.hunger:SetRate(inst.components.hunger:hungerrate / 2); or is there another way? Because I want it to be compatible with all vanilla characters.

 

If you want a static rate (unlike wolfgangs, which changes a lot), doing as you said is fine. You only need to do that once by the way.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...