PDA

View Full Version : [Tutorial] Gold scripting - Tutorials/Commands


cooley
December 22nd, 2007, 09:21 PM
Here is a tutorial on how to script, Skeetendo showed me how to do it, so now I'm sharing with everyone. If I missed anything, please Tell me.

******************
What You Will Need
******************

1. Hex Editor(Preferably Translhextion)
2. Gold Map 1.6
3. Tauwasser's Scripting Compendium (http://skeetendo.110mb.com/scriptingcodes_eng.htm)
4. Pokémon Gold or Silver Rom
5. Pointer Calculator (http://crystalfallows.110mb.com/AutoIndex/index.php?dir=tools/RSE/&file=APoint_1116.zip)
6. Windows Calculator(Start>All Programs>Accesories>Calculator)

***************

First you Pick which person to edit. We will edit the fat guy in New bark town, so go in Goldmap and double-click New bark town, and the "Map Properties" Will come up. Go to the events data offset and it should be: $120366. Now we open our Hex Editor and we go to this address. This takes us to the start of the actual event data for the map. Now we scroll down until we find a blank space after the data that is already in this bank. The blank space starts at 0x1225A0.

Now that we have found our blank space, we have some room to insert our script. For our script I will make the Fat guy display Simple Text. Our SCript should look like:

6A 47 4C xx xx 53 49 90

You can Type "00" for the x's for now. Now, after you have typed the script, you can go to the byte after 90 Which should be 0x1225A8, and Write Text, BUT! before you go crazy writing text, make sure you start it with 00.
Example:

00 87 A4 AB AB AE E7 - This text will say "Hello!" But it is wrong.

00 87 A4 AB AB AE E7 57 00 - This is correct, always end the text with 57 00, so the game knows the text has been ended, if you don't you will Get a message that says "1df-" or "2df-".

Ok, so far we have our script and text, now what? Now you fill in those 00's for the text pointer. To get the pointer use Scizz's A-point (http://crystalfallows.110mb.com/AutoIndex/index.php?dir=tools/RSE/&file=APoint_1116.zip) to calculate it. All you do is type the offset (0x1225A8) and hit Calculate pointer. (make sure the "Offset in Pointer" is checked). You should get 48A865 as the pointer. take the last four digits (A865) and put it in the script. It should now look like this:
6A 47 4C A8 65 53 49 90 00 87 A4 AB AB AE E7 57 00 (Underline is the text)

Before you save it, Calculate the pointer of where the script starts (0x1225A0) and write it down.

Click save. All right, the script is in the game. Now we need to assign it to someone.

The pointer you wrote down, You will now need it. Open up Calculator in accessories, and click on the "Hex" bullet. Type in the first byte of the 4 digit pointer( 1 byte = 2 digits) type in A0 , then click on the "Dec" Bullet and you get "160". Do the same for the second byte, type in 65 and get 101.

Now Reload your Rom in A-map....Just kidding. Reload it in Goldmap, goto Events Tab, then click on the fat guy. His info should pop up. Where it says Text Block Type in "160" And where it says Text bank, type in "101".

Hit Save and test it. If you did it wrong, then you either don't get any text at all, or get a "1Df-" message.

You have learned how to script in hex, For GOLD version! Spread the news, and get more people into hacking gold.

******************
Examples:
******************

Note: ALL numbers are in Hexadecimal!!!! 10 = 0A
Note2: For Giveitem, and givepokemon, the numbers are in hexadecimal also! Pikachu = 19 not 25
Note3: I am trying to make a tool for these commands, the tool will be able to compile scripts to the ROM too!
Note4: For giveitem and givepokemon refer to the Item and Pokemon list
---------------------------------------------------------
Tutorial:

REGULAR TALK

6A 47 4C xx xx 53 49 90

Faceplayer, then open text box and writes the text from the pointer. Then close text box.

EMOTICON

6A 73 zz 74 00 zz xx 90

00 = Emoticon no. zz = Person no(add 1 to it. person is 2 add 1 and is 3) xx = Time in hex, 10 is 0A.

YES/NO

6A 47 4C xx xx 54 4E 09 xx xx 4C xx xx 53 49 90

Ok, the 54 means to keep a text box open, so that a Yes/no box(4E) comes up. 09 xx xx means that if it is yes, then go to the pointer xx xx, If no then the script continues, in this case, Text comes up and says "Fine Then" You don't need to put another 47 4C because the text box was already open so you just need to load new text from a new pointer. Btw, 08 xx xx = If no then goto (pointer), and 09 xx xx = If yes then goto (pointer). You Do NOT NEED BOTH!

MOVEMENTS

6A 47 4C xx xx 53 49 69 xx xx 90

Ok, New codes here. 69 is the movement of the talked-to person, and 68 is movement for any person but you have to put people no.
the command 69 requires a 2 byte pointer to the movement data and the movements are below. After you've pointed to the movements, end the movements with a 47 command. Ok, so you talk to someone, then they tell you something, and then the move around, yay! You made a movement script!

DEALING WITH FLAGS

31 10 00 09 yy yy 47 4C xx xx 53 49 33 10 00 90

All this is is another way to make things NEVER repeat twice, and it has some advantages too. After a flag is set, you can activate other events by checking if an Event has been activated before. (ie. You can't leave if you don't have a pokemon, you can when you do. This is by Flags. Not really, but it is an example) Flags can also make people disappear and stay like that (ie. Found an Item) The way I'm using it is if the flag hasn't been used then display some text. If it has then goto different text (ie. yy yy)

Explanation:

31 = Check for flag
'requires 2 bytes which are the flag numbers

09 = Ram Check [2]
' 09 means "if yes" and 08 means "If no"

33 = Set a flag
'requires 2 bytes which are the flag numbers

90 = End script
'No parameters required

xx xx = Pointer to another script

10 00 = Flag ID you can use an flag you wish, but the numbers are reverse hex. 0010 = 1000 in-game. 1000 = 0010 in-game, etc.


GIVEPOKEMON

[2D][PKMN][PKMNlvl][PKMNitem][TRAINER]

Gives a Bulbasaur with no item on level 5.
[TRAINER] = 00 or 01
00 = HIRO, don't worry too much about 01 now.

GIVEITEM

1F [Item no] [amount] 45

Gives you 99 rare candies
45 Just adds the "HIRO Put the Item in the Pocket" dialog after the item is given.

WARPING

[3C][Map bank][Map no][X][Y]

Pretty Self Explanitory...

POKEPICS

55 [xx]

Displays a pokepic at predifined coordinates.
You can use 56 for "display pokepic with a Yes/no box"

xx = Pokemon no.

POKEMART

6A 47 93 [Dialog no] [Mart no 2byte] 53 49 90


Dialogues:

00 = "Welcome! How can I help you?“ dialogue
01 = bitter herb medicine dialogue
02 = rare items dialogue (exchanges mart inventory and every item can only be bought once)
03 = sell medicine dialogue
Marts:


00 = Cherrygrove City without PokéBalls
01 = Cherrygrove City with PokéBalls
02 = Violet City
03 = Azalea Town
04 =
05 = 2nd floor Goldenrod City Mart/ Counter1
06 = 2nd floor Goldenrod City Mart/ Counter2
07 = 3rd floor Goldenrod City Mart
08 = 4th floor Goldenrod City Mart
09 = 5th floor Goldenrod City Mart/ Counter1, if all ??? aren’t enabled
0A = 5th floor Goldenrod City Mart/ Counter1 when ???
0B = 5th floor Goldenrod City Mart/ Counter1 when ???
0C = 5th floor Goldenrod City Mart/ Counter1 when ???
0D =
0E =
0F =
10 = Mahagony town
11 = Blackthorne City
12 =
13 = Pewter City
14 = Cerulean City
15 = Lavender
16 = Vermillion City
17 = 2nd floor Prismania City Mart/ Counter1
18 = 2nd floor Prismania City Mart/ Counter2
19 = 3rd floor Prismania City Mart
1A = 4th floor Prismania City Mart
1B = 5th floor Prismania City Mart/ Counter1
1C = 5th floor Prismania City Mart/ Counter2
1D = Fuchsia City
1E =
1F = Mt. Moon-Shop
20 = Indigo Plateau
21 =
>=22 =



That is all the basic examples for now....Until I learn more! xD


Resources:

***********
Movement List
***********

NOTE: Always in order: down, up, left, right; always 4 per action
This rule ends from code 0x45 on. Items with variables in parentheses, (xx), have a variable after them.

00 = Turn head Down
01 = Turn head Up
02 = Turn head Left
03 = Turn head Right
04 = ½ step down
05 = ½ step up
06 = ½ step left
07 = ½ step right
08 = slow step down
09 = slow step up
0A = slow step left
0B = slow step right
0C = 1 step down
0D = 1 step up
0E = 1 step left
0F = 1 step right
10 = 1½ step
11 = 1½ step up
12 = 1½ step left
13 = 1½ step right
14 = slow slide 1 step down
15 = slow slide 1 step up
16 = slow slide 1 step left
17 = slow slide 1 step right
18 = slide 1 step down
19 = slide 1 step up
1A = slide 1 step left
1B = slide 1 step right
1C = fast slide 1 step down
1D = fast slide 1 step up
1E = fast slide 1 step left
1F = fast slide 1 step right
20 = Turn 1 step (Face opposite of HIRO) down
21 = Turn 1 step (Face opposite of HIRO) up
22 = Turn 1 step (Face opposite of HIRO) left
23 = Turn 1 step (Face opposite of HIRO) right
24 = Turn 1 step (Facing HIRO) down
25 = Turn 1 step (Facing HIRO) up
26 = Turn 1 step (Facing HIRO) left
27 = Turn 1 step (Facing HIRO) right
28 = 1 step in waterfall mode (facing changes between down and right) down ???
29 = 1 step in waterfall mode (facing changes between down and right) up ???
2A = 1 step in waterfall mode (facing changes between down and right) left ???
2B = 1 step in waterfall mode (facing changes between down and right) right ???
2C = slow jump over 1 step down
2D = slow jump over 1 step up
2E = slow jump over 1 step left
2F = slow jump over 1 step right
30 = jump over 1 step down
31 = jump over 1 step up
32 = jump over 1 step left
33 = jump over 1 step right
34 = fast jump over 1 step
3A = remove fixed facing
3B = fix facing
3D = hide person
45 = make move before command faster
46 = Wait for time (xx as time)
47 = End of moving script
49 = hide person
4C = Teleport from
4D = Teleport to
4E = Fall from above screen
4F = 5 whole turns
55 = Shake screen (xx as displacement)

************
Pokemon List
************

01 - Bulbasaur 40 - Kadabra 7F - Pinsir BE - Aipom
02 - Ivysaur 41 - Alakazam 80 - Tauros BF - Sunkern
03 - Venusaur 42 - Machop 81 - Magikarp C0 - Sunflora
04 - Charmander 43 - Machoke 82 - Gyarados C1 - Yanma
05 - Charmeleon 44 - Machamp 83 - Lapras C2 - Wooper
06 - Charizard 45 - Bellsprout 84 - Ditto C3 - Quagsire
07 - Squirtle 46 - Weepinbell 85 - Eevee C4 - Espeon
08 - Wartortle 47 - Victreebell 86 - Vaporeon C5 - Umbreon
09 - Blastoise 48 - Ventacool 87 - Jolteon C6 - Murkrow
0A - Caterpie 49 - Tentacruel 88 - Flareon C7 - Slowking
0B - Metapod 4A - Geodude 89 - Porygon C8 - Misdreavus
0C - Butterfree 4B - Graveler 8A - Omanyte C9 - Unown
0D - Weedle 4C - Golem 8B - Omastar CA - Wobbuffet
0E - Kakuna 4D - Ponyta 8C - Kabuto CB - Girafarig
0F - Beedrill 4E - Rapidash 8D - Kabutops CC - Pineco
10 - Pidgey 4F - Slowpoke 8E - Aerodactyl CD - Forretress
11 - Pidgeotto 50 - Slowbro 8F - Snorlax CE - Dunsparce
12 - Pidgeot 51 - Magnemite 90 - Articunno CF - Gligar
13 - Rattata 52 - Magneton 91 - Zapdos D0 - Steelix
14 - Raticate 53 - Farfetch'd 92 - Moltres D1 - Snubbull
15 - Spearow 54 - Doduo 93 - Dratini D2 - Granbull
16 - Fearow 55 - Dodrio 94 - Dragonair D3 - Qwilfish
17 - Ekans 56 - Seel 95 - Dragonite D4 - Scizor
18 - Arbok 57 - Dewgong 96 - Mewtwo D5 - Shuckle
19 - Pikachu 58 - Grimer 97 - Mew D6 - Heracross
1A - Raichu 59 - Muk 98 - Chikorita D7 - Sneasel
1B - Sandshrew 5A - Shellder 99 - Bayleef D8 - Teddiursa
1C - Sandslash 5B - Cloyster 9A - Meganium D9 - Ursaring
1D - Nidoran (f) 5C - Gastly 9B - Cyndaquil DA - Slugma
1E - Nidorina 5D - Haunter 9C - Quilava DB - Magcargo
1F - Nidoqueen 5E - Gengar 9D - Typhlosion DC - Swinub
20 - Nidoran (m) 5F - Onix 9E - Totodile DD - Piloswine
21 - Nidorino 60 - Drowzee 9F - Croconaw DE - Corsola
22 - Nidoking 61 - Hypno A0 - Feraligatr DF - Remoraid
23 - Clefairy 62 - Krabby A1 - Sentret E0 - Octillery
24 - Clefable 63 - Kingler A2 - Furret E1 - Delibird
25 - Vulpix 64 - Voltorb A3 - Hoothoot E2 - Mantine
26 - Ninetails 65 - Electrode A4 - Noctowl E3 - Skarmory
27 - Jigglypuff 66 - Exeggcute A5 - Ledyba E4 - Houndour
28 - Wigglytuff 67 - Exeggcutor A6 - Ledian E5 - Houndoom
29 - Zubat 68 - Cubone A7 - Spinarak E6 - Kingdra
2A - Golbat 69 - Marowak A8 - Ariados E7 - Phanpy
2B - Oddish 6A - Hitmonlee A9 - Crobat E8 - Donphan
2C - Gloom 6B - Hitmonchan AA - Chinchou E9 - Porygon2
2D - Vileplume 6C - Lickitung AB - Lanturn EA - Stantler
2E - Paras 6D - Koffing AC - Pichu EB - Smeargle
2F - Parasect 6E - Weezing AD - Cleffa EC - Tyrogue
30 - Venonat 6F - Rhyhorn AE - Igglybuff ED - Hitmontop
31 - Venomoth 70 - Rhydon AF - Togepi EE - Smoochum
32 - Diglett 71 - Chansey B0 - Togetic EF - Elekid
33 - Dugtrio 72 - Tangela B1 - Natu F0 - Magby
34 - Meowth 73 - Kangaskhan B2 - Xatu F1 - Miltank
35 - Persian 74 - Horsea B3 - Mareep F2 - Blissey
36 - Psyduck 75 - Seadra B4 - Flaaffy F3 - Raikou
37 - Golduck 76 - Goldeen B5 - Ampharos F4 - Entei
38 - Mankey 77 - Seaking B6 - Bellossom F5 - Suicune
39 - Primeape 78 - Staryu B7 - Marill F6 - Larvitar
3A - Growlithe 79 - Starmie B8 - Azumarill F7 - Pupitar
3B - Arcanine 7A - Mr. Mime B9 - Sudowoodo F8 - Tyranitar
3C - Poliwag 7B - Scyther BA - Politoed F9 - Lugia
3D - Poliwhirl 7C - Jynx BB - Hoppip FA - Ho-oh
3E - Poliwrath 7D - Electabuzz BC - Skiploom FB - Celebi
3F - Abra 7E - Magmar BD - Jumpluff
************
Item list
************

01 - Master Ball 51 - Poison Barb AF - Squirt Bottle
02 - Ultra Ball 52 - King's Rock B1 - Park Ball
03 - Bright Powder 53 - Bitter Berry B2 - Rainbow Wing
04 - Great Ball 54 - Mint Berry B4 - Brick Piece
05 - Pok¿ Ball 55 - Red Apricorn B5 - Surf Mail
07 - Bicycle 56 - Tiny Mushroom B6 - Lite Blue Mail
08 - Moon Stone 57 - Big Mushroom B7 - Portrait Mail
09 - Antidote 58 - Silver Powder B8 - Lovely Mail
0A - Burn heal 59 - Blue Apricorn B9 - Eon Mail
0B - Ice heal 5B - Amulet Coin BA - Morph Mail
0C - Awakening 5C - Yellow Apricorn BB - Blue Sky Mail
0D - Paralyze heal 5D - Green Apricorn BC - Music Mail
0E - Full Restore 5E - Cleanse Tag BD - Mirage Mail
0F - Max Potion 5F - Mystic Water BF - TM01 Dynamic Punch
10 - Hyper Potion 60 - Twisted Spoon C0 - TM02 Headbutt
11 - Super Potion 61 - White Apricorn C1 - TM03 Curse
12 - Potion 62 - Black Belt C2 - TM04 Rollout
13 - Escape Rope 63 - Black Apricorn C3 - TM04 Rollout (again)
14 - Repel 65 - Pink Apricorn C4 - TM05 Roar
15 - Max Ether 66 - Black Glasses C5 - TM06 Toxic
16 - Fire Stone 67 - Slowpoke Tail C6 - TM07 Zap Cannon
17 - Thunder Stone 68 - Pink Bow C7 - TM08 Rock Smash
18 - Water Stone 69 - Stick C8 - TM09 Psych Up
1A - HP Up 6A - Smoke Ball C9 - TM10 Hidden Power
1B - Protein 6B - Never - Melt Ice CA - TM11 Sunny Day
1C - Iron 6C - Magnet CB - TM12 Sweet Scent
1D - Carbos 6D - Miracle Berry CC - TM13 Snore
1E - Lucky Punch 6E - Pearl CD - TM14 Blizzard
1F - Calcium 6F - Big Pearl CE - TM15 Hyper Beam
20 - Rare Candy 70 - EverStone CF - TM16 Icy Wind
21 - X Accuracy 71 - Spell Tag D0 - TM17 Protect
22 - Leaf Stone 72 - Rage Candy Bar D1 - TM18 Rain Dance
23 - Metal Powder 75 - Miracle seed D2 - TM19 Giga Drain
24 - Nugget 76 - Thick Club D3 - TM20 Endure
25 - Pok¿Doll 77 - Focus Band D4 - TM21 Frustration
26 - Full Heal 79 - Energy Powder D5 - TM22 Solar Beam
27 - Revive 7A - Energy Root D6 - TM23 Iron Tail
28 - Max Revive 7B - Heal Powder D7 - TM24 Dragon Breath
29 - Guard Spec. 7C - Revival Herb D8 - TM25 Thunder
2A - Super Repel 7D - Hard Stone D9 - TM26 Earthquake
2B - Max Repel 7E - Lucky Egg DA - TM27 Return
2C - Dire Hit 7F - Card Key DB - TM28 Dig
2E - Fresh Water 80 - Machine Part DC - TM28 Dig (again)
2F - Soda Pop 82 - Lost Item DD - TM29 Psychic
30 - Lemonade 83 - Star Dust DE - TM30 Shadow Ball
31 - X Attack 84 - Star Piece DF - TM31 Mud - Slap
33 - X Defend 85 - Basement key E0 - TM32 Double Team
34 - X Speed 86 - Pass E1 - TM33 Ice Punch
35 - X Special 8A - Charcoal E2 - TM34 Swagger
36 - Coin Case 8B - Berry Juice E3 - TM35 Sleep Talk
37 - Item Finder 8C - Scope Lens E4 - TM36 Sludge Bomb
39 - Exp. Share 8F - Metal Coat E5 - TM37 Sand Storm
3A - Old Rod 90 - Dragon Fang E6 - TM38 Fire Blast
3B - Good Rod 92 - LeftOvers E7 - TM39 Swift
3C - Silver Leaf 96 - Mystery Berry E8 - TM40 Defense Curl
3D - Super Rod 97 - Dragon scale E9 - TM41 Thunder Punch
3E - PP UP 98 - Berserk Gene EA - TM42 Dream Eater
3F - Ether 9C - Sacred Ash EB - TM43 Detect
40 - Max Ether 9D - Heavy Ball EC - TM44 Rest
41 - Elixer 9E - Flower Mail ED - TM45 Attract
42 - Red Scale 9F - Level Ball EE - TM46 Thief
43 - Secret Potion A0 - Lure Ball EF - TM47 Steel Wing
44 - S.S.Aqua Ticket A1 - Fast Ball F0 - TM48 Fire Punch
45 - Mystery Egg A3 - Light Ball F1 - TM49 Fury Cutter
47 - Silver Wing A4 - Friend Ball F2 - TM50 Nightmare
48 - MooMoo Milk A5 - Moon Ball F3 - HM01 Cut
49 - Quick Claw A6 - Love Ball F4 - HM02 Fly
4A - Poison Cure Berry A7 - Normal Box F5 - HM03 Surf
4B - Gold Leaf A8 - Gorgeous Box F6 - HM04 Strength
4C - Soft Sand A9 - Sun Stone F7 - HM05 Flash
4D - Sharp Beak AA - Polkadot Bow F8 - HM06 Whirlpool
4E - Paralyze Cure Berry AC - Up Grade F9 - HM07 Waterfall
4F - Burnt Berry AD - Berry FF - Nothing
50 - Ice Berry AE - Gold Berry
If you have any Questions, Feel Free to ask.

Skeetendo, Inc.
December 24th, 2007, 04:14 PM
Ah, Thank you for posting this cooley! Also if you would like to, Here (http://skeetendo.110mb.com/scriptingcodes_eng.htm) is an online form of the Scripting Document you could link to in your original post.

FHJoker
December 31st, 2007, 05:12 AM
Here is a tutorial on how to script, Skeetendo showed me how to do it, so now I'm sharing with everyone. If I missed anything, please Tell me.

******************
What You Will Need
******************

1. Hex Editor(Preferably Translhextion)
2. Gold Map 1.6
3. Tauwasser's Scripting Compendium (http://skeetendo.110mb.com/scriptingcodes_eng.htm)
4. Pokémon Gold or Silver Rom
5. Pointer Calculator (http://crystalfallows.110mb.com/AutoIndex/index.php?dir=tools/RSE/&file=APoint_1116.zip)
6. Windows Calculator(Start>All Programs>Accesories>Calculator)

***************

First you Pick which person to edit. We will edit the fat guy in New bark town, so go in Goldmap and double-click New bark town, and the "Map Properties" Will come up. Go to the events data offset and it should be: $120366. Now we open our Hex Editor and we go to this address. This takes us to the start of the actual event data for the map. Now we scroll down until we find a blank space after the data that is already in this bank. The blank space starts at 0x1225A0.

Now that we have found our blank space, we have some room to insert our script. For our script I will make the Fat guy display Simple Text. Our SCript should look like:

6A 47 4C xx xx 53 49 90

You can Type "00" for the x's for now. Now, after you have typed the script, you can go to the byte after 90 Which should be 0x1225A8, and Write Text, BUT! before you go crazy writing text, make sure you start it with 00.
Example:

00 87 A4 AB AB AE E7 - This text will say "Hello!" But it is wrong.

00 87 A4 AB AB AE E7 57 00 - This is correct, always end the text with 57 00, so the game knows the text has been ended, if you don't you will Get a message that says "1df-" or "2df-".

Ok, so far we have our script and text, now what? Now you fill in those 00's for the text pointer. To get the pointer use Scizz's A-point (http://crystalfallows.110mb.com/AutoIndex/index.php?dir=tools/RSE/&file=APoint_1116.zip) to calculate it. All you do is type the offset (0x1225A8) and hit Calculate pointer. (make sure the "Offset in Pointer" is checked). You should get 48A865 as the pointer. take the last four digits (A865) and put it in the script. It should now look like this:
6A 47 4C A8 65 53 49 90 00 87 A4 AB AB AE E7 57 00 (Underline is the text)

Before you save it, Calculate the pointer of where the script starts (0x1225A0) and write it down.

Click save. All right, the script is in the game. Now we need to assign it to someone.

The pointer you wrote down, You will now need it. Open up Calculator in accessories, and click on the "Hex" bullet. Type in the first byte of the 4 digit pointer( 1 byte = 2 digits) type in A0 , then click on the "Dec" Bullet and you get "160". Do the same for the second byte, type in 65 and get 101.

Now Reload your Rom in A-map....Just kidding. Reload it in Goldmap, goto Events Tab, then click on the fat guy. His info should pop up. Where it says Text Block Type in "160" And where it says Text bank, type in "101".

Hit Save and test it. If you did it wrong, then you either don't get any text at all, or get a "1Df-" message.

You have learned how to script in hex, For GOLD version! Spread the news, and get more people into hacking gold.


Special Award goes to Skeetendo Inc. For teaching me Scripting!
[S-HIGHLIGHT]/-|-\
\-|-/[/S-HIGHLIGHT] - Here is your award, Please accept!
******************
Examples:
******************
REGULAR TALK
6A 47 4C xx xx 53 49 90 - Faceplayer, then open text box and writes the text from the pointer. Then close text box.

EMOTICON
6A 73 00 74 00 zz xx 90 - 00 = Emoticon no. zz = Person no(add 1 to it. person is 2 add 1 and is 3) xx = Time in hex 10 is 0A.

YES/NO
6A 47 4C xx xx 54 4E 09 xx xx 4C xx xx 53 49 90 -
Ok, the 54 means to keep a text box open, so that a Yes/no box(4E) comes up. 09 xx xx means that if it is yes, then go to the pointer xx xx, If no then the script continues, in this case, Text comes up and says "Fine Then" You don't need to put another 47 4C because the text box was already open so you just need to load new text from a new pointer. Btw, 08 xx xx = If no then goto (pointer), and 09 xx xx = If yes then goto (pointer). You Do NOT NEED BOTH!

That is all the basic examples for now....Until I learn more! xD
If you have any Questions, Fell Free to ask, even though most of them I probably Will not answer based on my experience...xD
Where can I get the table file for Translhextion?

cooley
December 31st, 2007, 10:16 AM
Ok, you didn't have to quote the whole first post.

Gold Table File (http://www.pokehack.com/tutorials/Generation2.zip)

Godot
December 31st, 2007, 10:56 PM
Ah, I see you have posted a tut for this on PC now. Thanks for the help. I appreciate it.

Virtual Chatot
December 31st, 2007, 11:02 PM
Awesome, this will help out a lot of people :3

Binary
January 2nd, 2008, 07:07 AM
I love this! Nice work cooley, it will definitely help alot of people including me.
But I need time to learn XD. Anyways, nice work!

~Celebi

cooley
February 5th, 2008, 06:16 PM
*UPDATE

I updated the first post with more Examples of scripts to help you get scripting better. I'll do whatever I can to help you Get it.

cooley
February 7th, 2008, 06:08 PM
Just what CBM was talking about, I have basically no replies. I bet you if this were a Tutorial on how to Edit FireRed completely I'd get a bunch of replies. Same goes for my other topic with the Megamap tool.

The tool makes hacking Gold Easier! People don't care of course, bet you they can't wait for advance map 1.9, What can I say, I hack both games of course so...

thethethethe
February 8th, 2008, 05:18 PM
Hey, cooley, I was just looking through the scripting Compendium, because I was a little bored, and I saw this.
Checks if HIRO/account has got zzyyxx money. Gives feedback: 00 = Enough money
01 = Exact amount
02 = Less money
zzyyxx = amount of money (000000 - 0F423F)

Structure:

[24][00-HIRO/01-account][xxyyzz]
So I was wondering, how would we call upon the 01 or 00? Kind of like the compare command of the third gen. I was just wondering.

IIMarckus
February 9th, 2008, 06:08 PM
Hey, cooley, I was just looking through the scripting Compendium, because I was a little bored, and I saw this.

So I was wondering, how would we call upon the 01 or 00? Kind of like the compare command of the third gen. I was just wondering.I imagine you would use the 06-0B RAM checks. (http://skeetendo.110mb.com/scriptingcodes_eng.htm#Marke06bix0B)

cooley
February 9th, 2008, 06:31 PM
Well, I was about to answer that, but thanks anyways!
Structure is 08 xx xx - Answer = no and 09 xx xx - Answer = Yes.

Just like GBA, you don't need both, if one is uesd, then you wn't need the other.

boxset 5
compare LASTRESULT 0x1
if 0x1 goto $gggg

If the answer is No, the next line after "if 0x1 goto $gggg" Will be what happens if you say no.

6A 47 4C xx xx 54 4E 09 xx xx 4C xx xx 53 49 90 - If yes, then goto pointer, and if no a text box comes up saying No is chosen.

I haven't used the other RAM checks, but Oh Well. Markus, do you happen to know how to use the bitTable set correctly? correctly?

IIMarckus
February 9th, 2008, 06:40 PM
Here's a link explaining the bit-table format. (http://datacrystal.org/wiki/Pokemon_Gold_Flags) All they are are flags; just set a bit and write scripts that do stuff if the bitflag is set or reset.

cooley
February 9th, 2008, 06:46 PM
Here's a link explaining the bit-table format. (http://datacrystal.org/wiki/Pokemon_Gold_Flags) All they are are flags; just set a bit and write scripts that do stuff if the bitflag is set or reset.

Of all of those flags, which ones are for free use? are they the ones that aren't mentioned?
What's the difference between bitTable 1 set and bitTable 2 set?

Last question: Is the structure like:
6A 31 yy yy 06-0B xx xx ............... 33 yy yy 90 (......... = Script)
That's it?

IIMarckus
February 9th, 2008, 07:02 PM
Of all of those flags, which ones are for free use? are they the ones that aren't mentioned?I doubt all the flags have been figured out. Probably you'd have to overwrite at least some of the existing ones for whatever you plan on doing.What's the difference between bitTable 1 set and bitTable 2 set?Table 2 is generally used for major flags such as Fly locations being found and the Time Capsule being open.Is the structure like:
6A 31 yy yy 06-0B xx xx ............... 33 yy yy 90 (......... = Script)
That's it?That looks about right. It depends on what you're trying to do, though.

Scream.Aim.Fire
March 27th, 2008, 06:06 PM
Now we scroll down until we find a blank space after the data that is already in this bank. The blank space starts at 0x1225A0.

Now that we have found our blank space, we have some room to insert our script. For our script I will make the Fat guy display Simple Text. Our SCript should look like:

I'm new to G/S/C hacking, just started actually.
I'm kind of experienced with FR/LG but I don't like it, I really prefer G/S/C.
So, I'm much more attracted to hacking those than the newer Advance games. I'd play Pokemon Prism over Shiny Gold any day. So any other tutorials you could write on the subject of scripting in a hex editor for Gold would be excellent. I have a question though. I might be retarded or something, then again I am a noob with hex editing, but I don't quite get what you mean by ''Now we scroll down until we find a blank space....The blank space starts at 0x1225A0....'', because I scroll down when I get to $120366, and I can't find 0x1225A0. By blank space you mean where the numbers are 00's right? Ugh, I don't know, but I'm not gonna give up on G/S/C editing so hopefully you get what I am saying. If not, tell me and I'll try to explain it differently.
Thanks.

IIMarckus
March 27th, 2008, 06:17 PM
Yes, in Pokemon GSC blank space is generally any large block of 00s.

Scream.Aim.Fire
March 27th, 2008, 07:29 PM
Alright, thanks man.
So, does it really matter where I write? Because I'm still having difficulty finding 0x1225A0. Well, rather, a blank space at that point.

IIMarckus
March 27th, 2008, 07:41 PM
In most cases it does matter where you write, because you'll want the data to be in the same bank, or block of 0x4000 bytes.

What version are you in? Data in Crystal is located differently from Gold and Silver.

Scream.Aim.Fire
March 27th, 2008, 08:14 PM
I'm currently in Gold. I plan to stay there. Thanks for the help btw.

IIMarckus
March 27th, 2008, 08:18 PM
Are you still having trouble finding the blank space?

Scream.Aim.Fire
March 27th, 2008, 08:28 PM
Well, I'd like to say no, but yeah, I am.
I find a lot of blank spaces, but none at 0x1225A0.
But perhaps I'm looking in the wrong spot.

IIMarckus
March 27th, 2008, 08:56 PM
There's definitely blank space at 1225A0. Just to confirm you're using the right ROM, could you take a screenshot of your ROM information? You can get to it in VisualBoyAdvance by clicking File > Rom Information. You should get something like this:

http://i262.photobucket.com/albums/ii89/iimarckus/confirm.png

Next, which hex editor are you using? Are you sure you're navigating to the right location? Here are some example screenshots in Windhex, (http://i262.photobucket.com/albums/ii89/iimarckus/1255A0/windhex.png) Hexpose (http://i262.photobucket.com/albums/ii89/iimarckus/1255A0/hexpose.png), and Translhextion (http://i262.photobucket.com/albums/ii89/iimarckus/1255A0/translhextion.png).

Scream.Aim.Fire
March 27th, 2008, 09:27 PM
Ok, I downloaded a new rom, and the numbers are different.
Maybe I was trying to hex edit an already hacked ROM.
I just checked 1225A0 and it is blank. Sorry for the trouble.
But one more question.
On my new ROM, there are some blank spots long before 1225A0. Could I write script in those? Or not? And if not why does it have to be so far down at 1225A0?
Thanks.

IIMarckus
March 27th, 2008, 09:36 PM
The other free space would be unsuitable because scripts have to be repointed to within their own data bank. A bank is 0x4000 bytes. This bank, for example, consists of all the data from 120000 to 123FFF. You could theoretically repoint the data to anywhere in this bank, but in the vast majority of cases it's best to use free space if it's available.

Scream.Aim.Fire
March 27th, 2008, 10:08 PM
Ah, I see.
So, I couldn't script at 00027BDC because it is not within the 0x4000 limit of $120366?

IIMarckus
March 28th, 2008, 09:17 AM
That's exactly right.

Scream.Aim.Fire
March 28th, 2008, 09:42 AM
Ah, I'm catching on finally.
Wrote a script at like 1 AM. Stuff's addicting.
Anyway, I got it to work mostly. Was just a simple message script.
Thank you for all your help, =D. You've been awesome.

cooley
April 13th, 2008, 12:02 PM
The other free space would be unsuitable because scripts have to be repointed to within their own data bank. A bank is 0x4000 bytes. This bank, for example, consists of all the data from 120000 to 123FFF. You could theoretically repoint the data to anywhere in this bank, but in the vast majority of cases it's best to use free space if it's available.
What if I made a Huge script and it accidentally enters another Bank? will it continue to work?

IIMarckus
April 13th, 2008, 12:12 PM
No, it will be cut off where the bank ends. At that point the game will probably crash, because it will start reading VRAM data as if it's the continuation of the script (which is something that should never happen).

cooley
April 13th, 2008, 12:21 PM
Oh, ok. Thanks!

Btw, what's "NIH Syndrome"

Innocence
April 15th, 2008, 09:19 PM
MOVEMENTS
6A 47 4C xx xx 53 49 69 xx xx 90
Ok, New codes here. 69 is the movement of the talked-to person, and 68 is movement for any person but you have to put people no.
the command 69 requires a 2 byte pointer to the movement data and the movements are below. After you've pointed to the movements, end the movements with a 47 command. Ok, so you talk to someone, then they tell you something, and then the move around, yay! You made a movement script!
This doesn't explain how to change direction, and the compendium isn't very clear either. I try to turn to face a certain direction, but the character just turns and keeps moving down...

IIMarckus
April 16th, 2008, 06:48 AM
Always in order: down, up, left, right; always 4 per action

Moving scripts:
00 = Turn head
04 = ½ step
08 = slow step
0C = step
...
ie 0C = walk down, 0D = walk up, 0E = walk left, 0F = walk right

cooley
April 16th, 2008, 03:34 PM
*Updated First post with ALL movements

IIMarckus
April 17th, 2008, 05:37 PM
The "text block"/"text bank" labeling in Goldmap has nothing to do with text. It's actually the two-byte pointer to the script, as you can see if you check out the scripts in hex. That labeling can be confusing... makes you wonder why the Goldmap developers called it that.

cooley
April 22nd, 2008, 05:54 PM
Yeah that is kinda weird.

Anyone know when a new gold map comes out?

Hat?
April 23rd, 2008, 10:52 AM
This isn't for sure but I think work has been stopped on it, as the last version I have was copyrighted from 2000 to 2005.

BigSteve
May 11th, 2008, 11:19 AM
i found this thread very helpful in starting up the scripts but i need to know how to set up a legendary pokemon event
i.e. an overworld sprite that when talked to says 'GYOOOOOO' and starts a battle with zapdos one time only

IIMarckus
May 11th, 2008, 12:10 PM
i found this thread very helpful in starting up the scripts but i need to know how to set up a legendary pokemon event
i.e. an overworld sprite that when talked to says 'GYOOOOOO' and starts a battle with zapdos one time onlyFirst realize what you need to do:

- Open text box
- Print text
- Start battle
- Set a flag so it only happens once

Now look at Tauwasser's document and see what commands you'll need. If you're having trouble, find the in-game scripts for Pokemon such as Ho-oh or Sudowoodo and see how they're built, then change it so that it'll use Zapdos.

BigSteve
May 12th, 2008, 11:59 AM
First realize what you need to do:

- Open text box
- Print text
- Start battle
- Set a flag so it only happens once

Now look at Tauwasser's document and see what commands you'll need. If you're having trouble, find the in-game scripts for Pokemon such as Ho-oh or Sudowoodo and see how they're built, then change it so that it'll use Zapdos.

1) where do i find the offsets for Sudowoodo?

2) in gold map what is the 'Person Number' for the bird icon?

3) can you link me a flags tutorial?

p.s. the reason im posting here is because if someone else decides to have a go at learning script they can refer here :)

cooley
May 12th, 2008, 01:23 PM
1. Using my tool, Megamap in the Toolbox. It will give you the Pointer though, just get the offset through A-point. I was so kind, I did it for you!

Sudowoodo Pointer: 4BAA61
Sudowoodo Offset: 12E1AA

2. You shouldn't change the people numbers through Gold map, you should try hex. And maybe a bit of Pksprite (overworld editor)

3. There is no flags tutorial, but I can teach you.

If you've ever hacked Firered/Leafgreen before, then you'll see that it is the same as Gold.

Firered:
checkflag 0x200
if 0x1 goto $pointer -----If it has been set then goto another pointer
...... -----If it hasn't then continue with the script
......
setflag 0x200 ------Set the flag, so that next time it can be checked, and won't happen again.
end

Gold:
31 10 00 09 xx xx ....... 33 10 00 90

31 = Check for flag
'requires 2 bytes which are the flag numbers

09 = Ram Check [2]
' 09 means "if yes" and 08 means "If no"

33 = Set a flag
'requires 2 bytes which are the flag numbers

90 = End script
'No parameters required

xx xx = Pointer to another script

10 00 = Flag ID you can use an flag you wish, but the numbers are reverse hex. 0010 = 1000 in-game. 1000 = 0010 in-game, etc.

....... = Script

That should explain everything, now to add it to the tutorial!

[2] =
06-0B RAM checks:


06: When [RAM]=byte ...
07: When [RAM]<>byte ...
08: When [RAM]=0 ...
09: When [RAM]<>0 ...
0A: When [RAM]<byte ...
0B: When [RAM]>byte ...


Italicized = Command
Underlined = Command parameters

By the way everyone, I updated the First Post with More commands and an Item and Pokemon List.

Enjoy!

BigSteve
May 13th, 2008, 07:39 AM
thanks, ive not hacked before so its all new to me and i dont have time to take in the flags stuff right now,

is there a reason Megamap's help thing comes up with Zeromap on the help screen and parts of it are written in german :S



i've added your msn btw :)

IIMarckus
May 13th, 2008, 07:43 AM
is there a reason Megamap's help thing comes up with Zeromap on the help screen and parts of it are written in german :SIt does that because Megamap is an incomplete translation of a German tool called Zeromap. <_<

BigSteve
May 13th, 2008, 12:35 PM
It does that because Megamap is an incomplete translation of a German tool called Zeromap. <_<


ah ok :)

can someone post a demo script that would make someone say 'Hello!' and give you a bulbasaur?

cooley
May 14th, 2008, 08:42 AM
I have posted both message scripts and Givepokemon scripts, you figure it out now. Anyways, the message would need to point to a pointer in hex within the same bank. I can't do that for you, that's why you would need to do it on your own.

Here's the layout though:
6A 47 4C xx xx 53 49 2D 01 05 00 00 87 90

the 87 is the sound code for the game to play a "got a Pokemon/Item" song after the pokemon is given.

the xx xx is the last 4 bytes of the pointer to the text.

You should insert this text: 00 87 A4 AB AB AE E7 57
then point to the "00"

btw, the Text just means "Hello!" in hex

BigSteve
May 15th, 2008, 02:41 AM
thanks man, i just needed that because i failed and got opcode errors from it and just got angry with it after 5 attempts

ok...
after doing that i got these -.-
the giving bulbasaur worked though
is my ROM dirty?
could the titlescreen patch affect this in any way?
http://i32.tinypic.com/21l01ub.pnghttp://i30.tinypic.com/2uzql2g.png

IIMarckus
May 15th, 2008, 08:07 AM
thanks man, i just needed that because i failed and got opcode errors from it and just got angry with it after 5 attempts

ok...
after doing that i got these -.-
the giving bulbasaur worked though
is my ROM dirty?
could the titlescreen patch affect this in any way?
http://i32.tinypic.com/21l01ub.pnghttp://i30.tinypic.com/2uzql2g.pngIt looks like you didn't load the font into RAM. Make sure you load the font beforehand, and load moving sprite tiles afterward.

BigSteve
May 16th, 2008, 06:06 AM
It looks like you didn't load the font into RAM. Make sure you load the font beforehand, and load moving sprite tiles afterward.

i take it you mean the 47 4C bytes?
i get a fatal error when i try adding that and i get the messed up palette (as seen in the quick questions thread) :S

Skeetendo, Inc.
May 17th, 2008, 01:27 PM
Also by using the different pointer codes you can actually point to scripts in other banks, and by using 4B instead of 4C to call text, you can use a 3 byte pointer to call text in another bank (These get used in Secrets and Rumours for the nurse at the Trade Center, so I don't have to keep re-entering the same text over and over).

And here is a list of Pic Numbers (in hex). Know that if it is on an outside map, not a cave or indoor map and you use a sprite that is not in that spriteset it will load your picture or a glitch instead. here is the list(NOT found by myself, but by Coolboyman):

SPRITE GUIDE R SOMETHIN

00 = You
01 = You
02 = You on Bike
03 = Kid with Gameboy
04 = Rival
05 = Prof Oak
06 = Red
07 = Blue
08 = Bill
09 = Old Man
0A = Koga's Daughter
0B = Kurt
0C = Mom
0D = Blaine
0E = Red's Mom
0F = Blue's Sister
10 = Prof Elm
11 = Will
12 = Falkner
13 = Whitney
14 = Bugsy
15 = Morty
16 = Chuck
17 = Jasmine
18 = Pryce
19 = Claire
1A = Brock
1B = Karen
1C = Bruno
1D = Misty
1E = Lance
1F = Lt. Surge
20 = Erika
21 = Koga
22 = Sabrina
23 = Man
24 = Girl
25 = Little Boy
26 = Little Girl
27 = Boy
28 = Other Girl
29 = Woman - Long Hair
2A = Beauty
2B = Some Guy
2C = DJ Ben
2D = Bald Man
2E = Woman
2F = Old Man w/ Glasses
30 = Old Woman
31 = Swimming Boy
32 = Swimming Girl
33 = Snorlax
34 = Surfing Pikachu?
35 = Rocket Member
36 = Rocket Member Female
37 = Nurse at Pokecenters
38 = Imakuni? (SaR)
39 = Cashier at Store
3A = Fat Man
3B = Man with Hat
3C = Scientist
3D = Kimono Girl
3E = Bald Old Man

40 = Top Hat Man
41 = Headband Wearing
42 = Game Corder Coin Lady
43 = Magnet Train Man
44 = Hiro!?!
45 = Bald Man
46 = S.S. Aqua Captain

48 = Advice man at GYM
49 = Sailor

4B = Man with Glasses
4C = Monster
4D = Clefairy
4E = Pidgey
4F = Charizard

54 = Item Ball
55 = Book

57 = Tree
58 = Nurse
59 = Smashable Rock
5A = Boulder
5B = Console
5C = Console
5D = Plant
60 = Snorlax
61 = Notebook

69 = Slowpoke

82 = Meowth

85 = Oddish

8d = Poliwag

8f = Clefairy

91 = Abra

94 = Jigglypuff

99 = Miltank
9A = Machoke
9B = Voltorb

9D = Monster
9E = Pidgey

A0 = Gyrados


F0 = Console
F1 = Doll 1
F2 = Doll 2
F3 = Big Doll

F7 = Fuchsia Gym Trainer
F8 = Fuchsia Gym Trainer 2
F9 = Fuchsia Gym Trainer 3
FA = Fuchsia Gym Trainer 4

I tried to remove them, but any entry with (SaR) next to it or somethign similar designates what I have changed the sprite to in SaR.

Blazichu
May 18th, 2008, 01:08 AM
i take it you mean the 47 4C bytes?
i get a fatal error when i try adding that and i get the messed up palette (as seen in the quick questions thread) :S

Maybe the issue is that you are not ending the code with a [49][90].

So it would go [47][4C][2-byte Pointers][49][90].

BigSteve
May 18th, 2008, 07:36 AM
Maybe the issue is that you are not ending the code with a [49][90].

So it would go [47][4C][2-byte Pointers][49][90].


i forgot to post here but i found out (from either Cooley or IIMarckus) that the problem was where i loaded the moving sprites in the script. since then i have moved on and with help from IIMarckus set a flag so there has to be pokeballs at Cherrygrove mart for the fatman to give bulbasaur (meaning Elm has the Egg so the player is about to set out properly).

toniblade
March 22nd, 2009, 10:12 AM
Thanks a lot this helped me much!

Christos
March 22nd, 2009, 10:50 AM
Please don't post in threads that are over a month old.