(Yes, I'm aware there are threads for this, but they never show you how to modify the game at all, and only mention that it is possible.) How to begin modifying Nested
Go to the Nested game page on Orteil's site. (Sorry, I tried to post a link, but I'm too new, appearently.)
Right click, and select Save Page As. Download it and drop it in a new directory.
There should be a file titled "Nested.html" and a file named "Nested_files"
To modify the game, you have to find Nestedscript.js in Nested_files.
Scroll down to "And so, the fun begins!" Orteil has written a simple documentation on how to add new objects here. Follow this documentation, and you should be able to add a new object to the game.
The template for an simple object: new Thing(name,contains,namegenerator);
Documentation that Orteil wrote: //How to add a new Thing : // new Thing(name,contains,name generator); // -name is the referral name for this Thing. Unless a name generator is specified, this name will be the default name for any instances of this Thing. // -contains is an array of Things that an instance of this Thing contains, specified by their name. // -For example, ["banana"] means this Thing contains exactly 1 instance of a banana. ["banana","orange"] means it contains 1 banana and 1 orange. // -["banana","strawberry,25%"] means it will contain 1 banana, and has a 25% probability of also containing a strawberry. // -["banana,2-7"] means it will contain between 2 and 7 bananas. // -[".banana"] will not include a banana in the Thing; instead, the Thing will contain whatever the banana normally contains. // -["banana",["sugar","honey"]] will include a banana, and either sugar or honey. Unfortunately, this does not work with the format ".sugar" or ".honey". // -name generator is optional; if specified, the instance of the Thing will be named according to this. // It can be either an array containing other arrays (the name will be patched up from an element of each array) or an identifier for the Name function, like *BOOK*. // A name generator of [["blue ","red "],["frog","toad"]] will produce names such as "blue frog" or "red toad".
To add a new thing, scroll down to the bottom of the code, and add the template, modifying the variables "name" and "contains" if you want. To allow others to use your modification, upload your Nestedscript.js, and share it. Using Modifications (And also, how to play offline.)
Follow steps 1-3 in "How to begin modifying Nested".
Test that you can open Nested.html (the unmodified game) in your browser (Right click -> Open With -> your browser e.g. Firefox, Chrome)
Download the modifed Nestedscript.js.
Open Nested_files and replace your Nestedscript.js with the modifed Nestedscript.js.
Open Nested.html with the modifed Nestedscript.js to begin playing the modifed Nested.