Ikachan Modding Guide

Sep 14, 2009 at 10:01 PM
Senior Member
"Master using it, and you can have this!"
Join Date: Aug 19, 2009
Location: UK
Posts: 85
Age: 29
I hope you like it. It took me quite a while to compile.

Editing Ikachan
by Hamish Milne

Ikachan has significally les moddability than Cave Story, but still has some interesting features.

1. Basic structure

For this guide, use the full english translation. See below (2) if this doesn't work.
The main executable is dxIka.exe or Ikachan.exe for the non-translated version.
All images (.pbm) are contained in Pbm\ and all music (.pmd) in Pmd\.
The images are all 2 - 256 color Bitmaps (using a palette) and the music can be played using PiyoPiyoPlayer.
The save file is Ika.rec .

1.5. The Level Up bug

Sometimes the full translation crashes when you level up.
I don't know what causes this, but you can try disabling some programs or reinstalling Windows. Eventually it will work.
If you don't want to do that, you can use the original japanese and follow these steps:
- Replace the following files with the ones from the full translation:
- YesNo.pbm
- Event.ptx
- Words.ptx
- Staff.ptx
- In Event.ptx, replace all Spaces with Underscores
This is pretty much guaranteed to have no bugs, but there will be no exclamation marks and all spaces are replaced with underscores.

2. Editing Music

Music can be edited in PiyoPiyo, Pixel's .pmd editor. Be warned, it is fullscreen.
I currently have v1.1, please tell me if you have any newer versions, I would be most grateful.
PP is basically the same as OrgMaker, except each track is accessed by clicking the tabs in the lower left corner.
Click on the screen to place a note at that pitch. Move the mouse to the edges of the screen to move through the file.
Right-click drag the repeat symbols (||: and :||) to move them.
Now for the buttons in the lower right corner:
Beginning, Play, Stop, Select mode, Paste mode, Clear, Edit tone, Save/exit

To copy parts of a track, go in select mode and drag-select on the red bar, just above the toolbar.
Then go to Paste mode and click on the screen where you want to put it.
You can also select, then click Clear to clear that part of the track.
Clicking the Edit Tone button puts you into the Tone Editor.
Here you can change the sound of the tone of the track you are on.
Click an icon to change the tone icon
Click-drag on the Wave or Envelope boxes to change the wave or envelope.
All the tasks listed above apply to the track you are currently on.

3. Editing Tiles

All info for the map tiles is contained in Map1.pbm.
I would recommend you edit this in CaveEditor's PBM editor to preserve the palette.
Each pixel represents a tile, each color a different type.
Palette:
1 Background Space Space Space
2
3 Non solid Horiz Vert Cross IN! sign
4
5 Food Fish Food
6
7 Direction Left Right Up Down
8
9 Solid Blue block Cracked block Small swirl Large Swirl Fish fossil Brown w/ plant Brown block Brown swirl
10
11 Spike Up ^ Down v
12
13
14
15 Break Sponge
16

See image included for a visual reference.
Also, feel free to resize the map, everything still works as normal.
Editing the bitmap directly edits the map tiles, however, previous saves won't be affected by changes.

3.5. Editing Tilesets

It is possible to create more tiles of a specified type by using the pbm editor.
First, open the tileset image you want to edit:

Row:Type:Function:File.pbm
1 Background Behind player PrtBack
3 Non solid In front of player PrtFilt
5 Food Adds 1 HP and 1 XP PrtItem
7 Direction Moves player in a direction PrtDir
9 Solid Player cannot pass through PrtBlock
11 Spike Damages player by 3 PrtDmg
15 Breakable Player can destroy PrtSnack

And go to Tools>Resize. Increase the width by 16 for every new tile, up to a maximum of 256, 16 tiles
Next open Map1.pbm. Go to Tools>Edit Palette.
Look for the row of tiles you edited. Change any new tile references to a color other than black, which is assumed to be transparent.
You can now use them in the map.

4. Editing Objects

