+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Variable line length script extraction?
Pages: [1]
Author Topic: Variable line length script extraction?  (Read 1 times)
Kylara
Guest
« on: November 11, 2011, 06:42:15 pm »

So, there being no pointers (YAY!) in my little project, I'm left with the determination that every line ends when there is FFFF present. Simple in concept, but how do I go about extracting my script? Script-e looked potentially useful, but my computer won't run it.
Ryusui
Guest
« Reply #1 on: November 11, 2011, 06:53:45 pm »

Write a script extractor. It's actually pretty easy.

There are plenty of free programming tools to start with. Pick a language you like and get to work.
DarknessSavior
Guest
« Reply #2 on: November 11, 2011, 09:33:41 pm »

Quote from: Ryusui on November 11, 2011, 06:53:45 pm
Write a script extractor. It's actually pretty easy.

There are plenty of free programming tools to start with. Pick a language you like and get to work.
You're jumping the gun a bit, eh, Ryusui?

If FFFF is your linebreak code, then simply put it into your table, and dump the script with either romjuice or cartographer. There's detailed instructions in the readmes of those on how to set up your table for dumping with it.

Since there's no pointers, I'd recommend using romjuice just for simplicity's sake.

~DS
Kylara
Guest
« Reply #3 on: November 11, 2011, 09:36:21 pm »

You have SEEN the script I got from Cartographer. It's not pretty. At all. I'll give both programs another look, though. Now, why aren't you online to make this figuring out process easier? Wink
Auryn
Guest
« Reply #4 on: November 12, 2011, 12:28:38 am »

Well, what you want more simple??

Here an extract from Cartographer:

#TYPE:\tNORMAL:
\t\t\tThe table entries control the output of text, i.e. line
\t\t\tbreaks are only output where the table entries specify.

Ability to add newline characters for dumping.  They will be ignored during insertion.
        /FF=<END>\\n\\n <-- This is how you should define your endtokens so the library functions properly

Control codes that can be added to table entries:

\\r\t\tLine break with commenting (//) on the next line.
\\n\t\tLine break with no commenting on the next line.

These can be used as many times as you want per entry to format your text.
Kylara
Guest
« Reply #5 on: November 12, 2011, 01:07:52 am »

Wow, sorry people. If I had expected such hostility, I wouldn't have asked. Sorry for being such a frickin noob.
Auryn
Guest
« Reply #6 on: November 12, 2011, 05:06:19 am »

 Undecided\it wasn't hostile...just a push in the right direction and it's really as easy as that...just add that line to your table.
Kylara
Guest
« Reply #7 on: November 12, 2011, 08:05:21 am »

I did. I actually found that before you posted. So, now my script is a bloody mess, with more line breaks. Okay, it's an improvement. What concerns me more is the game has a lot of codes dispersed into the text. Several before (with what looks like 1 of 3 RIGHT at the beginning of a text block), some in the middle of a text block, and always the same one at the end of a text block. My main issue is the ones IN the block of text, because what I get happening is like this:

  • All of my characters are 2-byte. Not a problem by itself.
  • All characters begin with 00, 40, 80 or C0. Also not a problem by itself.
  • Then I get this: <ignore beginning of game code><second part of game code looks like beginning of character; use it and then eat the first part of a real character>
  • Oops, now the first letter in the line of text, or the first letter after a game code is gone

This is actually a fairly major problem for working with the text, and I'm not at all sure what to do about it. I'm not looking for an easy way out, or someone to do my work for me. Would I be at this point if I was? I'm just seeing help because this is completely new ground for me, and I'm not sure what to do next.

Frankly, I love this place because it helps get us new people pointed in the right direction, but I was disappointed when it was assumed that I was a programmer, or that I was wanting something overly simple. I'm not sure what would cause someone to assume that any romhacker is also a computer programmer, but at least I can understand Auryn's frustration with people looking for an easy way out after dealing with someone that needs an AR forum, not somewhere for romhacking, as it was starting to show that talking to him was like talking to a wall.

Now that I've had my rant; is there something stupid-simple that I'm just plain missing? Or some other suggestion on how I can approach this problem?
Klarth
Guest
« Reply #8 on: November 12, 2011, 12:00:19 pm »

Ok, so the problem with the end tokens was solved with "/FFFF=<END\\n\\n" in your table, right?  And now you have a problem with game control codes overlapping with text codes.  So this is what you need to do for each control code.

Say you have a game control code that starts with $20 and has one byte afterwards, you need to put "$20=<$20>,1" in your table for Cartographer.  When it comes across $2010 in the game, it'll dump it as <$20><$10> and Atlas (or other programs) will be able to reinsert it properly.  You'll need to do this for every control code to prevent overlapping.

PS: You'll have to create another table for insertion if you use Atlas since it doesn't support "$20=<$20>,1" entries.  But that's ok because you can just remove those entries from the insertion table and they're all inserted as hex.
Kylara
Guest
« Reply #9 on: November 12, 2011, 12:24:43 pm »

Thanks Klarth, I'll give that a go and see what I can do toward cleaning up my script!
Auryn
Guest
« Reply #10 on: November 12, 2011, 03:55:57 pm »

Believe me, my frustrated posts don't start with a smilie :p

I know that the instructions for Cartographer are not really so clear but actually there is everything you need to know written in those files...even what Klarth said  :angel:

By the way, did you read about the problem of the end token and Raw extraction in those Cartographer files??
Kylara
Guest
« Reply #11 on: November 12, 2011, 05:42:11 pm »

Mmmh, I see I see. That could be an issue. I really should be less "average guy"-ish with instructions and actually read them thoroughly. =S End tokens aren't a HUGE deal, really, I figure I can use my line end tag to put in two things, one to mark the end of the line, and one for find-and-replace purposes, replacing it with a carriage return. Or something. Trial and error and broken stuff is in my future. >.>

Edit - Well, that was fun. I THOUGHT I had isolated a "display this portrait" code, and altered it to be one I thought was another character's... at that point in the text, the game switched over to a scene, sort of, from the little battle card game, and restarted. Neat. Unhelpful, but neat. -Never mind. Editing 1 byte off = interesting, but bad.
« Last Edit: November 12, 2011, 07:49:45 pm by Kylara »
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC