![]() |
Study on the Special and Special2 commands
After a long break, I came back today with a large document. Might I add, this document is still incomplete, but is an honest attempt at cracking this game.
This document I bring you is a List of All Special commands for Fire Red\Leaf Green and a small study on the Special and Special2 commands in XSE. All of you must have worked at least once with this versatile command, that allows you to execute a pre-rendered function other than those of the script. These commands range from small pieces of work, such as healing your pokemon, to more complex ones such as checking hardware. I shall make a brief explanation on how they work. Special <special number> (0xaabb) Code:
Code:
Special1 and Special2 are interchangeable, meaning that using Special1 calls only for the execution of that special function for its effects, while Special2 also receives a value from the execution and stores it at the given variable. When in doubt, using special2 will allow you to know if the function is meant to return something or not. When searching for Specials that work in FR\LG, I found an interesting reaction from the return addresses. Special functions can be divided in three cathegories: The ones that return 9f69 (40809): Code:
Code:
Code:
Code:
This list here has all the specials I could understand what they were doing in game. Spoiler:
Here, I place those I know what they do, but don't know what the offsets, flags and variables used mean in-game Spoiler:
There are the ones I have no idea what they do. If any of them sound familiar, post what it does so it might be added. Spoiler:
Just for completion, or if anyone wants to test them out, these are the specials that return ADC1: Spoiler:
That's it for now. I hope you find this document helpful. I may return to post some more in-detailed analysis of this code to the more practice-oriented. thanks to liuyanghejerry for the use of Special 0x39 |
I bet you have a lot of exp from this . Thanks dude !
|
I love this thread,really.It brings new blood into scripting.
Keep going,my friends. And I can do some test for you, if you need. |
This is a very nice document. I might add this to my upcoming scripting tutorial, if it's alright with you, of course.
I'm just wondering, would it possible to use special2 to store a variable into something like LASTRESULT to use for things like yes/no scripts, and other things? |
Quote:
Yes, you can.LASTRESULT is a var too.But it will return not only 1,0,but also other hex numbers. |
Sorry for double reply,but I do have one thing to say.
I just found that in FR/LG,special2 0x39 is for about VS Seekers. When returns 0x1,it means player has used VS Seekers in this place. example: Code:
|
Ahh, JPAN, you never cease to amaze me.
I looked over this bit of info, and am impressed! Maybe you could even fix your ASM stuff... (I'll send you a PM) |
Special 18F sets the trainer-flag of the last opponent. I haven't checked whether it's correct yet.
|
I think I've identified a few more specials by looking at FireRed's default scripts. My findings:
D8 This special updates the value of script variable 0x403A, which seems to indicate the current floor. It is used by elevator scripts. 1B8 Called when an elevator script needs to know what floor should be the default in an upcoming multichoice2. It returns 0x0, 0x1, or 0x2 (going as high as there are floors?). 160 Called after the player selects a floor. It appears to generate a message box depending on the player's selection (though the messagebox is immediately hidden with releaseall if the player chose the floor they are already on). Does it accept 0x8006 as the floor the player has selected? 1A1 I don't know what it does, but I do know that it is called by level scripts in the chambers for each Elite Four member. It appears to take variable 0x8004 as input -- 0x8004's value seems to denote which Elite Four chamber you're in. 29 Specifically, this is used to select which 3 you'll use in a (EDIT) four-player link activity (four-way battle?). 83 Used in the Daycare Man egg-giving script. It appears to check how many Pokemon are in the player's party (between 0 and 6), returning that number to the supplied variable. 94 It's not from R/S, but it is a leftover. It's called in the script for Lostelle in Berry Forest, but the buffered strings aren't used. (Perhaps in other languages, they are used?) A9 I don't know what it is, but it's called in the Hall of Fame registration room level scripts. 127 Called when talking to the woman in the Link Battle/Trade rooms -- just before she asks you to take your seat. 128 Called when talking to the woman in the Link Battle/Trade rooms -- just after she asks you to take your seat. 135 Part of Level Script 1 in ICEFALL CAVE (1.111). It appears to play a part in managing the breakable ice tiles. 165 Part of Pokemon-giving scripts when a Pokemon received via "givepokemon" is sent to the PC. 18A Apparently returns the number of the currently-selected box in the PC. It is used by scripts when the player receives a Pokemon via "givepokemon" and the Pokemon was sent to a different PC box because the currently-selected one was full. 194 Unknown. Used in many TRAINER TOWER scripts. Before it is invoked, 0x8004 is set to some value (I've seen 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xA, 0xB, 0xC, 0x10, 0x12, 0x13). It APPEARS to return a value in some cases (0x0, 0x1, or 0x2). It may also take 0x8005 and 0x8006 as input. 1BA Used twice when stepping on the script tile that triggers the HO-OH encounter on NAVEL ROCK. Does it toggle camera movement without locking all OWs? 1BB Sometimes used with 1BA. EDIT: AB Triggering a Tree wild battle isn't the only thing this function does. It will actually decide at random whether or not to trigger the battle. If no battle is triggered, 0x0000 is written to script variable 0x800D (LASTRESULT). If a battle is triggered, 0x0001 is written (so that the script calling this special knows to use waitstate). EDIT2: 196 I think it checks if var 0x8004 is the item ID of a TM, and if so, it buffers the attack that the item teaches. I think it's used upon picking up a TM (base script: 0x081A67B3). 15E This is used in the internal script that the game calls when the player presses A on a hidden-item Signpost event. If the item found has index 0 (item: ????????), then it is treated as a Coins pickup, and this special is used to check if the player can carry the found coins. 17D This is also used in PC scripts, and appears to use variable 0x8004 as an argument. 0x1B represents the PC and 0x1F represents the Hall of Fame display? 185 Unknown, but it's used in the Mystery Gift questionnaire script. C7 Called from the internal script used when the player whites out (0x081A8DFD). It sets LASTRESULT; if LASTRESULT is set to 0x1, the calling script will attempt to take money from the player. 175 Called from the internal script used when the player whites out. It takes money from the player and buffers the amount taken to buffer 0. 5 Appears to terminate a link. Called by a script at 0x081BB9D4. 18F Called after an endtrainerbattle2 command buried in some scripts I can't make sense of. According to the OP it sets flags above 0x500 -- trainer flags. |
Special 135 appears to be related to Icefall Cave. It's used in a level script, and some really complicated functionality that manages its breakable ice tiles (using cmda6) sets some flags... I think that special 135 either reads certain flags (to check which ice tiles have broken, and re-break them on map entry) or writes certain flags (to reset the ice tile flags, thereby unbreaking them on map entry).
|
With the "special 0x163" command, does that return any values, saying if it is seen or caught, perhaps?
|
No, it only returns a number depending on what happened, and you have to make it display the message depending on the number.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
I can't remember off the top of my head, but that's pretty much what you could do for that. |
Just adding a unknown special2:
14F = completed all 150 pokemon in pokedex. (Pokemon - Fire Red 1.0) Source inside spoiler Person event person found in CELADON CITY (10,9) Person event: 1 Person event no: 2 Spoiler:
|
I really hope that I won't get penalized for posting here...
I think I have what the use of two other specials are. Special 0x129 activates the roaming legends. It uses variable 0x4031 to determine which will roam. I tested this out by activating the special, and "faking" a battle with the legend using the wildbattle command. The icon then showed up on the World Map, indicating where it was. I think Special 0x175 is used to calculate the amount of money dropped when you whiteout. In the whiteout script, Special 0x175 is called, and immediately following is the "player dropped $[buffer1]s" message. You mentioned how the Special 0x175 buffers a calculated value, so it seems like this is a likely reason for it. I could be wrong, though, since the amount of money lost is based on level of Pokemon and number of badges, not status. |
I belive:
14F: Checks if KantoDex is Complete (Returns 1 if it is complete) it is used by the "Game Designer" in Celadon Mansion |
1ab actually controls most of the Birth Island puzzle.
Every time the player hits the Triangle from the right angle/amount of steps (not sure which) 0x8000 is set to 0x1. If the player gets it wrong/takes too long, it is set to 0x0. Once the puzzle is completed, it is set to 0x2. Every time after, it is set to 0x3. |
Not sure if this is well known or if I should even revive a 3 year old thread but I thought this was relevant(this is the only firered specials):
special 0x17B doesnt just send you on a boat to vermillion. It sends you to certain boat destinations depending on what variable 0x8006 is. Like if 0x8006 is 0x0, it will be vermillion. But if it's 0x1, it'll send you to one island, if 0x2 two island, 0x3 to 3 island and so on. |
Quote:
|
Not to be that guy who keeps reviving this thread, but as I said before this is the only thread on Fire Red specials. I'm not sure how well known this is but special 0x96 is used to set the flag that is stored in variable 0x8004.
For example: setvar 0x8004 0x27B special 0x96 That would set the flag 0x27B. The original post kind of addresses this but says that don't know where its used in game. This is used in game in Silph Co, when the player uses the card key to unblock the doors. Not sure why it doesn't just use setflag but yeah... |
I didn't actually want to revive this thread, but as it's the only one on fire red specials, I have to.
Does anyone know how specials 3D and 45 are used, during testing I have only got 0x3D to give a byte result of 01 00 and 0x45 to get a result of 69 9F. |
Quote:
3D checks if you only have one pokémon. if you have more, then you can do a double battle, so it returns 0 45 is gonna be used with special and not special2 (falls under 9F69 category) it likely writes its result to var 800X, X being a number from 0-D nonetheless yeah i know it says it writes its result to the given var but obvi it's not doing so for you |
| All times are GMT -8. The time now is 8:41 AM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.