This is by far the easiest part of the guide as Ikachan has it's own built-in editor.
The editior can only handle objects, but is simple to use.
Make sure you start in Fullscreen mode, as the cursor gets messed up otherwise.
When it asks if you want to start a new game, hold S and select Yes.
You will now be in the editor. The cursor works as an ordinary mouse. Left click adds, right click subtracts.
To change the object number, click the NO box in the top left corner.
To change the object type, click the CH box.
To change the object subtype (colour of sea creature, skeleton to sign etc.)
you need to click to place the object, then drag to the right.
To change the position (X,Y), click the tile on the screen where you want it to be.
The SW box simply shows if the object is in use. In Ikachan, 55 out of 100 objects are used.
To change the object behaviour, click the TY box:
- NULL: Runs event, but not a solid object. Used for fish remains and signposts.
- BLOCK: Not solid, doesn't run event.
- ENEMY: Normal enemy behaviour, runs event on death. Used for Crabs, Fish, Porcupinefish and Attack Stars.
- EVENT: Runs event and is solid. Used for friendly sea creatures and the Ship.
To change the event number, click the EV box. The event, just like in CaveStory, is the piece of script which defines the object's behaviour when landed on by the player.
Objects can access events 0-255.
All information on objects is saved in NPChar.dat.
As with the tiles, changes won't affect previous saves.

4.5 Ironhead

Ironhead starts at coordinates 130:90 (top corner, size is 4x2), which can't be changed.
He can go through solid tiles (as proved in the boss fight) but will stay around that general area.
You can make him dissapear, though. See the <ec command below.
Also, his sprite will be messed up until you use <fi for the first time.

5. Scripting

When you land on an object with behaviour NULL or EVENT, the game runs a set of commands known as an event.
These are located in Event.ptx.
All events have an ID, and can be linked using certain commands. The Ikachan scripting language is simple, yet flexible.
An event definition is always on it's own line. It is simply #e then the event ID. Everything after on the line is ignored.
Commands are preceded with < and may contain variables, numbers which you specify to change the command, separated by hyphens.
For example, <pc0100-0150-0129 would change tile 100:150 to a solid blue block.
You should remember that _ALL_ numbers must be typed as FOUR digit, eg. 4 would translate as 0004, X as XXXX etc.
Events can be run...
- By landing on or killing the object linked to it
- From another event (using <fj, <ij or <ej, called 'jumps')
- From a special action
These 'special action' events are those run by actions other than landing on an object, such as dying or starting a new game.
Here is the list:
- 1 Dummy event, used for no action. Shouldn't really be changed, for convenience's sake.
- 2 First event, run on game start.
- 3 Run after event 2 if no map is loaded.
- 6 Run on death of player
- 1000 Ironhead's event
- 20XX Where X is 1-11. Run when item number X is selected from inventory.
- 4000 Run after <ge
Text is displayed by typing text straight into the event. + is used for a line break, and / is to require a key press.
A message box is automatically displayed, and is only closed following <end or <ge.
The message box width is 32 characters, then + or / is needed.
All events must end with <end.
Now for the list of commands:
+ New line
/ New line, require key press
#eXXXX Define event, all else on this line is ignored, everything before the first event is ignored
<boXXXX Start boss fight X (only 0 can be used)
<ce Restore enemies
<cmXXXX-YYYY-ZZZZ Move object X to coordinates Y:Z. Use coords 0000-0000 to make said object dissapear
<dl Load Game and play sound 13
<ds Save Game and play sound 13
<ec Adds 1 to and plays sound 3. when comes to 12, Ironhead dissapears
<ejXXXX-YYYY If is equal to X, jump to event Y
<ek Earthquake (use <se0015 for sound)
<end End event
<ex Exit game
<e+ Restore energy and play sound 12
<fi Fade in (before <nm)
<fjXXXX-YYYY If flag X is set, jump to event Y
<fo Fade out (before <wa0040 and <ma)
<ftXXXX-YYYY Focus on X:
x=0 Player
x=1 Object Y=Object no.
X=2 Boss
X=3+ Some random tile
<f+XXXX Set flag X. Flag definitions (comment) generally placed before first event
<ge Blast up (play sound 11), ignoring solid tiles, then go to event 4000
<ijXXXX-YYYY If you have item X, jump to event Y
<i-XXXX Remove item X
<i+XXXX Give item X and play sound 3
All items run event 20XX on USE, see script for details
See Item.pbm for pictures.
On aquiring the item:
1 Spike hat: Changes player to MyChar.pbm and enables attacking
8 Capacitor: Enables burst of speed
11 Changes to MyChar3.pbm
Max of 10 items in inventory
<le Long earthquake
<ma Hide map (after <fo and <wa0040)
<nm Show map (after <fi)
<pcXXXX-YYYY-ZZZZ Change tile X:Y to type Z (palette index) and play sound 5
<pdXXXX Set music to X:
0 Ikachan
1 Magirete
2 Buriki
3 Mizuno
4 Quake
5+ Crashes game
<pf Fade music to silence.
<ph Fade to quiet. If already quiet, do nothing.
<pn Fade to loud. If already loud, do nothing.
<pp Start/reset music
<ps Stop music
<re Restore character (after death). If already in play, do nothing
<seXXXX Play sound X
0 No damage
1 Propel (on Z)
2 Hurt
3 Food/Item
4 Bump
5 Break block
6 Switch Yes/No / Capacitor charge
7 Capacitor blast
8 Text scroll
9 Death
10 Kill enemy
11 Blast off
12 Health restored
13 Game saved/Loaded
14 Yes/No
15 Earthquake
<waXXXX Wait X ticks
<ynXXXX Yes/No? (play sound 14) If YES go to event X
<* Roll credits

