Conflict when using with Cookie Monster
First and foremost, this is a fantastic script and super helpful to get past the tedium. Thank you for taking the time to code it and keep it updated.
I noticed, with the latest version at least, if you try to use it with Cookie Monster, the cookie count freezes and will not update any more. I tested this in Firefox and Google Chrome, and they both seem to have the same issues. Both addons work fine seperate, but together, something seems to break. Please let me know if there's any relevant information I can give.
I can confirm the same issue occurs for me
The issue seems to happen regardless of load order. Here is the stack trace of what I think is causing the error:
SimHasGod.js:13 Uncaught TypeError: Cannot read properties of undefined (reading 'gods')
at Jt (SimHasGod.js:13)
at SimGetHeavenlyMultiplier.js:21
at sn (CalculateGains.js:44)
at gn (BuyBuildingBonusIncome.js:41)
at IndividualAmountTillNextAchievement.js:9
at AllAmountTillNextAchievement.js:30
at Array.forEach (<anonymous>)
at jn (AllAmountTillNextAchievement.js:12)
at Hn (CacheInit.js:32)
at ma (Initialization.js:37)
For those interested, I think that the issue is because of a bug with Crustulum rather than CookieMonster. It is replacing Game.hasGod with a custom function regardless if that minigame is present or not. I think it is missing an early return.
I'm not really interested in using that feature anyway, so I found that if you just replace said function of Crustulum as well as the function Game.hasGod, the two addons can be used together successfully.
Crustulum.Hijack.hasGod = () => {};
Game.hasGod = undefined;
However, you need to wait a bit before running the second line. Instead of that, you can clear the timeout in order to do it all simultaneously. Here is a self contained fragment:
(function () {
Crustulum.Hijack.hasGod = () => {};
setTimeout(() => {
Game.hasGod = undefined;
}, 2000);
}());
The issue seems to happen regardless of load order. Here is the stack trace of what I think is causing the error:
SimHasGod.js:13 Uncaught TypeError: Cannot read properties of undefined (reading 'gods') at Jt (SimHasGod.js:13) at SimGetHeavenlyMultiplier.js:21 at sn (CalculateGains.js:44) at gn (BuyBuildingBonusIncome.js:41) at IndividualAmountTillNextAchievement.js:9 at AllAmountTillNextAchievement.js:30 at Array.forEach (<anonymous>) at jn (AllAmountTillNextAchievement.js:12) at Hn (CacheInit.js:32) at ma (Initialization.js:37)For those interested, I think that the issue is because of a bug with Crustulum rather than CookieMonster. It is replacing
Game.hasGodwith a custom function regardless if that minigame is present or not. I think it is missing an early return.I'm not really interested in using that feature anyway, so I found that if you just replace said function of Crustulum as well as the function
Game.hasGod, the two addons can be used together successfully.Crustulum.Hijack.hasGod = () => {}; Game.hasGod = undefined;However, you need to wait a bit before running the second line. Instead of that, you can clear the timeout in order to do it all simultaneously. Here is a self contained fragment:
(function () { Crustulum.Hijack.hasGod = () => {}; setTimeout(() => { Game.hasGod = undefined; }, 2000); }());
how exactly would i go about doing this? i have no coding experience, just want to run the mod without it freezing the game. is there a way?
- load crustulum as normal
- f12 to open dev console in browser
- paste this into the console
(function () { Crustulum.Hijack.hasGod = () => {}; setTimeout(() => { Game.hasGod = undefined; }, 2000); }()); - now you can load cookie monster :)