Changes

Jump to navigation Jump to search
2,328 bytes added ,  19:39, 17 September 2022
→‎Quarry Levels: thanks and praise
Line 116: Line 116:  
::The other code about spawning flying monsters offscreen and populating the level happen after the level type is set, and the monsters do update every 10 in-game minutes, but again, only after the level type is set.
 
::The other code about spawning flying monsters offscreen and populating the level happen after the level type is set, and the monsters do update every 10 in-game minutes, but again, only after the level type is set.
 
::I literally hit '''<samp>this.isQuarryArea = true;</samp>''' each time until I drank Oil of Garlic, and then the whole block got skipped. Something in the <samp>else if</samp> conditions didn't get met, and I don't see what it is. I guess my next step is to break the code up into separate "if" statements, so I can check each condition separately. :/ [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 20:40, 11 September 2022 (UTC)
 
::I literally hit '''<samp>this.isQuarryArea = true;</samp>''' each time until I drank Oil of Garlic, and then the whole block got skipped. Something in the <samp>else if</samp> conditions didn't get met, and I don't see what it is. I guess my next step is to break the code up into separate "if" statements, so I can check each condition separately. :/ [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 20:40, 11 September 2022 (UTC)
 +
:::I broke the <samp>else if</samp> conditions up into separate <samp>if</samp> statements, and the failure is happening on <samp>if (r.NextDouble() < 0.044)</samp>. But, only after drinking Oil of Garlic. This doesn't make sense to me at all.
 +
:::Therefore, I'm going to add it to the page without a code reference. It's repeatedly reproduceable in-game, so I believe it's a true statement. If anyone can provide any insight into the game code, it will be appreciated! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 15:27, 13 September 2022 (UTC)
 +
 +
:::: Ah! It's subtle, but explainable! Randoms always produce numbers in a specific order. So what was happening was roughly:
 +
::::* Without Oil of Garlic: passes !this.AnyOnlineFarmerHasBuff(23), asks the Random r for a random number, fails somewhere in the next few checks, goes to else if, asks the Random for another random number, passes that check.
 +
::::* With Oil of Garlic: fails !this.AnyOnlineFarmerHasBuff(23), doesn't ask the Random r in the if statement and goes to the else if directly. Because the random wasn't queried, the numbers produced will in effect shift by one, which then caused it to fail (which is very likely, given there's only a 4.4% chance of passing).
 +
 +
::::I suspect it's perfectly possible to get a quarry floor with Oil of Garlic, what you're seeing is just a consequence of how Random works.
 +
::::Anyways, the `Game1.MasterPlayer.hasOrWillReceiveMail("VisitedQuarryMine")` part of the check was added in 1.5, otherwise it seems date from 1.4.
 +
::::[[User:Atravita|Atravita]] ([[User talk:Atravita|talk]]) 19:11, 17 September 2022 (UTC)
 +
 +
:::::O.M.G. and holy tamales... I stepped through that code for 3 days! Genius, Atravita, genius!! When you say "subtle", you aren't kidding.
 +
:::::I'm going to revert my edits now that we have an explanation. I'll be floored by your insight for quite a while. 👍
 +
:::::And thank you to IBugOne for the assistance offered on my talk page too! I do have the v1.4 decompiled code, it's just a matter of finding a LAN cable and transferring it from the old PC to the new one. (For context, it's been almost a year and it's still on my "to do" list.) 😁
 +
:::::Wonderful work, guys! Really wonderful! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 19:38, 17 September 2022 (UTC)
106,354

edits

Navigation menu