This would allow food eaten once to have a nutritional value of 66%, second time to have 33% and the third to have 0%. Is this correct?
I am not quite clear on how a length of three would require 6 foods, however. Also, I am not clear on what you mean by 'no consequences.' Does that mean eating food at 100% nutritional value or 50% provided we are using MAX(0, (1 - count/2))?
This would allow food eaten once to have a nutritional value of 66%, second time to have 33% and the third to have 0%. Is this correct?
Correct.
I am not quite clear on how a length of three would require 6 foods, however. Also, I am not clear on what you mean by 'no consequences.' Does that mean eating food at 100% nutritional value or 50% provided we are using MAX(0, (1 - count/2))?
Thanks again for clarification!
-David
Yes, I meant always eating food at 100% nutritional value. With a length of 3, you'd need to cycle through 6 different foods to always be able to eat food at 100% nutritional value. Note also that the higher the number is that count is divided by, the less important that is. With MAX(0, (1 - count)) it's much more important (you'd be forced to cycle through 6 different foods), and with MAX(0, (1 - count/3)) you could get away with eating less than 6 different foods, although it wouldn't be completely optimal.
Not sure if anyone had found this bug yet, but I did. It may have not happened to some of you though, as I don't see the bug reported.
I need more info. Could you upload your server and client logs from an instance when you try to connect to the server with TSoL installed? Use http://pastebin.com/ or something similar.
Hey, could you possibly give an example of a formula with an IF statement? Also, are we able to directly set the variable's values ourselves? Like, under a certain condition, distinct_food_groups would be set back to 0.
Hey, could you possibly give an example of a formula with an IF statement? Also, are we able to directly set the variable's values ourselves? Like, under a certain condition, distinct_food_groups would be set back to 0.
A basic example of using IF:
IF(count < 4, 1.0, 0.0)
This would make anything with an eaten count of 1, 2, or 3 have 100% nutritional value, and anything with more than 3 have 0% nutritional value.
To use a different value for a variable, you'd just use a number instead of the variable in whatever conditional you want. Example:
I found a bug in the Food Journal item that crashes my game. After eliminating two other potential causes for the crash, based on the crash report, it's confirmed that the Food Journal is the only explaination as I was using it in all three instances. I can't tell what exactly causes it however, as I was able to turn pages just fine so it seems like it was just a matter of time opened rather than a specific action. Is there a broken loop, in the code, or something maybe?
I found a bug in the Food Journal item that crashes my game. After eliminating two other potential causes for the crash, based on the crash report, it's confirmed that the Food Journal is the only explaination as I was using it in all three instances. I can't tell what exactly causes it however, as I was able to turn pages just fine so it seems like it was just a matter of time opened rather than a specific action. Is there a broken loop, in the code, or something maybe?
Ah, yeah, I've seen that crash before. It's difficult for me to debug because I've never found a way to reproduce it. However, I might have fixed it through fixing something else, and if so it'll be fixed in the next version. Still unsure about that though.
Is it supposed to list each instance of eating the same food, seperately or is that part of the bug? You could check the list when it's opened and merge repeated items down.
I've been able to open AND close the journal, so technically no. That said, if I have it open for more than a minute or so, I can pretty much guarantee the game will crash. Is turning pages doing it maybe? I haven't tested quickly opening the book, closing it, and then doing something else.
I've been able to open AND close the journal, so technically no. That said, if I have it open for more than a minute or so, I can pretty much guarantee the game will crash. Is turning pages doing it maybe? I haven't tested quickly opening the book, closing it, and then doing something else.
I'm using your mod in the "A New Beginning" modpack, if that helps any.
Is there anything you do that makes it crash? Can you post screenshots of each page of your food journal, and a screenshot of a tooltip of a food you've eaten recently?
If I can reproduce this crash, I can probably fix it, but I really have no idea how to cause it myself.
The first time it happened, I was just looking through the book, basically clicking anything I saw to see what everything might do. While testing to see if the book was the cause of the crash, I've just opened the book and clicked through the pages and back again, periodically hovering over foods as I went.
I'll try to remember to take some screenshots after work tomorrow morning. By the way, what numbers should I expect to see at the bottom of each page? I expected that to be the number of pages but the number is far too high. If I remember correctly it was 100+.
The first time it happened, I was just looking through the book, basically clicking anything I saw to see what everything might do. While testing to see if the book was the cause of the crash, I've just opened the book and clicked through the pages and back again, periodically hovering over foods as I went.
I'll try to remember to take some screenshots after work tomorrow morning. By the way, what numbers should I expect to see at the bottom of each page? I expected that to be the number of pages but the number is far too high. If I remember correctly it was 100+.
The bottom number should be the same on every page--it's the total number of foods you've eaten in that world. The numbers in the top right correspond to which page you're on.
I was able to confirm that the book can be opened and closed without crashing if it's brief. I managed to turn a couple pages, turn back to the start, and then close the book. It wasn't until I tried holding the book open that it eventually crashed. The strange part of testing this was the screenshot didn't want to capture the book for the longest time. Unless I forgot to fullscreen on the very last attempt, it seems like the only reason it worked in the end was because it was already on the verge of a crash. It kept taking a screenshot that looked like the before image, with only memory numbers (etc) being different.
Thanks for the timely reply. Just to be clear,
MAX(0, (1 - count/3))
This would allow food eaten once to have a nutritional value of 66%, second time to have 33% and the third to have 0%. Is this correct?
I am not quite clear on how a length of three would require 6 foods, however. Also, I am not clear on what you mean by 'no consequences.' Does that mean eating food at 100% nutritional value or 50% provided we are using MAX(0, (1 - count/2))?
Thanks again for clarification!
-David
Correct.
Yes, I meant always eating food at 100% nutritional value. With a length of 3, you'd need to cycle through 6 different foods to always be able to eat food at 100% nutritional value. Note also that the higher the number is that count is divided by, the less important that is. With MAX(0, (1 - count)) it's much more important (you'd be forced to cycle through 6 different foods), and with MAX(0, (1 - count/3)) you could get away with eating less than 6 different foods, although it wouldn't be completely optimal.
I need more info. Could you upload your server and client logs from an instance when you try to connect to the server with TSoL installed? Use http://pastebin.com/ or something similar.
Hi. Can anyone help me figure this out?
I have food history set to 100, but what shows in the pop-up gui is different. It says a total of "50 hunger."
Any ideas? I guess I would have expected a number of 100 to show.
# The maximum amount of eaten foods stored in the history at a time
I:food.history.length=100
You have
set to true
Hey, could you possibly give an example of a formula with an IF statement? Also, are we able to directly set the variable's values ourselves? Like, under a certain condition, distinct_food_groups would be set back to 0.
A basic example of using IF:
This would make anything with an eaten count of 1, 2, or 3 have 100% nutritional value, and anything with more than 3 have 0% nutritional value.
To use a different value for a variable, you'd just use a number instead of the variable in whatever conditional you want. Example:
I found a bug in the Food Journal item that crashes my game. After eliminating two other potential causes for the crash, based on the crash report, it's confirmed that the Food Journal is the only explaination as I was using it in all three instances. I can't tell what exactly causes it however, as I was able to turn pages just fine so it seems like it was just a matter of time opened rather than a specific action. Is there a broken loop, in the code, or something maybe?
Post the crash log. Use http://pastebin.com or something similar.
Hopefully you can find something in this log because I don't see any errors listed.
http://pastebin.com/DjccVqch
Edit: Ahhh, there's an out of range error.
Ah, yeah, I've seen that crash before. It's difficult for me to debug because I've never found a way to reproduce it. However, I might have fixed it through fixing something else, and if so it'll be fixed in the next version. Still unsure about that though.
Relevant:
https://github.com/squeek502/SpiceOfLife/issues/63
https://github.com/squeek502/SpiceOfLife/issues/69
Is it supposed to list each instance of eating the same food, seperately or is that part of the bug? You could check the list when it's opened and merge repeated items down.
Yes. Does the food journal crash your game every time?
I've been able to open AND close the journal, so technically no. That said, if I have it open for more than a minute or so, I can pretty much guarantee the game will crash. Is turning pages doing it maybe? I haven't tested quickly opening the book, closing it, and then doing something else.
Can you try using this build and see if you still crash when using the food journal?
SpiceOfLife-mc1.7.10-1.3.0-test.jar
Crash log: http://pastebin.com/URrk8yLn
I'm using your mod in the "A New Beginning" modpack, if that helps any.
Is there anything you do that makes it crash? Can you post screenshots of each page of your food journal, and a screenshot of a tooltip of a food you've eaten recently?
If I can reproduce this crash, I can probably fix it, but I really have no idea how to cause it myself.
The first time it happened, I was just looking through the book, basically clicking anything I saw to see what everything might do. While testing to see if the book was the cause of the crash, I've just opened the book and clicked through the pages and back again, periodically hovering over foods as I went.
I'll try to remember to take some screenshots after work tomorrow morning. By the way, what numbers should I expect to see at the bottom of each page? I expected that to be the number of pages but the number is far too high. If I remember correctly it was 100+.
The bottom number should be the same on every page--it's the total number of foods you've eaten in that world. The numbers in the top right correspond to which page you're on.
The modpack recently updated so I repeated the two previous crashes - one just after a fresh install and one after replacing the file you posted here.
Crash after pack update
Crash after replacing mod file
I was able to confirm that the book can be opened and closed without crashing if it's brief. I managed to turn a couple pages, turn back to the start, and then close the book. It wasn't until I tried holding the book open that it eventually crashed. The strange part of testing this was the screenshot didn't want to capture the book for the longest time. Unless I forgot to fullscreen on the very last attempt, it seems like the only reason it worked in the end was because it was already on the verge of a crash. It kept taking a screenshot that looked like the before image, with only memory numbers (etc) being different.