Editing
Isotopeia:Modding
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Quality}} In Isotopeia, the modding API was introduced in the version [[Isotopeia:Version history|1.4.0]] and is a way to add upgrades to the game without modifying the source code directly. The modding API is most commonly used to add upgrades using the custom JSON format, but direct JavaScript additions are also included. == Utilities == Utilities are methods through which the modding API can be accessed or utilized more effectively/easily. === <code>combinemods.html</code> === <code>./combinemods.html</code> is a file included in the [https://github.com/Isotopeia/Isotopeia Isotopeia source code] which enables compressing 2 mods' contents into 1 singular JSON object. ==== Usage ==== To use the <code>combinemods.html</code> tool, one must input the JSON for one mod in the first text input, and the JSON for the second mod in the second text input. Then, the user must click the "Combine" button to the right of the "Mod 2" input to compress the mods into one. The outputted, combined mod will be put into the "Mod 1" box to easily add more mods to the same JSON object. == Modding API documentation == All of the following headers and contents in code blocks (like <code>this</code>) are formatted in JSON, contained in an object. === <code>buildings</code> === <code>buildings</code> can be made at the root of the object, like this: <pre> { "buildings": {...} } </pre> <code>buildings</code> contains the properties for all types of currencies' upgrades (V<sub>e</sub> or <code>en</code>, e<sup>-</sup> or <code>e</code>, and u or <code>u</code>). ==== <code>buildings:e</code> ==== <code>buildings:e</code> means the <code>e</code> object contained in the <code>buildings</code> object, which itself is in the main object. The <code>e</code> stands for <u>e</u>lectron, which represents that the <code>buildings:e</code> object contains electron upgrades. ==== <code>buildings:en</code> ==== <code>buildings:en</code> means the <code>en</code> object contained in the <code>buildings</code> object, which itself is in the main object. The <code>en</code> stands for <u>e</u>lectron <u>n</u>eutrino, which represents that the <code>buildings:en</code> object contains electron neutrino upgrades. ==== <code>buildings:u</code> ==== <code>buildings:u</code> means the <code>u</code> object contained in the <code>buildings</code> object, which itself is in the main object. The <code>u</code> stands for <u>u</u>p quark, which represents that the <code>buildings:u</code> object contains up quark upgrades. === Upgrade format for <code>buildings:</code>+<code>e</code>/<code>en</code>/<code>u</code> === The upgrade format is how the upgrades are defined in the <code>e</code>/<code>en</code>/<code>u</code> objects in the<code>buildings</code> object (in the main object). These are contained within another object. ==== <code>price</code> ==== <code>price</code> is the starting price for the upgrade; in other words, if you were to buy 1 of this upgrade starting at 0, this is what it would cost. The <i>curves</i> of how the price is modified for more than 1 or past your first upgrade is always set at <code>Math.floor(1.25*previousPrice)</code>. ==== <code>name</code> ==== <code>name</code> is the display name of the upgrade that the end user will see, as opposed to <code>id</code> which is purely internal and for discerning different upgrades. ==== <code>perSecond</code> ==== <code>perSecond</code> represents how many of the currency (<code>e</code>/<code>en</code>/<code>u</code>) that you will gain per second after buying one upgrade. ==== <code>id</code> ==== <code>id</code> is a purely internal identifier to differentiate between 2 objects. This is traditionally formatted in <code>camelCase</code> while trying to avoid abbreviating unless the name is too long. === <code>customBehaviors</code> === The <code>customBehaviors</code> section under the main object allows you to include your own JavaScript that will be ran when the webpage is loaded and <u>never again</u> until you reload or close/reopen the game. This is programatically implemented using the <code>window.onload</code> function while iterating through each mod added.
Summary:
Please note that all contributions to matthyWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
MatthyWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Quality
(
edit
)
Template:QualityStars
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Isotopeia
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information