Certain commands can also be used in Words.ptx and Staff.ptx

5. Editing dxIka.exe

You can edit the main executable with a hex editor (such as XVI32)
to change, amongst others, references to files.
All these offsets are correct with a vanilla fully translated version.

If, for example, you want to change the file extensions for the images to .bmp,
first change the files, then do a find/replace with .pbm and .bmp .

All names must be multiples of four and have at least one 00 to separate them.
None are fixed except for Ika.rec and NPChar.bin.
Use 00 in any spaces left over.

From 120D4:
Option.bin

121D0 - 121DF:
NPChar.dat

12668 - 12687:
Ika.rec

From 126A0:

Staff.ptx Credits script
Pbm\End.pbm The word END (not used I think)
Pbm\Staff.pbm Credits background
Pbm\NpcType.pbm Used in the Editor
Pbm\Editor.pbm Editor GUI
Pbm\LevelUp.pbm "Level Up"
Pbm\Damage.pbm Damage/XP (1-9-?)
Pbm\Bubble.pbm Bubbles!
Pbm\Star.pbm Stars!
Pbm\MyChar3.pbm Ikachan in the Ship
Pbm\MyChar2.pbm Ikachan
Pbm\MyChar.pbm Ikachan with Spike Hat
Pbm\Ironhead.pbm Ironhead
Pbm\Ufo.pbm Ship object
Pbm\Juel.pbm Passive fish
Pbm\Carry.pbm Carry
Pbm\Dum.pbm Sign/skeleton
Pbm\Hoshi.pbm Attack star
Pbm\Chibi.pbm Ben
Pbm\Sleep.pbm Sleep clam
Pbm\Kani.pbm Crab
Pbm\Isogin.pbm Sea creature
Pbm\Hari.pbm Porcupinefish
Pbm\ItemBox.pbm Inventory box
Pbm\Item.pbm Items
Pbm\Figure.pbm Numbers
Pbm\Status.pbm Status bar
Pbm\Back.pbm Background
Pbm\PrtSnack.pbm Row 15 tiles
Pbm\PrtItem.pbm Row 5 tiles
Pbm\PrtDmg.pbm Row 11 tiles
Pbm\PrtBlock.pbm Row 9 tiles
Pbm\PrtDir.pbm Row 7 tiles
Pbm\PrtFilt.pbm Row 3 tiles
Pbm\PrtBack.pbm Row 1 tiles
Pbm\Loading.pbm First 'LOADING' (pre-title screen)
Words.ptx Intro script
Pbm\Map1.pbm Map info
Pbm\YesNo.pbm Yes/No
Pbm\Cursor.pbm Editor Cursor
Pbm\MsgBox.pbm Message box
Event.ptx Game script
Pbm\Fade.pbm Fade pattern

