<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.c2dl.info/w/index.php?action=history&amp;feed=atom&amp;title=CrossCode_Modding_Tutorial</id>
	<title>CrossCode Modding Tutorial - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.c2dl.info/w/index.php?action=history&amp;feed=atom&amp;title=CrossCode_Modding_Tutorial"/>
	<link rel="alternate" type="text/html" href="https://wiki.c2dl.info/w/index.php?title=CrossCode_Modding_Tutorial&amp;action=history"/>
	<updated>2026-08-04T18:47:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.c2dl.info/w/index.php?title=CrossCode_Modding_Tutorial&amp;diff=271&amp;oldid=prev</id>
		<title>Streetclaw: Update deprecated tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.c2dl.info/w/index.php?title=CrossCode_Modding_Tutorial&amp;diff=271&amp;oldid=prev"/>
		<updated>2024-09-06T23:46:45Z</updated>

		<summary type="html">&lt;p&gt;Update deprecated tags&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:46, 7 September 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l240&quot;&gt;Line 240:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 240:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Now that we can execute code in the prestart stage, we need to find out how to double the CP points. If we look into the &amp;lt;code&amp;gt;assets/js/game.compiled.js&amp;lt;/code&amp;gt; file we can find out that there is a class called &amp;lt;code&amp;gt;sc.PlayerModel&amp;lt;/code&amp;gt; which contains a function&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Now that we can execute code in the prestart stage, we need to find out how to double the CP points. If we look into the &amp;lt;code&amp;gt;assets/js/game.compiled.js&amp;lt;/code&amp;gt; file we can find out that there is a class called &amp;lt;code&amp;gt;sc.PlayerModel&amp;lt;/code&amp;gt; which contains a function&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;ts&quot;&amp;gt;public addSkillPoints(points: number, element: number, all: boolean, extra: boolean): void&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;ts&quot;&amp;gt;public addSkillPoints(points: number, element: number, all: boolean, extra: boolean): void&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We now want to manipulate &amp;lt;code&amp;gt;addSkillPoints&amp;lt;/code&amp;gt; so that &amp;lt;code&amp;gt;points&amp;lt;/code&amp;gt; are doubled. For that we can use the &amp;lt;code&amp;gt;inject&amp;lt;/code&amp;gt; function. This is a function that exists on all classes that allows you to add and overwrite existing functions. Furthermore, inside that function you can use &amp;lt;code&amp;gt;this.parent(...)&amp;lt;/code&amp;gt; to call the original functon.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We now want to manipulate &amp;lt;code&amp;gt;addSkillPoints&amp;lt;/code&amp;gt; so that &amp;lt;code&amp;gt;points&amp;lt;/code&amp;gt; are doubled. For that we can use the &amp;lt;code&amp;gt;inject&amp;lt;/code&amp;gt; function. This is a function that exists on all classes that allows you to add and overwrite existing functions. Furthermore, inside that function you can use &amp;lt;code&amp;gt;this.parent(...)&amp;lt;/code&amp;gt; to call the original functon.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Streetclaw</name></author>
	</entry>
	<entry>
		<id>https://wiki.c2dl.info/w/index.php?title=CrossCode_Modding_Tutorial&amp;diff=217&amp;oldid=prev</id>
		<title>Dmitmel: fix the mentioned nw.js version</title>
		<link rel="alternate" type="text/html" href="https://wiki.c2dl.info/w/index.php?title=CrossCode_Modding_Tutorial&amp;diff=217&amp;oldid=prev"/>
		<updated>2021-01-26T18:40:18Z</updated>

		<summary type="html">&lt;p&gt;fix the mentioned nw.js version&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:40, 26 January 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l14&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://nwjs.io NW.js SDK zip]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://nwjs.io NW.js SDK zip]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;#9888; &#039;&#039;&#039;The game uses an outdated version of NW.js, so you might want to use version &amp;lt;code&amp;gt;0.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;30&lt;/del&gt;.5&amp;lt;/code&amp;gt; to avoid accidentally using features not yet available in CrossCode.&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;#9888; &#039;&#039;&#039;The game uses an outdated version of NW.js, so you might want to use version &amp;lt;code&amp;gt;0.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;35&lt;/ins&gt;.5&amp;lt;/code&amp;gt; to avoid accidentally using features not yet available in CrossCode.&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Steps ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Steps ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dmitmel</name></author>
	</entry>
	<entry>
		<id>https://wiki.c2dl.info/w/index.php?title=CrossCode_Modding_Tutorial&amp;diff=216&amp;oldid=prev</id>
		<title>Keanucode: Ported 2767mr&#039;s tutorial.</title>
		<link rel="alternate" type="text/html" href="https://wiki.c2dl.info/w/index.php?title=CrossCode_Modding_Tutorial&amp;diff=216&amp;oldid=prev"/>
		<updated>2020-12-23T16:10:29Z</updated>

		<summary type="html">&lt;p&gt;Ported 2767mr&amp;#039;s tutorial.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page contains the steps on how to create your very first CrossCode mod. (header WIP, ask 2767mr)&lt;br /&gt;
