Rubikon tutorial

## A Simple Rubikon Tutorial

This tutorial assumes you're using an American Ruby ROM.

First, use your favorite hex editor to find some free space in your ROM. For this example, we'll assume the offset 0x800000.

Enter the following code in NotePad and save it as HelloWorld.RBC.

#org 0x800000
message 0x800100
boxset 0x02
end
#org 0x800100
= Hello World!

Start Diamond Cutter, select your ROM from the dropdown list and doubleclick HelloWorld.RBC in the script list. Now we'll cover how to assign this code to a object in the game.

You'll need EliteMap now. Start EliteMap and load your ROM. Now, load the default map. In this example, it should be Littleroot. Find the person between the town sign and Birch's lab. If you ctrl-click this object, the script viewer will show you the following data:

'-----------------------
#org 0x14D6CD
msgbox 0x0 0x816AC00 '"If you use a PC, you can..."
boxset 0x2
end
'---------
' Strings
'---------
#org 0x816AC00
= If you use a PC, you can store items\nand
POKéMON.\pThe power of science is staggering!

We'll use this person (who, by the way, is the fat guy) as our main victim. Close the script viewer and, in EliteMap, click the Objects tab. Here, click the People tab.

As you might have noticed in the map editor, Fat Guy's script is at 0x14D6CD and his index is 2. Therefore, set the scroll bar to 2 to see Fat Guy's settings. In the Script field, enter "&H800000" and press Tab.

Now, save this map and load your ROM in your favorite emulator. When you finally get the chance, talk to the fat guy and note how he no longer praises the power of science! Instead, he says "Hello World!"

If you ctrl-click the fat guy in EliteMap, the script viewer now shows a totally different script:

ScriptEd
#org 0x800000
msgbox 0x0 0x8800100 '"Hello World!"
boxset 0x2
end
#org 0x8800100
= Hello World!

RubiKode
#org 0x800000
message 0x800100
boxset 0x02
end
#org 0x800100
= Hello World!

As you can see, RubiKode and Bouché's disassemblies are very similar. It's so bad, if you know the commands, you can port disassemblies to RubiKode in mere minutes, like I did with the rich boy in front of the forest (richboy.rbc). That's why this release's command reference includes the command's bytecodes.

See, Rubikon's not that scary at all. Its creator is ;)

A quick reminder - To do an if then else, use compare and if:

BASIC
x = CheckGender()
if x = 0 then
goto Boy
else
goto Girl
end if
Boy:
...

RubiKode
checkgender
compare LASTRESULT B_BOY
if B_TRUE C_BOY
compare LASTRESULT B_GIRL
if B_TRUE C_GIRL
break
#org C_BOY
...

Last updated: 16-11-04