Few questions about programming.

Discussion in 'NDS - ROM Hacking and Translations' started by WataruKun, Dec 16, 2009.

  1. WataruKun

    WataruKun Rom translator.

    Sep 12, 2009
    United States
    Well, I've decided that I'm pretty much done relying on others for script programs and have realized the fact, that the only way I'm going to get what I want is to learn how to program them myself. I already know Japanese, but it seems I'll need to know more than that if I'm going to finish this translation alone. Also, if I learn how to make these, I wouldn't have to depend on anyone else who already knows how. So I have a few questions...

    1. Writing a script extractor.

    What would be the basic logic behind writing one of these? I'm asking because I've never written one. Could you basically tell the program the offset where the script ends and the offset where it begins? By 'it' I mean the script by the way. What would you NEED to know about the file structure to write a script extractor? Is the script extractable if the game has no pointers? I'd like to know the answer to this stuff.

    2. A script inserter.

    What's the basic logic behind a script inserter? What do you need to know about the file structure before you can make one? How should a script inserter work?

    3. A script editor.

    How would someone make a script editor, you know, a program that edits the script? How could you get the program to actually replace text? How could I figure where each text message is? I'd like to know that. And also, how do you make it so that the text editor automatically repoints a particular byte, after you've edited the text?
  2. KingVamp

    KingVamp Haaah-hahahaha!

    Sep 13, 2009
    United States
    Can not answer your questions,but i have to say, should be mad at you right now because of the trick , but I lol and is not mad at all. Weird O.o [​IMG]
  3. _Chaz_

    _Chaz_ GBAtemp's Official Mook™

    Sep 12, 2009
    United States
  4. WataruKun

    WataruKun Rom translator.

    Sep 12, 2009
    United States
    I wanted to know how to make a script inserter. Oh, and I wanted a laugh too.
  5. kevan

    kevan Imagination rules the world

    Dec 4, 2009
    Now you just deserve to be trolled

    Im trolling
    Im trolling
    Im trolling
    Im trolling
    Im trolling
    Im trolling
    Im trolling
    Im trolling
    Im trolling
    Im trolling
  6. Maz7006

    Maz7006 iSEXu

    Aug 2, 2008
    I can't believe there is still this madness about translating games.
  7. CrashmanX

    CrashmanX Current project: SD Gundam G Generation Overworld

    Aug 1, 2008
    United States
    So basically you like the attention, weather its good or bad....
  8. azerty1

    azerty1 GBAtemp Regular

    Mar 22, 2009
  9. silleeel

    silleeel Advanced Member

    Nov 14, 2009
    United States
    OP is a tool!

    plus if i get told off for trolling thats aload of crap because this whole thread is a troll!
  10. Toni Plutonij

    Toni Plutonij *has TrolleyDave & tiny p1ngy on moderating shelf!

    Former Staff
    Dec 22, 2007
    Depths of Nuclear powerplant
    Next time you do something like this, you'll get suspended from posting for few days and your thread will be closed.

    Are you really so desperate for attention or what?

    You do something like this, and wander why people post offtopic or flame..
  11. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United Kingdom
    We had a big discussion on the various programming languages available on the last few pages of the rom hacking docs:
    I am sure if you poke around romhacking.net tools you can get some source code as well which will probably be far easier than this (although the DS file changes things a bit).

    I will however say while these sorts of tools are useful if it is just you and obviously you know how to hack then you may not need these tools as for the most part they are intended for non programmers so as to not have to worry about text formatting.

    You asked about the file structure, arguably you need to know
    the text bit length (is it 8 or 16 bits per character and are there any exceptions: I have seen 8 bit formatting on 16 bit text, vice versa and other flags to increase bit length for text)
    What are the wildcards; character names are often deferred to a string or something "you have [so much] gold remaining"
    You need not know the entire text display routine but a good chunk is essential.
    If it has pointers in the file (the DS has several examples end to end, fixed length, pointers in binary, pointers in another file) then know them but they are not essential to be able to program for. If it has no pointers it will likely still be bounded by a 00 (in fact I normally search for such things when trying to figure out pointers)

    I am guessing you already understand tables; tables are a crude matrix (something every modern programming language adores whether it tells you about them or not)

    Script extraction is easy enough, you have two main types:
    Internal formats display: while you can do as below internally these take the binary files and have an inbuilt converter for display but edit using the internal formats. There are

    Conversion extractor: this will convert to a text document (maybe with xml stylings rather than hex formatting; say bounding some text with 24 makes it bold, your app can then make it {b} {/b} or something) for editing with whatever editor you like.

    Script insertion is the reverse of the extraction although while you can do things all at once most inserters are little more than a conversion from text mounted on top of a "copy /b" type command. Recalculation of the pointers is then kicked to another app or another side of the app.

    "A script editor."
    Binary to ascii is no harder than ascii to binary.

    My suggestion, in addition to the source code from romhacking.net also try something truly trivial like making an app for NSMB (the text is unicode, simple pointers, (actually NSMB format text is used in several games but nowhere near as common as SDAT for sound or even the graphics formats).

    Have fun.
  12. WataruKun

    WataruKun Rom translator.

    Sep 12, 2009
    United States
    Pretty much a beginner in C#. Thanks for the example, that should help me.

    Thanks for that information man. You've told me everything I needed to know. Now I should have no trouble writing one of these once I learn coding. Thanks!
  13. rastsan

    rastsan 8 baller, Death Wizard,

    May 28, 2008
    go to microsoft download there software for beginner programmers visual basic visual c c++ whatever and practice with there begginer stuff (2 years later and it still makes no sense to me oh well)
    you will need that stuff to compile the source code to something useful. you can get by with other stuff but at least microsofts free stuff comes with reasonable how to and help forums. ahem

    at least someone answered, i'm kinda scared to post now if this is the response I'll get... geez thank you WataruKun for at least trying to ask. You didn't get the typical 'use the search function maybe you will find something that way' response

    maybe like myself he literally has no programming experience and getting source code means nothing to him (like me) as I would heave no idea what to do with it.
    Just being a little impatient, isn't a big thing.

    Watarukun My 7thdragon translation is going real slow as I have to short form my insertions and my table files (yes there are two so far) are incomplete.
    If the text doesn't fit big deal if it makes minimum sense then that is fine especially if this is your first translation anyone who wants to play it will have to deal with the shrtfrmtxt (short form text) if they don't like it ask a mod to close your forum after posting your patch and let the complainers be.... that is what I am going to do.
    once i give up trying to dissassemble and reassemble an object or elf file for a game translation that I only took cause it looked easy (for a first project)

    (p.s. take a look at the other patches okay you will see what I mean) shiren 2 being a prime example not that isn't a great translation
    And yes doing it yourself means taking whatever time you need to do it yourself
    flaming him for a serious question geez....
  14. HernanZh

    HernanZh GBAtemp Regular

    Apr 6, 2008
    The Netherlands
    Hi. Go to romhacking.net. There are already general tools for script dumping and inserting.
    Romjuice: Good tool for dumping scripts. Not many options, but gets the job done.
    Atlas: Great tool for inserting scripts. Very flexible. Bad readme file, if you have questions about this one, I can probably answer them.