News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Tools to learn how to create my own GUI editors  (Read 3530 times)

Zanerus

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Tools to learn how to create my own GUI editors
« on: June 09, 2020, 01:40:52 am »
Hello, I am currently using Nightmare to create single file editors for different aspects of Saga frontier, but because monster data is 256 seperate files, nightmare being used has been a huge hassel.

I want to learn how to edit all these files in one program instead of making so many seperate moduels. I am willing to learn any programming languge, I'm an active learner so i learn by doing.

If a tool already exists that would be great too.

FAST6191

  • Hero Member
  • *****
  • Posts: 2958
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #1 on: June 10, 2020, 08:15:41 am »
Lost the reply I initially gave in a server hiccup so shorter version today.

Most languages will do something here, though you would probably be better served going for a higher level scripting language than messing around with C and some GUI libraries for it.

To that end
Python. Very popular, loads of tutorials on it, handles binary data just fine.
Lua. Popular among emulators for adding scripting to them and used by TAS speedrunner types as well.
Ruby. Sometimes rival to python out in the real world but I have seen hacking tools made in it.
Java. *spits*. It will do and if you fancy coding android stuff it will be good for that. I, and most others, would rather not have to install the runtime on our PCs though.

Probably want to skip the task automation programs.

Stopgap for the meantime.
If I have a ROM with a whole bunch of files then I normally either build a ROM with just those in or make an archive but don't compress it. TAR I find pretty good for it as it notes what file it belongs to at the end of the file.

Zanerus

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #2 on: June 12, 2020, 12:33:07 pm »
So i should look up a python guide to build a directory editor gui with different entry points for the files correct?

FAST6191

  • Hero Member
  • *****
  • Posts: 2958
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #3 on: June 12, 2020, 03:13:46 pm »
I would not hardcode the entry points for the files as much as find the start of the chain of pointers that leads to them and read out from there.
But yeah you could happily make a nice tool in python without having to worry about low level stuff, share it around between people of a hundred different operating systems, have those not so familiar with coding be able to make changes in fairly rapid pace and be reasonably sure you can come back to it in 15 years and still make useful headway without necessarily having to dive into crazy archive download sites or rewrite half of it. Such things are largely is what python aims to accomplish for people.

Zanerus

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #4 on: June 12, 2020, 03:50:56 pm »
Sadly for this game that would not work. Monsters stats are loaded after their graphic data and the graphic data puts the stats at the bottom of the file. So there isnt really a central pointer since from what i can understand when a fight is loaded it pulls the Battle.Arc and the MData files, loading the file in question based on the hex value of each monster's file name as the monsters are named MXXX with each X being the hex value.

Thats why i can't use a traditional table tool which kwould just point to a table. I have looked for pointers already to see if the data is loaded in a second location but i could not find it.

This is also why player monsters and enemy monsters share the same stats minus HP which is effected by an enemy exclusive BR multiplier.

pianohombre

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • My personal website of short stories and comics
Re: Tools to learn how to create my own GUI editors
« Reply #5 on: June 25, 2020, 03:38:26 am »
Microsoft Visual Basic is a great program and it's in more than one language. Plus if you're a college student, or through some work you can get the program for free.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds

FAST6191

  • Hero Member
  • *****
  • Posts: 2958
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #6 on: June 25, 2020, 11:29:23 am »
Microsoft Visual Basic is a great program and it's in more than one language. Plus if you're a college student, or through some work you can get the program for free.

Do you mean Microsoft's Visual Studio IDE program? Which is to say the program microsoft provides to write code, debug code, have it analyse code as you are writing it and compile/assemble/pack code? This will support multiple programming languages but in and of itself is not a programming language. We would also have to have the are IDEs something worth using or a crutch that makes you weak discussion? In general I go with use whatever gets the job done ( https://xkcd.com/378/ ) but at the same time I have seen the damage done by too much hand holding from an IDE.

Visual Basic is a very old language microsoft made and one of the banes of ROM hacking these days, not to mention problem for computing at large, as it tended to want fancy runtimes that are really hard to find the specific versions of, and then get working on modern Windows. It was a nice way for devs that maybe did not want to get into the harder programming languages a way to make nice graphical programs to do what are effectively minor edits to binary files, a rarity in programming languages at the time but today we have a hundred scripting type languages. As a result it then got used in any number of cheat, level editor and game specific programs over the years from people learning to code but wanting to make ROM editors, and came with costs already mentioned. Only reason for someone to use it to day is to edit one of those legacy programs, as many still represent either the best or the broadest options of the code for many games and tools made during the boom in emulation and ROMs that came around during the GBA era.