From 12A2C:
Must be preceded by 25 73 5C (%s\)

Sndvol32.exe Used to control volume
debug.txt Writes debug information to (in Japanese, mind)

From 12E82:

Pbm\MaruAme.pbm Intro background
Pbm\Opening.pbm Title screen sprites

From 12EB8 (includes relevant commands):

Pmd\Tidepool.pmd <*
Pmd\Quake.pmd <pd0004
Pmd\Mizuno.pmd <pd0003
Pmd\Buriki.pmd <pd0002
Pmd\Magirete.pmd <pd0001
Pmd\Ikachan.pmd <pd0000

From 132DC:
Pbm\Loading2.pbm Second 'Loading' (pre-gameplay)

6.1. Option.bin

This file is used to remember the selected screen resolution.

0F 00 12 00 XX 00 00 00

XX:
00 Fullscreen
01 320x240 Windowed
02 640x480 Windowed

6.2. Ika.rec

This is the save file.

0048 - 4B47 Map Data Map1.pbm
4B49 - 54A7 Object data NPChar.dat

I might update this section some more in the future.


PiyoPiyo: http://spgardebiter.sp.funpic.de/CaveStory/Programs/PiyoPiyo.zip

Tileset visual reference: http://miraigamer.net/cavestory/images/ikaeditor_1.gif

EDIT: Sometimes lists of random info look weird: there would normally be Tabs.
I LOVE the Tidepool song!
 
Sep 14, 2009 at 10:21 PM
essentially spirited away for an indefinite time.
"..."
Join Date: Jul 16, 2009
Location: in a castle.
Posts: 372
Then what about modding Ikachan in Cave Story?
 
Sep 15, 2009 at 7:10 AM
Senior Member
"Master using it, and you can have this!"
Join Date: Aug 19, 2009
Location: UK
Posts: 85
Age: 29
I'm not sure. I don't think you can, as it uses a completely different engine. You'd need to do some serious assembly editing, which I'm no good at.
 
Nov 17, 2009 at 9:54 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jul 29, 2009
Location: The Surface
Posts: 246
*Pound* *Pound* *Crash* Huzzah!

...Er, not sure it's a good idea to start a post in an Ikachan thread this way, much less a two-month-old bump... But no matter! I have something to contribute: a TSC list with mnemonics, an sfx - resource equivalent list, as the sfx can be changed with Resource Hacker, and two minor corrections to Hammil's guide.

Spoilered for length, and a .txt version is supplied.

I began making this guide in an effort to contribute to the small Ikachan hacking scene. I based it on the TSC lists for Cave Story. Before posting, though, I searched the MG forums as one should, to find, yes, I'd been beaten to the punch. But I went through with it for two reasons: one, because my script nmemonics may be useful, and two: because my sfx ResHack resource equivalent list, strangely nonexistent in the otherwise superior guide, will be useful. I also believe my scripting information, though less extensive, is better organized.

My efforts may also prompt an editor to do what the in-game one doesn't. I would make one myself, but I have the attention span of two fleas...

Oh. The better guide neglects to mention something very important: you have to press S to save in the in-game editor.