&lt;br /&gt;
= Installing CCLoader =&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#9888; &amp;#039;&amp;#039;&amp;#039;Due to DRM it is not possible to mod Xbox Game Pass or Microsoft Store versions of the game.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
See [[CCLoader#Installation]]&lt;br /&gt;
&lt;br /&gt;
= Installing NW.js =&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [[Locations_of_CrossCode_files#Game_files_folder|CC installation folder]]&lt;br /&gt;
* [https://nwjs.io NW.js SDK zip]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#9888; &amp;#039;&amp;#039;&amp;#039;The game uses an outdated version of NW.js, so you might want to use version &amp;lt;code&amp;gt;0.30.5&amp;lt;/code&amp;gt; to avoid accidentally using features not yet available in CrossCode.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
# Open the nwjs-sdk zip&lt;br /&gt;
# Open the folder so you can see the &amp;lt;code&amp;gt;nw.exe&amp;lt;/code&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
[[File:nwjsRoot.png|class=block-img]]&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;li value=3&amp;gt;Extract/drag all files into the [[Locations_of_CrossCode_files#Game_files_folder|CC installation folder]] and replace existing files when prompted.&amp;lt;/li&amp;gt;&lt;br /&gt;
# Delete &amp;lt;code&amp;gt;CrossCode.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Rename &amp;lt;code&amp;gt;nw.exe&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;CrossCode.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
# Open the game&lt;br /&gt;
# Press F12 to open the Chrome DevTools&lt;br /&gt;
# Click the &amp;lt;code&amp;gt;Console&amp;lt;/code&amp;gt; tab&lt;br /&gt;
# In the top bar, click &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt;&lt;br /&gt;
# Choose the second entry in the dropdown list&lt;br /&gt;
# You can now enter commands into the console&lt;br /&gt;
&lt;br /&gt;
= Making a mod =&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [[CCLoader#Installation|Installing CCLoader]]&lt;br /&gt;
* [[Locations_of_CrossCode_files#Game_files_folder|CC installation folder]]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
# Open the [[Locations_of_CrossCode_files#Game_files_folder|CC installation folder]]&lt;br /&gt;
# Open &amp;lt;code&amp;gt;assets&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;mods&amp;lt;/code&amp;gt;&lt;br /&gt;
# Create a new folder for your mod. In this example, we are going to use &amp;lt;code&amp;gt;myMod&amp;lt;/code&amp;gt;&lt;br /&gt;
# Create a new file called &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file is used to tell CCLoader how to load your mod. It contains the internal name (&amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;), the in-game displayed name (&amp;lt;code&amp;gt;ccmodHumanName&amp;lt;/code&amp;gt;), the version number (&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;) and dependencies (&amp;lt;code&amp;gt;ccmodDependencies&amp;lt;/code&amp;gt;). Only &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; are required.&lt;br /&gt;
&lt;br /&gt;
=== Example &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;my-mod&amp;quot;,&lt;br /&gt;
  &amp;quot;ccmodHumanName&amp;quot;: &amp;quot;My Mod&amp;quot;,&lt;br /&gt;
  &amp;quot;version&amp;quot;: &amp;quot;1.0.0&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;li value=5&amp;gt;Find a file to modify&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example we will do a simple palette swap of Lea. You can find her sprites in &amp;lt;code&amp;gt;assets/media/entity/player/move.png&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;li value=6&amp;gt;Copy the file to your mod&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for CCLoader to pick up the file from the mod it needs to be inside the mod folder with the same name as the original. This means that &amp;lt;code&amp;gt;assets/media/entity/player/move.png&amp;lt;/code&amp;gt; turns into &amp;lt;code&amp;gt;assets/mods/myMod/assets/media/entity/player/move.png&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#9888; &amp;#039;&amp;#039;&amp;#039;Do not publish original CrossCode files in your mod.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;li value=7&amp;gt;Edit the file&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example I am using Paint.NET to swap Lea&amp;#039;s red clothes for green ones:&lt;br /&gt;
&lt;br /&gt;
[[File:leaRecolor.png|class=block-img]]&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;li value=8&amp;gt;Restart the game and test your mod&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:leaRecolored.png|class=block-img]]&lt;br /&gt;
&lt;br /&gt;
= Editing JSON =&lt;br /&gt;
&lt;br /&gt;
Often it is not enough to just edit png files to make mods. Changing sizes, making new entities or maps require one to edit or create new JSON files. This guide shows you how to work with JSON files in your mod.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [[CrossCode Modding Tutorial#Making a mod|Making a mod]]&lt;br /&gt;
&lt;br /&gt;
== New JSON files ==&lt;br /&gt;
&lt;br /&gt;
Adding new JSON files does not require any special attention. Simply put the file into the correct folder and CCLoader will pick it up automatically.&lt;br /&gt;
&lt;br /&gt;
== Existing JSON files ==&lt;br /&gt;
&lt;br /&gt;
Editing existing JSON files is problematic in a few cases. Now only are these files pretty big but there are also a lot of instances where multiple mods want to modify the same file. In that case simply replacing the entire file doesn’t work.&lt;br /&gt;
&lt;br /&gt;
Instead you can use a mechanism called patches. These are files that only record the changes made to the original file, allowing multiple mods to apply patches to the same file. They work similar to file replacements as they require you to use the same name as the original file. The difference is that they append a &amp;lt;code&amp;gt;.patch&amp;lt;/code&amp;gt; to the filename and use special sytanx exmplained in more detail on [[Patching]].&lt;br /&gt;
&lt;br /&gt;
In order to work with JSON files it is recommend to beautify them before using them. You can use [https://beautifier.io/ beautifier.io] to do that for you.&lt;br /&gt;
&lt;br /&gt;
In this example we will make a patch that will increase the damage Lea does. This information can be found in &amp;lt;code&amp;gt;assets/data/players/lea.json&amp;lt;/code&amp;gt;. Once beautified one can easily see the value we want to modify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;character&amp;quot;: &amp;quot;main.lea&amp;quot;,&lt;br /&gt;
    &amp;quot;sheet&amp;quot;: &amp;quot;player&amp;quot;,&lt;br /&gt;
    &amp;quot;headIdx&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;class&amp;quot;: &amp;quot;SPHEROMANCER&amp;quot;,&lt;br /&gt;
    &amp;quot;stats&amp;quot;: {&lt;br /&gt;
        &amp;quot;hp&amp;quot;: {&lt;br /&gt;
            &amp;quot;base&amp;quot;: 200,&lt;br /&gt;
            &amp;quot;increase&amp;quot;: 2000,&lt;br /&gt;
            &amp;quot;variance&amp;quot;: 0.1&lt;br /&gt;
        },&lt;br /&gt;
        &amp;quot;attack&amp;quot;: {&lt;br /&gt;
            &amp;quot;base&amp;quot;: 20,&lt;br /&gt;
            &amp;quot;increase&amp;quot;: 200,&lt;br /&gt;
            &amp;quot;variance&amp;quot;: 0.9&lt;br /&gt;
        },&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we want to somehow change &amp;lt;code&amp;gt;stats.attack.base&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt;. For that we first create a patch file &amp;lt;code&amp;gt;assets/mods/myMod/assets/data/players/lea.json.patch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#128640; &amp;#039;&amp;#039;&amp;#039;Tip: Most editors will not recognize these files as JSON by default. Almost all popular editors include a feature to manually set which type of file you are currently editing.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
First you can begin the file with &amp;lt;code&amp;gt;[]&amp;lt;/code&amp;gt; to signal that this file is using the “Patch Step” format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
[&lt;br /&gt;
&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we insert a step that navigates into the &amp;lt;code&amp;gt;attack&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;ENTER&amp;quot;,&lt;br /&gt;
    &amp;quot;index&amp;quot;: [&amp;quot;stats&amp;quot;, &amp;quot;attack&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can overwride a value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;SET_KEY&amp;quot;,&lt;br /&gt;
    &amp;quot;index&amp;quot;: &amp;quot;base&amp;quot;,&lt;br /&gt;
    &amp;quot;content&amp;quot;: 200&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end, we navigate back to the root of the document. In this case it is not required but will make future additions a lot easier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;EXIT&amp;quot;,&lt;br /&gt;
    &amp;quot;count&amp;quot;: 2&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end we end up with this &amp;lt;code&amp;gt;lea.json.patch&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
[{&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;ENTER&amp;quot;,&lt;br /&gt;
    &amp;quot;index&amp;quot;: [&amp;quot;stats&amp;quot;, &amp;quot;attack&amp;quot;]&lt;br /&gt;
}, {&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;SET_KEY&amp;quot;,&lt;br /&gt;
    &amp;quot;index&amp;quot;: &amp;quot;base&amp;quot;,&lt;br /&gt;
    &amp;quot;content&amp;quot;: 200&lt;br /&gt;
}, {&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;EXIT&amp;quot;,&lt;br /&gt;
    &amp;quot;count&amp;quot;: 2&lt;br /&gt;
}]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Making a JavaScript mod =&lt;br /&gt;
&lt;br /&gt;
Although the game provides a very powerful JSON scripting system it is sometimes required to add new puzzle elements or edit internal workings of existing ones. For this one needs javascript mods.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [[CrossCode Modding Tutorial#Making a mod|Making a mod]]&lt;br /&gt;
&lt;br /&gt;
== Entry points ==&lt;br /&gt;
&lt;br /&gt;
In order to load a JavaScript file, there needs to be an entry in the &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt; of the mod. There are multiple possible values here that reference different points in time at which a mod is loaded. Furthermore there is an entry called &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; which combines all these entry points.&lt;br /&gt;
&lt;br /&gt;
For example, if we want to double all gained CP points we need to add a script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;name&amp;quot;: &amp;quot;my-mod&amp;quot;,&lt;br /&gt;
    &amp;quot;ccmodHumanName&amp;quot;: &amp;quot;My Mod&amp;quot;,&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;1.0.0&amp;quot;,&lt;br /&gt;
    &amp;quot;plugin&amp;quot;: &amp;quot;plugin.js&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;100%&amp;quot;| &amp;amp;#9888; If you use entry points other than &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; you should always set &amp;lt;code&amp;gt;&amp;amp;quot;module&amp;amp;quot;: true&amp;lt;/code&amp;gt; as well.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mod loading stages ==&lt;br /&gt;
&lt;br /&gt;
=== Prestart ===&lt;br /&gt;
&lt;br /&gt;
This is the entry point you usually want to use. At this point, most of the game code is loaded but almost none of it executed yet. This makes it the perfect chance to change how the internals work.&lt;br /&gt;
&lt;br /&gt;
=== Preload ===&lt;br /&gt;
&lt;br /&gt;
At this point none of the game has been loaded yet. This means that while nothing has loaded yet but one can use this to set up libraries or use some JavaScript black magic.&lt;br /&gt;
&lt;br /&gt;
=== Postload ===&lt;br /&gt;
&lt;br /&gt;
Here some of the game code has been loaded, however pretty much nothing has been executed yet. Specifically, none of the resources have been been loaded yet, making it possible to intercept and work with them.&lt;br /&gt;
&lt;br /&gt;
=== Main ===&lt;br /&gt;
&lt;br /&gt;
This stage, which has been called “main” for legacy reasons, executes code as soon as the title menu start playing. This allows mods to use code that may have not been executed yet in the prestart stage, though it should be avoided is easily possible.&lt;br /&gt;
&lt;br /&gt;
== Plugin ==&lt;br /&gt;
&lt;br /&gt;
While using loading stages directly in the &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt; directly executes the code in a script the plugin combines multiple stages at once. Every plugin defines an exported JavaScript class that is used to execute the code.&lt;br /&gt;
&lt;br /&gt;
Since we defined the file as &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt; above we create a new file &amp;lt;code&amp;gt;assets/mods/myMod/plugin.js&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
export default class MyMod {&lt;br /&gt;
    prestart() {&lt;br /&gt;
        //Prestart code will go in here.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The advantage of using plugins over direct stages is that the constructor of the plugin receives an object as argument which can be used to find out which folder the current mod is stored in.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#128640; &amp;#039;&amp;#039;&amp;#039;Tip: A plugin can also be used to write async code in a loading stage, blocking all other mods from loading until it has finished.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now that we can execute code in the prestart stage, we need to find out how to double the CP points. If we look into the &amp;lt;code&amp;gt;assets/js/game.compiled.js&amp;lt;/code&amp;gt; file we can find out that there is a class called &amp;lt;code&amp;gt;sc.PlayerModel&amp;lt;/code&amp;gt; which contains a function&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ts&amp;quot;&amp;gt;public addSkillPoints(points: number, element: number, all: boolean, extra: boolean): void&amp;lt;/source&amp;gt;&lt;br /&gt;
We now want to manipulate &amp;lt;code&amp;gt;addSkillPoints&amp;lt;/code&amp;gt; so that &amp;lt;code&amp;gt;points&amp;lt;/code&amp;gt; are doubled. For that we can use the &amp;lt;code&amp;gt;inject&amp;lt;/code&amp;gt; function. This is a function that exists on all classes that allows you to add and overwrite existing functions. Furthermore, inside that function you can use &amp;lt;code&amp;gt;this.parent(...)&amp;lt;/code&amp;gt; to call the original functon.&lt;br /&gt;
&lt;br /&gt;
We can use this to make a mod that doubles all CP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot; line=&amp;quot;line&amp;quot;&amp;gt;&lt;br /&gt;
export default class MyMod {&lt;br /&gt;
    prestart() {&lt;br /&gt;
        sc.PlayerModel.inject({&lt;br /&gt;
            addSkillPoints(points, element, all, extra) {&lt;br /&gt;
                this.parent(points*2, element, all, extra);&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example mod can be found on GitHub.&amp;lt;ref&amp;gt;https://github.com/CCDirectLink/CrossCode-Modding-Tutorial/tree/master/example&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Share your mod =&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [[CrossCode Modding Tutorial#Making a mod|Making a mod]]&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
# Open your mod folder that contains the &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt; file&lt;br /&gt;
# Select all files/folders needed for the mod&lt;br /&gt;
# Create a zip archive from these files. On Windows you can do this using right click &amp;amp;gt; send to &amp;amp;gt; zip-archived folder&lt;br /&gt;
&lt;br /&gt;
You can already share this file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;4&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Rename the .zip file to .ccmod&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows other users to simply drag the file into the mods folder and not have to worry about extracting it&lt;br /&gt;
&lt;br /&gt;
== Publish on the official list ==&lt;br /&gt;
&lt;br /&gt;
Since the process of approving a mod for the official list is a bit complicated (and is likely to change in the future) the best way is to:&lt;br /&gt;
* Publish your source code on [https://github.com/ GitHub]&lt;br /&gt;
* Make sure you have a correct version number&lt;br /&gt;
* Create a [https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/managing-releases-in-a-repository Github Release] - you can upload your .ccmod file there&lt;br /&gt;
* Message (an admin) on the [https://discord.gg/TFs6n5v CrossCode Modding Discord] to add your mod to the list&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Modding guides]]&lt;/div&gt;</summary>
		<author><name>Keanucode</name></author>
	</entry>
</feed>