Intro for Mod Beginners (4.2 Source Codes!)
I am a modding beginner. I've been using @nilly's Mod Selector for a few weeks now, and decided to use his platform to help in learning the modding process.
This will document my learning progress. I hope beginners can use this as a reference, and experienced modders can comment to give constructive criticism, correct stupid mistakes, and contribute!
Feedback is greatly appreciated!
EDIT: Wow, didn't expect 4.2 to be out so quickly. I'll practice the methods below to get locations and lines for Nilly's Mod Selector.
ROTMG 4.2 Source Code: (Testing in Progress)
No Debuff
Production Mod (Works)
Remove Loading Screen (Works)
No Ally Projectile (Not Working, disconnects)
Numerical HP/MP (Works)
Spammable Notification
Auto Nexus (Not Working)(Helpful Link)
Sprite World Floor Hack
Goal: To understand the process of modding ROTMG clients, and apply the knowledge to future modded clients
Tools:
After installing our tools, and using nilly's 4.0.0 Mod Selector, let's start with something simple;
Disassemble file using RABCDAasm:
Understanding Remove Loading Screen:
We start here because the mod is very simple, only one line.
We can see this by going into nilly's 4.0 Mod Selector folder\mods\4.0.0_remLoading.zip and extracting the 2 files.
The XML file shows the location, where the mod is inserted. The text file shows the mod itself.
Can you see what the Remove Loading Screen mod is? (Answer: returnvoid)
Let's understand how this mod works:
In Nilly's 4.0 Mod Selector folder...
We can see:
Compare this to our modded client (4.0mod.swf) to see how code is added:
Remove Loading Screen Mod Part 1
Remove Loading Screen Mod Part 2
Remove Loading Screen Mod Part 3
Remove Loading Screen Mod Part 4
To add this to Nilly's Mod Selector:
If we run Nilly's Mod Selector using the 4.1 client, and choose Remove Loading Screens mod, we will have successfully implemented the mod!
Production Server Mod
Similar to Remove Loading Screen Mod, only one line of mod code
To add this to Nilly's Mod Selector:
Numerical HP/MP Mod (4.0 to 4.2)
No Ally Projectiles Mod (Line 1 of 2)
No Ally Projectiles Mod (Line 2 of 2)
No Debuff Mod
Blind: func _-0SX, line 1840
Stunned: func _-0LQ, line 1795
Slowed: func _-0mb, line 1651
Confused: func _-0iD, line 1946
Paralyzed: func _-02h, line 2089
Hallucinating: func _-rt, line 2247
Drunk: func _-0Cf, line 1894
Spammable Notifications Mod (4.0 to 4.2)
AutoNexus Mod (4.0 to 4.2)
Auto Nexus Update Variables
This will document my learning progress. I hope beginners can use this as a reference, and experienced modders can comment to give constructive criticism, correct stupid mistakes, and contribute!
Feedback is greatly appreciated!
EDIT: Wow, didn't expect 4.2 to be out so quickly. I'll practice the methods below to get locations and lines for Nilly's Mod Selector.
ROTMG 4.2 Source Code: (Testing in Progress)
No Debuff
- Blind: function _-0GL, line 1812
- Confused: function _-Uv, line 1903
- Drunk: function _-fp, line 1857
- Hallucinating: function _-0OT, line 2206
- Paralyzed: function _-0LR, line 2054
- Stunned: function _-Iz, line 1765
Production Mod (Works)
- _-BQ/_-WQ.class.asasm, line 451
Remove Loading Screen (Works)
- _-Gy/_-0dF.class.asasm, line 143
No Ally Projectile (Not Working, disconnects)
- _-0JO, line 3138 (after pushscope) & line 3764 (after jump L10), line 3776 (after pushscope)
Numerical HP/MP (Works)
- _-3m.class.asasm, line 1356
Spammable Notification
- _-Cl_/_-z-.class.asasm, line 380
Auto Nexus (Not Working)(Helpful Link)
- Seems like 4.2 implemented a "one chance" system where your first death on your first character doesn't count. Maybe this is affecting the AutoNexus mod?
- Player.class.asasm, line 5003)
- Variables: _-KQ and _-0d5
- Nexus Function: _-Ll
Sprite World Floor Hack
- Works
Goal: To understand the process of modding ROTMG clients, and apply the knowledge to future modded clients
Tools:
- Yogda
- RABCDAsm
- Notepad++
- Astrogrep
- Game Client (no mods)(Follow Instructions)
Optional (used for examples): - Nilly's 4.0.0 Mod Selector
After installing our tools, and using nilly's 4.0.0 Mod Selector, let's start with something simple;
Disassemble file using RABCDAasm:
- Unzip your RABCDAsm_v###.zip folder, rename it to RABCDAsm
- Go to nilly's 4.0 Mod Selector folder
- Rename the unmodded game client file (AssembleeGameClient1351811704.swf) to client.swf
- Use RABCDAsm to disassemble our file
- Create a modded 4.0 client using nilly's 4.0 mod selector
- Rename the modded file to 4.0mod.swf
- Disassemble using RABCDAsm, using 4.0mod.swf instead of client.swf
- Rename your 4.1 Game Client to 4.1client, disassemble the 4.1 Game Client using RABCDAsm.
- Open RABCDAsm folder, make sure you have a client-1 folder, 4.0mod-1 folder, and a 4.1client-1 folder
Understanding Remove Loading Screen:
We start here because the mod is very simple, only one line.
We can see this by going into nilly's 4.0 Mod Selector folder\mods\4.0.0_remLoading.zip and extracting the 2 files.
The XML file shows the location, where the mod is inserted. The text file shows the mod itself.
Can you see what the Remove Loading Screen mod is? (Answer: returnvoid)
Let's understand how this mod works:
In Nilly's 4.0 Mod Selector folder...
- Open 4.0.0_remLoading.zip, extract the 2 files
- Open remLoading.xml in Notepad++
We can see:
- The name of the mod is Mod Loading Screen (mod id)
- The location where we need to add code (_-0Tk/_-0TX.class.asasm)
- The line number where we add code (line="136")
Compare this to our modded client (4.0mod.swf) to see how code is added:
- Go to RABCDAsm folder, open 4.0mod-1 folder
- Find the location of the mod (_-0Tk folder, _-0Tx.class.asasm file)
- Open the _-0Tx.class.asasm file using Notepad++
- Find the line where the mod is supposed to be (line="136")
- Find the mod inserted into the code (returnvoid)
- It is clear that the mod code is added AFTER the designated line
Remove Loading Screen Mod Part 1
- First we use the 4.0 client.
- Go to RABCDAsm\4.0mod-1\_-0Tk\_-0TX.class.asasm
- Open _-0TX.class.asasm in Notepad++
- Find the line where the mod is inserted (line="136")
- Remember the surrounding code lines (maxscopedepth 10, code)
- Copy a section of distinct code, one that does not change.
I used QName(PackageNamespace("flash.display"), "MovieClip"
NOTE: Do not use a line of code with variables, since they will be useless in the 4.1 client. - Open Astrogrep
- Set the search path to your RABCDAsm\4.0mod-1 folder
- Paste the code you copied earlier into the Search Text bar. Click Search.
- Select the location of the mod (_-0TX.class.asasm)
Notice that the code matches our _-0TX code in Notepad++! Remember the Count (9)!
DO NOT CLOSE Astrogrep!
Remove Loading Screen Mod Part 2
- Change the Search Path to your RABCDAsm\4.1client-1 folder,
- Paste the previous copied code into Search Text, Click Search
- Find the entry with a similar code format and count as our previous search.
Notice that the Located In and Name is different!
Now we know: _-0Pw\_-0NP.class.asasm is the location in our 4.1 client that we put our mod in. - While selecting _-0NP.class.asasm, remember a line number (I chose 97)
DO NOT CLOSE Astrogrep!
Remove Loading Screen Mod Part 3
- Open RABCDAsm\_-0Pw\_-0NP.class.asasm using Notepad++
- Go to your chosen line number (97)
- Look around, make sure the code is very similar to the 4.0mod-1 code.
- Find the code before the mod {maxscopedepth 10, code)
- Remember what line the code is on (line="118")
Remove Loading Screen Mod Part 4
To add this to Nilly's Mod Selector:
- Go to your nilly's Mod Selector\mods folder
- Open the 4.0.0_remLoading.zip file, extract the .xml
- Open the .xml in Notepad++
- Change the location to our new location (file2mod="_-0Pw\_-0NP.class.asasm")
- Change the line to our new line(line="118")
- Save the file, add it to your 4.0.0_remLoading.zip and replace the old file.
If we run Nilly's Mod Selector using the 4.1 client, and choose Remove Loading Screens mod, we will have successfully implemented the mod!
Production Server Mod
Similar to Remove Loading Screen Mod, only one line of mod code
- Open Nilly's Mod Selector\mods folder
- Extract files from 4.0.0_production.zip
- Open both files in Notepad++
- Notice how our mod only has one line of code (returnvalue)
- Notice the location and line of the mod (_-dg/_-0K8.class.asasm)(line="451")
- Open RABCDAsm\4.0mod-1 folder
- Navigate to mod location, open file in Notepad++, go to mod line
- Notice the surrounding code at the mod line number (line 451)
- Copy a section of distinct code, one that does not change.
I used QName(PackageNamespace("flash.net"), "LocalConnection") (found on line 473) - Open Astrogrep
- Set the Search Path to your RABCDAsm\4.1client-1 folder
- Paste your copied code into the Search Text bar. Click Search.
Notice there are 3 choices. How do we choose?
Remember, the code we copied was on line 473.
Looking at the lines of each one, the one closest to our copied code is at 483 - Select the best choice. (location: _-0WI\_-v6.class.asasm)(line=483)
- Open your RABCDAsm\4.1client-1 folder
- Navigate to your chosen location (_-0WI\_-v6.class.asasm)
- Open the file in Notepad++, go to your chosen line (line 483)
- Compare the surrounding code with the original, is it similar? (Answer: YES!)
If you're not sure, go back to Astrogrep and see what other options are there. Open each file in Notepad++ and compare the surrounding code with the original
In this case, we are correct. Scroll up and notice the trait method, maxscopedepth, code, and pushfalse sections. - On Notepad++, look at our original mod location and line number (_-0K8.class.asasm)(line 451)
See how we insert mod code (returnvalue) after the mod line (line 451) - On Notepad++, look at our new mod location and mod line (_-v6.class.asasm)(line 483)
- Look around for code similar to the original (found on line 464, after pushfalse)
Now we have our new mod location and line! (_-v6.class.asasm)(line 464)
To add this to Nilly's Mod Selector:
- Go to your nilly's Mod Selector\mods folder
- Open the 4.0.0_production.zip file, extract the .xml
- Open the .xml in Notepad++
- Change the location to our new one (file2mod="_-0WI\_-v6.class.asasm")
- Change the line to our new one (line="464")
- Save the file, add it to your 4.0.0_production.zip and replace the old file.
Numerical HP/MP Mod (4.0 to 4.2)
- Open Nilly's Mod Selector\mods folder
- Extract files from 4.0.0_numericHpMp.zip; open both files in Notepad++
- Notice the mod location and line (com/company/assembleegameclient/ui/_-0dA.class.asasm)(line 1350)
- Open RABCDAsm\4.0mod-1 folder
- Navigate to mod location, open file in Notepad++, go to mod line (_-0dA.class.asasm)(line 1350)
- Notice the variable at the mod line number (_-Wt)(line 1350)
- Open 4.0mod.swf on Yogda
- Select WebMain, Select Classes, Select com.company.assembleegameclient.ui:_-0dA super
- Look through the functions, find one with the variable _-Wt, remember the surrounding code
I chose function private:onMouseOut(flash.events:MouseEvent):void - Choose a constant int (blue icon)
- I chose boost; a quick search shows it only appears in one com.company.assembleegameclient.ui
- Open 4.2client on Yogda
- Search boost, select the com.company...ui option
Now we know: location (_-3m.class.asasm) variable (_-JE) - Open Astrogrep, Search Path 4.2client-1, Search Text _-JE
- Select the location _-3m.class.asasm; open the file in Notepad++
- Ctrl+F, Find _-JE
- Find the one with getproperty
- Now you have your new location and line!
{_-3m.class.asasm, line 1356) For 4.2
No Ally Projectiles Mod (Line 1 of 2)
- Open Nilly's Mod Selector\mods folder
- Extract files from 4.0.0_noAlly.zip; open both files in Notepad++
- Notice the mod location and line (com/company/assembleegameclient/objects/Projectile.class.asasm)(line 3054 & line 3606)
- Open your RABCDAsm\4.0mod-1 folder
- Navigate to mod location, open file in Notepad++, go to mod line
- Notice the surrounding code at the mod line number (line 3054)
- Copy a section of distinct code, one that does not change.
I used com.company.assembleegameclient.objects:Projectile/draw (found on line 3025) - Open Astrogrep
- Set the Search Path to your RABCDAsm\4.1client-1 folder
- Paste your copied code into the Search Text bar. Click Search.
- Select the best choice. (location: Projectile.class.asasm)(line 3094)
- Open your RABCDAsm\4.1client-1 folder
- Navigate to your chosen location (Projectile.class.asasm)
- Open the file in Notepad++, go to your chosen line (line 3094)
- Compare the surrounding code with the original, look for similarities
- Similar code found on line 3121 (after pushscope)
- New line (1 of 2) found! (line 3121)
No Ally Projectiles Mod (Line 2 of 2)
- Open Astrogrep
- Set the Search Path to your RABCDAsm\4.1client-1 folder
- Paste your copied code into the Search Text bar. Click Search.
- Select the best choice. (location: Projectile.class.asasm)(line 3746)
- Open your RABCDAsm\4.1client-1 folder
- Navigate to your chosen location (Projectile.class.asasm)
- Open the file in Notepad++, go to your chosen line (line 3746)
- Compare the surrounding code with the original, look for similarities
NOTE that in the 4.0mod Projectile file, the 2nd line is 3606.
Looking at the 4.0mod Projectile.class.asasm, the mod code is inserted at line 3620 BUT the .xml says line 3606 is correct.
At line 3606 in the 4.1client Projectile.class.asasm file is the jump L10 code, so we will use the same code in our updated .xml file. - Similar code found on line 3760 (found after jump L10)
- New line (2 of 2) found! (line 3670)
- New location and new lines
(RABCDAsm\4.1client-1\com\company\assembleegameclient\objects\Projecti le.class.asasm)
(line 3121 & line 3670) - Can someone confirm my No Ally Projectile line numbers?
Add to Nilly's Mod Selector by editing the .xml in 4.0.0_noAlly.zip
No Debuff Mod
- Open Nilly's Mod Selector\mods folder
- Extract files from 4.0.0_noDebuffs.zip; open both files in Notepad++
- Notice the mod name,location, and line (com/company/assembleegameclient/objects/GameObject.class.asasm)
(line 1890, 1989, 1936, 2264, 2128, 1838) - Open Astrogrep
- Set the Search Path to your RABCDAsm\4.1client-1 folder
Refer to noDebuffs.xml - go down the list of debuff names - Type blind into Search Text
- Right click the ConditionEffect.class.asasm, select Copy Located In + Name
- Select Open... in Notepad++; paste, open
- Refer to Astrogrep, go to the line that contains blind (1024)
[I]Notice the variable name (_-0By) underneath the pushstring Blind line.
To block the Blind effect we need to find which function is using the variable _-0By. - Open Yogda, load the 4.1 Game Client
- Select WebMain, Select Classes, Select com.company.assembleegameclient.objects:GameObject super
- Find the public function _-###():Boolean section
- Look through each public function, until you find one that contains the variable name (_-0By) (_-0SX():Boolean)
- Go to RABCDAsm\4.1client-1, find and open GameObject.class.asasm in Notepad++
- Press Ctrl+F, Find _-0SX (this is the variable associated with blind)
- Underneath the code where you find _-0SX, there will be a maxscopedepth, code. (line 1840)
This is where you insert your mod code. - Repeat the process for other status effects.
Blind: func _-0SX, line 1840
Stunned: func _-0LQ, line 1795
Slowed: func _-0mb, line 1651
Confused: func _-0iD, line 1946
Paralyzed: func _-02h, line 2089
Hallucinating: func _-rt, line 2247
Drunk: func _-0Cf, line 1894
Spammable Notifications Mod (4.0 to 4.2)
- Open Nilly's Mod Selector\mods folder
- Extract files from 4.0.0_NotificationSpam.zip
- Open both files in Notepad++
- Open RABCDAsm\4.0mod-1 folder
- Navigate to mod location, open file in Notepad++, go to mod line (_-FG/_-R.class.asasm)(line 367)
- Open Yogda, load the 4.0mod.swf Game Client
- Go to the Search Box, type _-FG:_-R, start Search, double click the Classes option
- Expand _-FG:_-R super (click the + on the left)
- Look for an easy to remember public function that is similar to your .xml file at the mod line number
I chose public function _-0jv after scrolling to the bottom. Why?
Because in the _-R.class.asasm, on line 374, there is the variable _-1IL.
This _-1IL is also present in function _-0jv. - Look in _-R.class, find a unique name (I chose addSpeechBalloon)
- Open Astrogrep, Search Path 4.2client-1, Search Text addSpeechBalloon
- Comparing this to our _-R.class format, there is one best choice (_-Cl_/_-z-.class.asasm)
- Open _-z.class.asasm in Notepad++
We can check our location in Yogda. - Open Yogda, open 4.2client.swf
- Ctrl+F, Find _-Cl:_-z
[I]Line 1-4 in _-z.class.asasm help guide us to the right choice. (_-Cl:_-z, NOT Classes)
We immediately see the layout is similar, with 2 const. (red boxes on the left) - Select public function _-dW because it is similar to our earlier public function _-0jv; scroll down
- We find callproperty _-wS which matches our earlier _-1IL.
- Look at _-z-.class.asasm in Notepad++, find _-wS
- Find the correct dup iftrue lines, keeping in mind the mod is inserted after the dup code.
- We have our new location and new lines (_-Cl_/_-z-.class.asasm)(line 380)
AutoNexus Mod (4.0 to 4.2)
- Tricky because we need to update 3 variables in the Auto Nexus mod code, as well as updating location and line
- Open Nilly's Mod Selector\mods folder
- Extract files from 4.0.0_autoNexus.zip
- Open both files in Notepad++
- Go to mod location Player.class.asasm, open in Notepad++
- Go to mod line, look for distinct surrounding code
I chose lastDamage_ - Open Astrogrep, Search Path 4.0mod-1, Search Text lastDamage_ (2 results)
- In Astrogrep, change Search Path to 4.2client-1, Search Text lastDamage_ (2 results)
- Select and open Player.class.asasm in Notepad++, navigate to line 5000, compare code
- Code matches, mod line is after lastDamage_ and pushtrue, before returnvalue
- We have our new location and line! (Player.class.asasm) (line 5003)
Auto Nexus Update Variables
- Open Astrogrep, Search Path 4.0mod-1, Search Text "_-1B" (first variable in mod code)
- Notice GameObject.class.asasm, has initproperty and trait slot. Open GameObject.class.asasm in Notepad++
- Copy a section of distinct code, one that does not change.
I chose value Integer(200) end - Go to Astrogrep. Search Path 4.2client-1. Paste the code you copied into Astrogrep's Search Text bar. Click Search.
- Notice the GameObject.class.asasm, with two trait slots and two new variables.
Now we have 2 of 3 new variables!
4.0 variables: _-1B and _-01F change into:
4.2 variables: _-KQ and _-0d5 - Use Astrogrep, Search Path 4.0mod-1, Search Text _-0jI (it's the last variable we need to update)
- We want the entry with trait method and refid, Count = 2 (com.company...net/_-KA.class.asasm)
- Open Yogda, open 4.0mod.swf, navigate to our address com.company.assembleegameclient.net:_-KA super
- Expand selection (+ button on left), look through public functions, find function with our last variable _-0jI
[I]We find public function _-0jI():void. Looking at the code shows an easily memorized code format:
blue green blue green white (getlex ESCAPE) green green - In Yogda, load 4.2client-1
- Navigate to com.company...net:_-###; open each one to see which tree is similar to our previously opened one.
We can see that com.company...net:_-04h super matches well. - Look through each public function to find one that matches what we previously memorized at _-0jI
I found public function _-LI():void was the best match. (getlex ESCAPE) - Now we have our 3 of 3 variables and our new Nexus function!
4.0 Nexus function: _-0jI
4.2 Nexus function: _-Ll