Visual basic.net/VB.net is a language and pitched as something of a successor to visual basic and ties in to Microsoft's .net runtimes/framework (and that also means tied to Windows really, though that is not the worst thing as most of ROM hacking already is). I don't know if I would recommend this over something more useful in the everyday world -- learn python, lua, ruby, c#, perl, even Java and you will have something you can reasonably interact with others, get help with and use out in the world whilst still being just as easily able to twiddle a ROM (give or take perl's quirks with editing binary data). vb.net has a few niches (MS supports it after all) but I would wager just about anybody here is only going to be help debug it by virtue of most programming languages looking pretty similar when all is said and done (or maybe a half remembered module during a programming course) and new coders tending to make the same sorts of mistakes.
Granted in the world at large most people will call it visual basic these days as Microsoft does as well, however round here we very much have to make the distinction.

Zanerus

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #7 on: June 26, 2020, 03:30:06 pm »
Thank you for your input.

June 29, 2020, 12:45:24 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Ive been researching how to do this in python and i always get stuck on the fact that the files are not the same size

Is there a python code I'm missing to load just the last 54 bytes of a file into a gui?
« Last Edit: June 29, 2020, 12:45:24 pm by Zanerus »

glennxserge

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #8 on: July 02, 2020, 11:43:53 pm »
If you are just trying to get the last 54 bytes of data from a file.  I think it's easiest to just read the file data and then use the right indexing to capture it. 

Python has a pretty elegant way of managing lists/arrays

Try this:
Quote
fh = open("somefilename", "rb")
data = fh.read()

byteLen = len(data)
chunk = data[byteLen-54:]

That will grab the last 54 bytes stored in data, that you read from your file. How you choose to display it and build your GUI, is up to you.

I'd say if you go the python route tKinter is a nice module that makes setting up an interface pretty easy.  Lots of examples too.  Good luck!
« Last Edit: July 02, 2020, 11:51:02 pm by glennxserge »

Anime_World

  • RHDN Patreon Supporter!
  • Jr. Member
  • *****
  • Posts: 32
    • View Profile
Re: Tools to learn how to create my own GUI editors
« Reply #9 on: August 31, 2020, 07:29:00 pm »
If you are just trying to get the last 54 bytes of data from a file.  I think it's easiest to just read the file data and then use the right indexing to capture it. 

Python has a pretty elegant way of managing lists/arrays

Try this:
That will grab the last 54 bytes stored in data, that you read from your file. How you choose to display it and build your GUI, is up to you.

I'd say if you go the python route tKinter is a nice module that makes setting up an interface pretty easy.  Lots of examples too.  Good luck!

You can perform many operations in python with binaries like:
Code: [Select]
# Bytes to ASCII string
value = fh.read(length).decode('ascii')

# Bytes to UTF-8 string
value = fh.read(length).decode('utf-8')

# Bytes to SJIS string
value = fh.read(length).decode('sjis')

# Bytes to Integer
value = int.from_bytes(fh.read(lenght), byteorder='big')

# Integer to Bytes
value = 0x1000
byte_value = value.to_bytes(2, byteorder='big')

can import struct to do operations with bytes too.

To make an Graphical Interface all languages have wrappers to native windows, GTK, QT, etc. Choose the one you find easier to learn.


pianohombre

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • My personal website of short stories and comics
Re: Tools to learn how to create my own GUI editors
« Reply #10 on: September 07, 2020, 07:18:19 pm »
Do you mean Microsoft's Visual Studio IDE program? Which is to say the program microsoft provides to write code, debug code, have it analyse code as you are writing it and compile/assemble/pack code? This will support multiple programming languages but in and of itself is not a programming language. We would also have to have the are IDEs something worth using or a crutch that makes you weak discussion? In general I go with use whatever gets the job done ( https://xkcd.com/378/ ) but at the same time I have seen the damage done by too much hand holding from an IDE.

Yes I meant Visual Studio where you could program in C++, Java, or Visual Basic, and more.
"Programming in itself is beauty,
whether or not the operating system actually functions." - Linus Torvalds