</svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><buttontype="button"class="VPNavBarHamburger hamburger"aria-label="mobile navigation"aria-expanded="false"aria-controls="VPNavScreen"data-v-ccf7ddecdata-v-e5dd9c1c><spanclass="container"data-v-e5dd9c1c><spanclass="top"data-v-e5dd9c1c></span><spanclass="middle"data-v-e5dd9c1c></span><spanclass="bottom"data-v-e5dd9c1c></span></span></button></div></div></div></div><divclass="divider"data-v-ccf7ddec><divclass="divider-line"data-v-ccf7ddec></div></div></div><!----></header><divclass="VPLocalNav empty fixed"data-v-5d98c3a5data-v-a6f0e41e><divclass="container"data-v-a6f0e41e><!----><divclass="VPLocalNavOutlineDropdown"style="--vp-vh:0px;"data-v-a6f0e41edata-v-17a5e62e><buttondata-v-17a5e62e>Return to top</button><!----></div></div></div><!----><divclass="VPContent"id="VPContent"data-v-5d98c3a5data-v-1428d186><divclass="VPDoc has-aside"data-v-1428d186data-v-39a288b8><!--[--><!--]--><divclass="container"data-v-39a288b8><divclass="aside"data-v-39a288b8><divclass="aside-curtain"data-v-39a288b8></div><divclass="aside-container"data-v-39a288b8><divclass="aside-content"data-v-39a288b8><divclass="VPDocAside"data-v-39a288b8data-v-3f215769><!--[--><!--]--><!--[--><!--]--><navaria-labelledby="doc-outline-aria-label"class="VPDocAsideOutline"data-v-3f215769data-v-a5bbad30><divclass="content"data-v-a5bbad30><divclass="outline-marker"data-v-a5bbad30></div><divaria-level="2"class="outline-title"id="doc-outline-aria-label"role="heading"data-v-a5bbad30>On this page</div><ulclass="VPDocOutlineItem root"data-v-a5bbad30data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><divclass="spacer"data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><divclass="content"data-v-39a288b8><divclass="content-container"data-v-39a288b8><!--[--><!--]--><mainclass="main"data-v-39a288b8><divstyle="position:relative;"class="vp-doc _public_lit_docs_main-mod-info"data-v-39a288b8><div><h1id="mod-js"tabindex="-1">mod.js <aclass="header-anchor"href="#mod-js"aria-label="Permalink to "mod.js""></a></h1><p>All of the non-layer code and data that you're likely to edit is here in <ahref="/js/mod.js">mod.js</a>! Everything in <ahref="/js/mod.js">mod.js</a> will not be altered by updates, besides the addition of new things.</p><p>Here's a breakdown of what's in it:</p><ul><li><p>modInfo is where most of the basic configuration for the mod is. It contains:</p><ul><li><p>name: The name of your mod. (a string)</p></li><li><p>id: The id for your mod, a unique string that is used to determine savefile location. Setting it is important!</p></li><li><p>author: The name of the author, displayed in the info tab.</p></li><li><p>pointsName: This changes what is displayed instead of "points" for the main currency. (It does not affect it in the code.)</p></li><li><p>discordName, discordLink: If you have a Discord server or other discussion place, you can add a link to it.</p><p>"discordName" is the text on the link, and "discordLink" is the url of an invite. If you're using a Discord invite, please make sure it's set to never expire.</p></li><li><p>offlineLimit: The maximum amount of offline time that the player can accumulate, in hours. Any extra time is lost. (a number)</p><p>This is useful because most of these mods are fast-paced enough that too much offline time ruins the balance, such as the time in between updates. That is why I suggest developers disable offline time on their own savefile.</p></li><li><p>initialStartPoints: A Decimal for the amount of points a new player should start with.</p></li></ul></li><li><p>VERSION is used to describe the current version of your mod. It contains:</p><ul><li>num: The mod's version number, displayed at the top right of the tree tab.</li><li>name: The version's name, displayed alongside the number in the info tab.</li></ul></li><li><p>changelog is the
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">var</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> doNotCallTheseFunctionsEveryTick </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"doReset"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"buy"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"onPurchase"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"blowUpEverything"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span></code></pre></div><ul><li><p>getStartPoints(): A function to determine the amount of points the player starts with after a reset. (returns a Decimal value)</p></li><li><p>canGenPoints(): A function returning a boolean for if points should be generated. Use this if you want an upgrade to unlock generating points.</p></li><li><p>getPointGen(): A function that calculates your points per second. Anything that affects your point gain should go into the calculation here.</p></li><li><p>addedPlayerData(): A function that returns any non-layer-related data that you want to be added to the save data and "player" object.</p></li></ul><divclass="language-js vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">js</span><preclass="shiki shiki-themes github-light github-dark vp-code"tabindex="0"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> addedPlayerData</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() { </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}}</span></span></code></pre></div><ul><li><p>displayThings: An array of functions used to display extra things at the top of the tree tab. Each function returns a string, which is a line to display (with basic HTML support). If a function returns nothing, nothing is displayed (and it doesn't take up a line).</p></li><li><p>isEndgame(): A function to determine if the player has reached the end of the game, at which point the "you win!" screen appears.</p></li></ul><p>Less important things beyond this point!</p><ul><li>maxTickLength(): Returns the maximum tick length, in milliseconds. Only really useful if you have something that reduces over time, which long ticks mess up (usually a challenge).</li></ul></div></div></main><footerclass="VPDocFooter"data-v-39a288b8data-v-d4a0bba5><!--[--><!--]--><divclass="edit-info"data-v-d4a0bba5><!----><divclass="last-updated"data-v-d4a0bba5><pclass="VPLastUpdated"data-v-d4a0bba5data-v-7e05ebdb>Last updated: <timedatetime="2023-11-28T02:07:43.000Z"data-v-7e05ebdb></time></p></div></div><!----></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>