Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-04-11 21:03:37

dooshboi
Member
From: Brooklyn, New York
Registered: 2010-11-02
Post 17/132

On the subject of scripting...

So if you guys have noticed I've posted my first hack here on the forums. It's pretty mediocre as all it is is basic hex editing (although I'm proud to say the only tools used were Windhex, a table file, and Johtomap) so I've decided to learn scripting.
I've read some threads about scripting and I've tried writing scripts for GBA (oh Lord, are they easy) and I feel like I may be somewhat proficient at writing GBC scripts. I truthfully understand nothing about pointers, inserting the script, and many other things that have to do with scripting.
I'm sure you guys get "nooby" threads like this ALL THE TIME. But I will actually work to learn how to script and I do have a basic knowledge of hex editing and SOME pointer information (how to calculate them, mostly, thanks to Miksy91). I am still unsure on how to insert them and what the purpose of pointers are. I know that you are all seasoned ROM hackers here, and I hope I am not being a bother.
Thanks in advance!


I don't calculate stat values, I don't breed my way to perfection, and I don't care about natures. I catch my Pokemon the way they are, and treat them like individuals instead of brainless drones.

Offline

#2 2011-04-11 22:31:31

Sawakita
Administrator
Registered: 2010-10-16
Post 101/364

Re: On the subject of scripting...

Don't worry asking relevant questions, as long as they show a genuine will of learning and improving. Everybody had to begin at first place, to build his knowledge.
Now, about pointers, you know how to calculate them, right? but you don't know what they actually are: think at them like addresses, but instead of "Elm Street", or "Fifth Avenue", you have a number. So for every single data in the rom you have a number that indicates it.

For example, Bulbasaur's front picture is located at address 0x34000 in a Red/Blue ROM (Pointer = 0x4000, or "0040" in little-endian format), so if you want to do something with this picture you'll have to use its pointer as a referral to the actual picture.

You also may want to give a look at the structure of the Gameboy Memory Map, to understand why pointers are calculated the way they are, and more.

Offline

#3 2011-04-11 22:48:19

dooshboi
Member
From: Brooklyn, New York
Registered: 2010-11-02
Post 20/132

Re: On the subject of scripting...

I see, so that means that the data for something (anything really) is located in a ROM, there's always a pointer that sort of "tells you" where it is? And thanks for the links, I'll check them out. I'm not very adept at calculating them (I use a calculator usually XD) but in a bind I can...sort of haha. Thanks for taking your taking time to answer my question!


I don't calculate stat values, I don't breed my way to perfection, and I don't care about natures. I catch my Pokemon the way they are, and treat them like individuals instead of brainless drones.

Offline

#4 2011-04-16 15:37:39

Miksy91
Member
Registered: 2010-10-16
Post 322/2,308

Re: On the subject of scripting...

dooshboi wrote:

I see, so that means that the data for something (anything really) is located in a ROM, there's always a pointer that sort of "tells you" where it is?

That's exactly how it works, great job :)

To learn scripting though, you've to "master" pointers first.
After you know how to calculate them properly, read about the map headers in RBY.
In G/S/C, a map header contains a 3-byte pointer to its event data and in the event data itself, you can find the data of all people in the selected map.
In data of each person, there is a 2-byte pointer to its script.

To edit scripts, you've to learn what each (or at least some) scripting command does ;)

Last edited by Miksy91 (2011-04-16 15:38:05)

Offline

Board footer

Powered by FluxBB