View previous topic :: View next topic |
anclunn
Level 3: Cadet
Joined: 16 Jun 2005
Posts: 24
2,051
|
anclunn Posted: Thu Jun 16, 2005 6:02 pm Post subject: Text translation for Illusion of Gaia |
|
|
Here's the main file for a simple c++ program to translate text into the hex data for Illusion of Gaia. This is usefull for text editting the Illusion of Gaia ROM. It's still somewhat incomplete, but anyone who has acess to the apstring class (Free from AP site) and can compile c++ should be able to use this. This will allow you to find scripted text within IOG with a HEX editor and then change it.
#include <iostream.h>
#include "apstring.h"
apstring toHex (apstring);
int main( void )
{
apstring text = "";
apstring hex = "Enter q to exit";
char charArray[256];
while (true)
{
cout<<hex<<"\n\n ";
cin.getline (charArray,256);
text = "";
text += charArray;
if (text == "q")
{
break;
}
hex = toHex(text);
}
return 0;
}
apstring toHex(apstring text)
{
apstring temp = "";
for (int i = 0; i < text.length(); i++)
{
// Words
if ( // Attack
(i+5)<text.length() &&
text[i] == 'A' && text[i+1] == 't' && text[i+2] == 't' &&
text[i+3] == 'a' && text[i+4] == 'c' && text[i+5] == 'k')
{
temp += " D6 00 ";
i+=6;
if (i >= text.length()) break;
}
if ( // Angel
(i+4)<text.length() &&
text[i] == 'A' && text[i+1] == 'n' && text[i+2] == 'g' &&
text[i+3] == 'e' && text[i+4] == 'l')
{
temp += " D6 01 ";
i+=5;
if (i >= text.length()) break;
}
if ( // After
(i+4)<text.length() &&
text[i] == 'A' && text[i+1] == 'f' && text[i+2] == 't' &&
text[i+3] == 'e' && text[i+4] == 'r')
{
temp += " D6 02 ";
i+=5;
if (i >= text.length()) break;
}
if ( // Aura
(i+3)<text.length() &&
text[i] == 'A' && text[i+1] == 'u' && text[i+2] == 'r' &&
text[i+3] == 'a')
{
temp += " D6 03 ";
i+=4;
if (i >= text.length()) break;
}
if ( // Ankor
(i+4)<text.length() &&
text[i] == 'A' && text[i+1] == 'n' && text[i+2] == 'k' &&
text[i+3] == 'o' && text[i+4] == 'r')
{
temp += " D6 04 ";
i+=5;
if (i >= text.length()) break;
}
if ( // Black
(i+4)<text.length() &&
text[i] == 'B' && text[i+1] == 'l' && text[i+2] == 'a' &&
text[i+3] == 'c' && text[i+4] == 'k')
{
temp += " D6 05 ";
i+=5;
if (i >= text.length()) break;
}
if ( // Bill:
(i+4)<text.length() &&
text[i] == 'B' && text[i+1] == 'i' && text[i+2] == 'l' &&
text[i+3] == 'l' && text[i+4] == ':')
{
temp += " D6 06 ";
i+=5;
if (i >= text.length()) break;
}
if ( // Crystal
(i+6)<text.length() &&
text[i] == 'C' && text[i+1] == 'r' && text[i+2] == 'y' &&
text[i+3] == 's' && text[i+4] == 't' && text[i+5] == 'a' &&
text[i+6] == 'l')
{
temp += " D6 07 ";
i+=7;
if (i >= text.length()) break;
}
if ( // City
(i+3)<text.length() &&
text[i] == 'C' && text[i+1] == 'i' && text[i+2] == 't' &&
text[i+3] == 'y')
{
temp += " D6 08 ";
i+=4;
if (i >= text.length()) break;
}
if ( // Come
(i+3)<text.length() &&
text[i] == 'C' && text[i+1] == 'o' && text[i+2] == 'm' &&
text[i+3] == 'e')
{
temp += " D6 09 ";
i+=4;
if (i >= text.length()) break;
}
// Symbols
if (text[i] == '?') temp += " 0D ";
if (text[i] == '.') temp += " 2A ";
if (text[i] == ',') temp += " 2B ";
if (text[i] == '"') temp += " 2D ";
if (text[i] == ':') temp += " 2F ";
if (text[i] == '!') temp += " 4F ";
if (text[i] == '/') temp += " 6B ";
if (text[i] == '*') temp += " 6C ";
if (text[i] == '-') temp += " 6D ";
if (text[i] == '(') temp += " 6E ";
if (text[i] == ')') temp += " 6F ";
if (text[i] == ' ') temp += " AC ";
if (text[i] == '$') temp += " CB ";
// Numbers
if (text[i] == '0') temp += " 20 ";
if (text[i] == '1') temp += " 21 ";
if (text[i] == '2') temp += " 22 ";
if (text[i] == '3') temp += " 23 ";
if (text[i] == '4') temp += " 24 ";
if (text[i] == '5') temp += " 25 ";
if (text[i] == '6') temp += " 26 ";
if (text[i] == '7') temp += " 27 ";
if (text[i] == '8') temp += " 28 ";
if (text[i] == '9') temp += " 29 ";
// Uppercase Letters
if (text[i] == 'A') temp += " 40 ";
if (text[i] == 'B') temp += " 41 ";
if (text[i] == 'C') temp += " 42 ";
if (text[i] == 'D') temp += " 43 ";
if (text[i] == 'E') temp += " 44 ";
if (text[i] == 'F') temp += " 45 ";
if (text[i] == 'G') temp += " 46 ";
if (text[i] == 'H') temp += " 47 ";
if (text[i] == 'I') temp += " 48 ";
if (text[i] == 'J') temp += " 49 ";
if (text[i] == 'K') temp += " 4A ";
if (text[i] == 'L') temp += " 4B ";
if (text[i] == 'M') temp += " 4C ";
if (text[i] == 'N') temp += " 4D ";
if (text[i] == 'O') temp += " 4E ";
if (text[i] == 'P') temp += " 60 ";
if (text[i] == 'Q') temp += " 61 ";
if (text[i] == 'R') temp += " 62 ";
if (text[i] == 'S') temp += " 63 ";
if (text[i] == 'T') temp += " 64 ";
if (text[i] == 'U') temp += " 65 ";
if (text[i] == 'V') temp += " 66 ";
if (text[i] == 'W') temp += " 67 ";
if (text[i] == 'X') temp += " 68 ";
if (text[i] == 'Y') temp += " 69 ";
if (text[i] == 'Z') temp += " 6A ";
// LOWERCASE LETTERS
if (text[i] == 'a') temp += " 80 ";
if (text[i] == 'b') temp += " 81 ";
if (text[i] == 'c') temp += " 82 ";
if (text[i] == 'd') temp += " 83 ";
if (text[i] == 'e') temp += " 84 ";
if (text[i] == 'f') temp += " 85 ";
if (text[i] == 'g') temp += " 86 ";
if (text[i] == 'h') temp += " 87 ";
if (text[i] == 'i') temp += " 88 ";
if (text[i] == 'j') temp += " 89 ";
if (text[i] == 'k') temp += " 8A ";
if (text[i] == 'l') temp += " 8B ";
if (text[i] == 'm') temp += " 8C ";
if (text[i] == 'n') temp += " 8D ";
if (text[i] == 'o') temp += " 8E ";
if (text[i] == 'p') temp += " A0 ";
if (text[i] == 'q') temp += " A1 ";
if (text[i] == 'r') temp += " A2 ";
if (text[i] == 's') temp += " A3 ";
if (text[i] == 't') temp += " A4 ";
if (text[i] == 'u') temp += " A5 ";
if (text[i] == 'v') temp += " A6";
if (text[i] == 'w') temp += " A7 ";
if (text[i] == 'x') temp += " A8 ";
if (text[i] == 'y') temp += " A9 ";
if (text[i] == 'z') temp += " AA ";
}
return temp;
} _________________ http://whatlittlewisdomihave.wordpress.com/ |
|
Back to top |
|
|
Freedan
Level 19: Soul Blazer Rank: Resident
Joined: 15 Feb 2005
Posts: 3856
10,167
Location: Ontario, Canada
|
Freedan Posted: Thu Jun 16, 2005 9:34 pm Post subject: |
|
|
So I could make Will say "I'm a big poopie"?
HAHAH!! I'm so clever. _________________
|
|
Back to top |
|
|
Muerte
Level 15: Bloody Chariot Rank: Resident
Joined: 29 Dec 2004
Posts: 1134
1,872
|
Muerte Posted: Thu Jun 16, 2005 9:54 pm Post subject: |
|
|
Brilliant Freedan. _________________ It's high time I revised this signature. |
|
Back to top |
|
|
Coz
Level 12: Soul Knight Rank: Resident
Joined: 04 Dec 2004
Posts: 479
6,017
|
Coz Posted: Fri Jun 17, 2005 2:19 am Post subject: |
|
|
Thanks for sharing your hard work with us anclunn. Is there any language that you want IoG to be translated into? |
|
Back to top |
|
|
anclunn
Level 3: Cadet
Joined: 16 Jun 2005
Posts: 24
2,051
|
anclunn Posted: Fri Jun 17, 2005 7:00 am Post subject: |
|
|
Oh I wasn't giving this to people with any sort of expectation. I'm going to be working to finish this so that all the key words (The game uses two hex numbers to represent the string Will for example because of how often it is used, instead of spelling it out each time). I know that there was actually a Karen typo if I remember correctly. I plan on fixing that for one
The other thing that interests me is if a simmilar text storage method exists in Soul Blazer or Terranigma. I am certain that the key words would be different, so i released this prior to being fully fleshed out, so that it could be easilly built on in a different route for use with either of those two games.
I'm just working to bring people tools, you need to supply the imagination to use them. _________________ http://whatlittlewisdomihave.wordpress.com/ |
|
Back to top |
|
|
Coz
Level 12: Soul Knight Rank: Resident
Joined: 04 Dec 2004
Posts: 479
6,017
|
Coz Posted: Wed Jun 22, 2005 2:25 pm Post subject: |
|
|
XD
Anyways, what you are saying is that you want us to tell you what we would like to see Will & co. say? |
|
Back to top |
|
|
Guest
|
Guest Posted: Sun Jun 26, 2005 3:03 am Post subject: |
|
|
Hmm.. actually I could do that. Any requests? |
|
Back to top |
|
|
Freedan
Level 19: Soul Blazer Rank: Resident
Joined: 15 Feb 2005
Posts: 3856
10,167
Location: Ontario, Canada
|
Freedan Posted: Sun Jun 26, 2005 3:31 am Post subject: |
|
|
I refer you to my earlier post. _________________
|
|
Back to top |
|
|
|