Commands and Flags
(Note that most events are prefixed with the name of the character the text belongs to, if any. That doesn't help if you don't know them by name, but it's something. Also, the line seems to represent the number of characters you can have on a line.)

fxx
These are flags defined at the beginning of the Event file. Note that they use xx format there, but the commands use xxxx format. Mussa be shorthand.

<*
(*) Rolls credits.

<boxxxx
(boSS) Starts fight with boss x. (...There's only one boss in the game... ha...)

<ce
([c?] eNEMIES) Restore enemies.

<cmxxxx-yyyy-zzzz
(cHANGE mAP?) Moves NPC x to coordinates y-z.

<dl
(dATA lOAD) Loads Ika.rec.

<ds
(dATA sAVE) Saves game.

<e+
(eNERGY +) Restores health to full.

<ec
(eNTITY cOUNT) Adds 1 to the current entity count.

<ejxxxx-yyyy
(eNTITY jUMP) Jumps to event y if entity count is x.

<ek
(eARTHQUAkE) Causes earthquake.

<end
(end) Ends event.

<ex
(exIT) Exits game. (To title screen, or entirely? I never answered no.)

<f+xxxx
(fLAG +) Sets flag x.

<fi
(fADE iN) Fades in.

<fjxxxx-yyyy
(fLAG jUMP) Jumps to event y if flag x is set.

<fo
(fADE oUT) Fades out.

<ftxxxx-yyyy
(fOCUS tRANSFER?) Should be like <FON in CS...

<ge
(gREAT eSCAPE?) Takes off into space after everyone has been rescued.

<i+xxxx
(iTEM +) Adds item x.

<i-xxxx
(iTEM -) Takes away item x.

<ijxxxx-yyyy
(iTEM jUMP) Jumps to event yyyy if item xxxx is in Inventory.

<le
(lAST eARTHQUAKE) Triggers final earthquake.

<ma
(mAP [a?]) Hides map.

<nm
([n?] mAP) Shows map.

<pcxxxx-yyyy-zzzz
([p?] cHANGE) Changes tile X:Y to type Z.

<pdxxxx
(pIYO dITTY?) Changes music to song x.

<pf
(pIYO fADE) Fades music out.

<ph
(pIYO hEARTBEAT?) Fades to quiet.

<pn
(pIYO nORMAL?) Fades to loud.

<pp
(pIYO pLAY) Starts/resets music.

<ps
(pIYO sTOP) Stops music.

<re
(rESTORE [e?]) Restores character (after death).

<sexxxx
(sOUND eFFECT) Plays sound effect x.

<waxxxx
(waIT) Pauses for x ticks.

<ynxxxx
(yES nO) Ask question; jumps to event x if yes


Songs
(Contrary to Hamish Milne's Hacking Ikachan guide, the value 0005 works: I tested it before I found out someone else had written a hacking guide. Because this piece of information is *extremely* important.)
0000: Overworld theme (Ikachan)
0001: Instructions (Magirete)
0002: Boss battle (Buriki)
0003: Title theme/After beating Ironhead (Mizuno)
0004: Final earthquake (Quake)
0005: Credits (Tidepool)


Sound effects
(Bleh. This is easily the most tedious part of a game to put numbers to. Note that the sfx are easily changed with Resource Hacker. I took the list of numbers from the Editing Ikachan guide [why reinvent spokes when you've found someone else also made a wheel] but found the ResHack equivalents myself.)
0000 No damage (NODMG)
0001 Propel (on Z) (DASH)
0002 Hurt (OUCH)
0003 Food/Item (ITEM)
0004 Bump (HITHEAD)
0005 Break block (CRASH)
0006 Switch Yes/No / Capacitor charge (READY)
0007 Capacitor blast (GO)
0008 Text scroll (MESSAGE)
0009 Death (DEAD)
0010 Kill enemy (WIN)
0011 Blast off (LEVELUP)
0012 Health restored (LIFEUP)
0013 Game saved/Loaded (SAVE)
0014 Yes/No (YESNO)
0015 Earthquake (QUAKE)
Sounds 0016 to 0019 are empty.
0020, however, is when you hit a boss, i.e., Ironhead (BOSSOUCH).
Sounds 0021+ should be empty.


Items
(Ehehehe... It helped that the items were listed in Event.ptx... For convenience and because the event numbers take a slightly different form that would be incorrect to use, here they are.)
0001: A spike hat
0002: Suka bread
0003: An herbal serum (WTF awful syntax... I'm tempted to go in and make fixes...)
0004: Ironhead's Code
0005: A pearl
0006: Shrimp cocktail
0007: Crab soup
0008: The capacitor
0009: Globefish platter
0010: Ben
0011: A ship.


...Ever notice that the Mother Pearl ended up being unimportant? Unless... No, I doubt there's another ending. Didn't see anything weird in the text.
 

Attachments

  • Ikachan TSC.txt
    4.7 KB · Views: 47
Top