-
Notifications
You must be signed in to change notification settings - Fork 37
Tutorial: Your First Hack
In programming, the classic “Hello World” exercise is often the starting point for learning a new language, as it simply displays the message “Hello World!” on screen. While it’s functional, it’s also rather dull.
Let’s add a creative twist to this tradition by creating something more engaging and rewarding within EarthBound.
A successful project starts with a plan. While improvisation can work, a well-thought-out approach ensures smoother progress and better results. For this hack, we’ll create an NPC (using the Robot Ness sprite) that delivers a “Hello World” message within Ness’s house at the beginning of the game. This involves:
- Decompiling the ROM.
- Adding an NPC with the Robot Ness sprite.
- Writing dialogue for the NPC using a CCScript file.
- Placing the sprite in Ness’s bedroom with the map editor (EbProjEdit).
- Recompiling the ROM to incorporate the changes.
Let’s get started!
To begin, you’ll need an EarthBound ROM (available online) and CoilSnake installed. Follow these steps:
- Open CoilSnake and select the Decompile tab.
- Click Browse… next to the ROM field and select your EarthBound ROM.
- Click Browse… next to the Output Directory field and choose where to save your project.
- Press the Decompile button to extract the ROM’s resources into a CoilSnake project.
This creates a project folder containing all the editable files needed for hacking.
A CoilSnake project is a collection of files stored on your computer that represent the ROM’s contents in a structured format. The files include:
-
Project.snake
: Metadata and resource locations used by CoilSnake. - YML files: Text files for game data, editable with a text editor.
-
CCScript files: Used for dialogue and scripts, stored in the
ccscript
directory. - PNG files: Graphics files, often in indexed format, which can be edited with suitable image editors.
By separating the ROM into these files, CoilSnake allows easy editing and reduces the risk of corruption during modification.
To modify an NPC:
- Open
npc_config_table.yml
in your text editor. - Locate the entry for NPC #744. It should appear as follows:
744:
Direction: down
Event Flag: 0x274
Movement: 708
Show Sprite: when event flag set
Sprite: 195
Text Pointer 1: $c7db3f
Text Pointer 2: $0
Type: object
- Update it as shown below:
744:
Direction: down
Event Flag: 0x0
Movement: 605
Show Sprite: always
Sprite: 5
Text Pointer 1: robot.hello_world
Text Pointer 2: $0
Type: person
-
Event Flag: Set to
0x0
, so visibility is not tied to an event. - Show Sprite: Always visible.
- Movement: Set to 605 for a stationary NPC.
-
Sprite: Set to
5
, corresponding to the Robot Ness sprite. - Type: Changed to “person” to enable interaction.
-
Text Pointer 1: Points to the
hello_world
block in the newrobot.ccs
file.
Save the file after making edits.
To place the NPC on the map:
- Open the EB Project Editor from CoilSnake’s Tools menu.
- Load your project’s
Project.snake
file. - Open the Map Editor.
- Navigate to Ness’s bedroom.
- Switch to Sprite Edit Mode (via the Mode menu or F2).
- Right-click in the bedroom and select New NPC.
- Assign the NPC ID
744
.
Create a robot.ccs
file in the ccscript
directory with the following content:
hello_world:
"@Hello World!" end
Save the file, ensuring it has the correct .ccs
extension.
To compile the ROM:
- Open CoilSnake and go to the Compile tab.
- Select your base ROM and project directory.
- Specify a name for the output ROM.
- Click Compile and confirm the ROM expansion when prompted.
Once compiled, run the ROM in an emulator to test your work.
Common issues and solutions:
-
Error:
Unknown pointer label [robot.hello_world]
- Check for typos in
robot.ccs
. - Ensure the file is named
robot.ccs
and notrobot.ccs.txt
. - Verify file extensions are visible and correctly set on your system.
- Check for typos in
For more help, consult online resources or video walkthroughs.
Congratulations! You’ve completed your first EarthBound hack and explored key tools and techniques. With this foundation, you can dive deeper into customizing the game and creating unique projects. Ready to start your next adventure?
- Overworld Sprites
- Battle Backgrounds
- Battle Sprites
- Title Screen
- Window Graphics
- Logos
- Fonts
- Animations
- Swirls
- Introduction
- Translating The Main Text
- Trying Out Your Translation
- Translating Enemies and Items
- Modifying Game Fonts
- Translating Misc Text
- Translating and Adjusting Menus
- Export and Modify Compressed Graphics
- HP/PP text box graphics
- Cast Credits
- Staff Credits
- Translating "THE END... ?" Animation