Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #426    
Old January 12th, 2014 (01:22 PM).
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
I have two more specials to add to the Emerald list.

Spoiler:
0x7 - Checks if you have a secret base. Puts 0x0 into LASTRESULT if no, and 0x1 if yes.
0x119 - Buffers the location of your secret base to [buffer1]


These are found in the script that handles the secret bases. You know, checking if you have Secret Power and actually making the base and such. In Emerald, the script is located at 2759F1. There's also a special 0x15 in there, but I'm not sure what that does. My best guess is that it reads the tile in front of you and stores a value in 0x8007. If so, that's how the script tells whether you're in front of an indent, a tree, or a bush that you can make a secret base in; it checks 0x8007 (nothing in the script seems to put any values there before they're checked, so I figured it must be the special) for a few values and then branches off into the different types of secret bases. Because I don't need to mess with that special, I'm not really doing any sort of experimentation with it. Maybe with some ingenuity, someone could hack it to read more values and give us more types of secret bases?
Reply With Quote
  #427    
Old January 14th, 2014 (02:26 PM).
GoGoJJTech's Avatar
GoGoJJTech
http://GoGoJJTech.com (WIP!)
Community Supporter
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Quote originally posted by Le pug:
Spoiler:
0x12E - not sure, but clicking once will do a sound warp to blackness but if you continuously click on the script it'll warp you to map 0.0 in the center location (X,Y)
0x8 - takes you to a secret base with a guy in it. Can warp back to original position.
0x9 - warps you to warp 0 on map 0.0
0xA - same as 0x9
0xD - deletes everything on your computer. Nah, jk. Idk what it does
0xE - brings up menu "Decorate, Put Away, Toss, Cancel"
0xF - message "There is no registry" then brings up menu "Decorate, Pack Up, Cancel"
0x18 - teleports you to X1, Y3 of the current map
0x1A - PC shut off sound and tile is set to something else
0x1B - "Please Wait ... ... B Button: Cancel Mixing Records..." followed by twinkling sound and the Mixing Records textbox doesn't go away. Kind of cool though cus you walk around with the message box up and if you go to a new location, it moves up and down with the sign in the top left corner telling you where you are.
0x1D - locks player in place (aka lock command)
0x1E - unlocks player in place (aka release command)
0x21 - "Please Wait ... ... B Button: Cancel" then battle with a level 4 Poochyena ... maybe saving the professor? Anyways, it'll save your progress then give you a communication error. epic troll special.
0x22 - "Please Wait ... ... B Button: Cancel" then message pops up after fade out saying "Communication standby ... please wait" then communication error
0x24 - brings up player info and Would you like to save? message. without a lock in your script, you can walk around with the message up.
0x27 - voodoo ritual where clones of you appear in a circle staring at each other.. usually one of them has a palette error
0x29 - deletes all pokemon in party unless its storing it to be retrieved by some variable or special
0x30 - turns all hidden sprites into soil sprite (sprite #60)
0x3A - same as #raw 0x56 aka it pops up a ! emote box above the player's head



0x1A Shuts down the PC and changes the tile from the lit up screen to the black screen. If you have a tileset that's not the PC tileset, it'll LOOK wrong, but it will be the correct tile. Do it in a PC.

0x21 This is a LINK BATTLE command. If there's nobody to link to (AKA using walk through walls to go to link maps) it'll do the last battle you've done since battle data isn't cleared. So I'm saying the last battle you did was the Poochyena battle. Most of the "communication failed" specials you listed are linking specials that DO work, but in specific conditions.
__________________
Reply With Quote
  #428    
Old January 19th, 2014 (07:46 PM).
Chaos Rush's Avatar
Chaos Rush
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
A common problem with many hacks that have edited the Town Map is that when checking the Town Map, you don't always appear at the right position. This is because the game looks at a table that determines the width and height of each map name when checking the Town Map.

The table is located at 0x3F2178. The format is very simple:
[WW] 00 [HH] 00

WW = Width
HH = Height

I've wrote out the offsets that will take you to the dimensions of the Kanto map locations:
3F2178 = PALLET TOWN
3F217C = VIRIDIAN CITY
3F2180 = PEWTER CITY
3F2184 = CERULEAN CITY
3F2188 = LAVENDER TOWN
3F218C = VERMILION CITY
3F2190 = CELADON CITY
3F2194 = FUCHSIA CITY
3F2198 = CINNABAR ISLAND
3F219C = INDIGO PLATEAU
3F21A0 = SAFFRON CITY
3F21A4 = ROUTE 4
3F21A8 = ROUTE 10
3F21AC = ROUTE 1
3F21B0 = ROUTE 2
3F21B4 = ROUTE 3
3F21B8 = ROUTE 4
3F21BC = ROUTE 5
3F21C0 = ROUTE 6
3F21C4 = ROUTE 7
3F21C8 = ROUTE 8
3F21CC = ROUTE 9
3F21D0 = ROUTE 10
3F21D4 = ROUTE 11
3F21D8 = ROUTE 12
3F21DC = ROUTE 13
3F21E0 = ROUTE 14
3F21E4 = ROUTE 15
3F21E8 = ROUTE 16
3F21EC = ROUTE 17
3F21F0 = ROUTE 18
3F21F4 = ROUTE 19
3F21F8 = ROUTE 20
3F21FC = ROUTE 21
3F2200 = ROUTE 22
3F2204 = ROUTE 23
3F2208 = ROUTE 24
3F220C = ROUTE 25
3F2210 = VIRIDIAN FOREST
3F2214 = MT. MOON
3F2218 = S.S. ANNE
3F221C = UNDERGROUND PATH
3F2220 = UNDERGROUND PATH
3F2224 = DIGLETT'S CAVE
3F2228 = VICTORY ROAD
3F222C = ROCKET HIDEOUT
3F2230 = SILPH CO.
3F2234 = POKéMON MANSION
3F2238 = SAFARI ZONE
3F223C = POKéMON LEAGUE
3F2240 = ROCK TUNNEL
3F2244 = SEAFOAM ISLANDS
3F2248 = POKéMON TOWER
3F224C = CERULEAN CAVE
3F2250 = POWER PLANT
(Sevii Islands continue on right after, I only wrote Kanto offsets because I'm lazy)

Now to demonstrate what I mean, let's say you're in Pallet Town.


At 0x3F2178, the offset for Pallet Town's dimensions (as well as the start of the whole table), we see the bytes 01 00 01 00. The first 01 simply means that on the Town Map, Pallet Town is only 01 tile high, and the second 01 simply means that on the Town Map, Pallet Town is only 01 tile wide.

Because of that, no matter where you are in Pallet Town, on the Town Map, you'll be limited to those dimensions:


Now lets change Pallet Town's Town Map width to 03. Simply change the byte at 0x3F2178 to 03. Now let's walk all the way to the right side of Pallet Town.


So we changed Pallet Town's Town Map width to 03, let's check the Town Map:

As you can see, it affects our visual position on the Town Map. This is because we altered Pallet Town's Town Map width to 03.

If we go to the middle of Pallet Town, then we get this:


And all the way to the left:


The same applies to height. This is how your position is controlled on the Town Map, as each Map name as a width and height associated with it.
__________________
Reply With Quote
  #429    
Old January 19th, 2014 (11:46 PM).
interdpth
I've seen things, man.
 
Join Date: Jul 2004
Quote originally posted by Chaos Rush:
A common problem with many hacks that have edited the Town Map is that when checking the Town Map, you don't always appear at the right position. This is because the game looks at a table that determines the width and height of each map name when checking the Town Map.

This is awesome, I'm going to use this for the world map editor. Any chance you can do it for Ruby? ;0

also, t-swizzle for dream girl
__________________
yes, this is doge.

potato is not here.

bye
Reply With Quote
  #430    
Old January 20th, 2014 (09:16 AM).
DoesntKnowHowToPlay's Avatar
DoesntKnowHowToPlay
some loser
 
Join Date: Jan 2012


There's a table at x45FD54 that controls the position of various elements during the item animation on a per-mon basis. Each entry is 5 bytes, and the first entry maps to Bulbasaur rather than 0x0. It looks like Unown does some funny business with this table as well.

0x0 = X position of TM right-ward from left edge of sprite
0x1 = Y position of TM downward from top edge of sprite
0x2 = How much Y position is modified when sprite is stretched (eg. start of TM animation, using a potion on a happy mon)
0x3 = X position of non-TM item
0x4 = Y position of non-TM item
__________________

Yet Another Fire Red Hack

Physical/Special Split
Reply With Quote
  #431    
Old January 26th, 2014 (08:20 PM).
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
Quick python script that's useful for debugging a map if you know it's header offset and don't feel like loading up advance map.

Sample output:
Code:
D:\User\Desktop>pkmap.py D:\User\Desktop\frcpy.gba 350618
Map@ 0x350618
flash_thing 0x0
type 0x1
music 0x12c
connection_header 0x835276c
2 connections @ 137701204
{'bank': 3, 'filler': 0, 'number': 19, 'offset': 0, 'type': 2}
{'bank': 3, 'filler': 0, 'number': 39, 'offset': 0, 'type': 1}
weather 0x2
event_data 0x83b4e50
show_label 0x0
index 0x4e
battle_type 0x0
map_scripts 0x816545a
map_data 0x82dd4c0
unknown 0x601
label 0x58

Recompiling:
b"\xc0\xd4-\x08PN;\x08ZT\x16\x08l'5\x08,\x01N\x00X\x00\x02\x01\x01\x06\x00\x00"
================================================================================
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #432    
Old February 1st, 2014 (08:24 AM).
Spherical Ice's Avatar
Spherical Ice
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
This is probably something you could find by yourself but it's nice to have it in one place I guess.

0xE991F8 - Trainer Card Tileset
0x3CC6F0 - Trainer Card Front Tilemap
0x3CC984 - Trainer Card Back Tilemap
0x3CCEC8 - Trainer Card Background Tilemap
0x3CD5E8 - Badges
0x3CC368 - Trainer Card Stickers
0xE99198 - Palettes (first is the Trainer Card itself (and the stickers? I think), then the background for males, then the background for females)
__________________
Reply With Quote
  #433    
Old February 3rd, 2014 (08:09 PM).
darkprince909
 
Join Date: May 2008
Gender:
Well I'm not sure how much of what I'm about to post isn't already known, but I couldn't find it, so here goes.

Spoiler:

The window on the far left is the VBA Disassembler in Ruby. Next to it is Fire Red. Top right is Fire Red in a Hex editor, below that is Ruby. All are pointed to the same snippet of code.


I think I isolated the routine for the tall grass in Pokemon Ruby by working backwards from the shared information in Fire Red (there was a post about making the tall grass work, and I started from those offsets). What I'm trying to do is change how the tall grass animation handles sprite priority (basically, make it behave just like the normal grass as far as layers are concerned by making both the player and the grass priority 2 instead of the player's body changing to 3)
Spoiler:

I got this far, but I'm stuck. I have no idea what to change, or how much to change, or what to change it to. I have limited experience working with HEX, and I never really looked at ASM until a few days ago.

I would imagine that I would need to change one value or so to make it behave like the normal grass (I still want the player to be forced to walk through it, and I can manage with the animation frames given, but I dont want the player disappearing behind the grass's roots). If anyone is interested in this problem, for purposes of eking out a bit more customization from the behaviors already found in the game, or just to help out a newbie who tried his best, I would greatly appreciate it.
Reply With Quote
  #434    
Old February 6th, 2014 (01:10 PM).
darkprince909
 
Join Date: May 2008
Gender:
Quote originally posted by Chaos Rush:
A common problem with many hacks that have edited the Town Map is that when checking the Town Map, you don't always appear at the right position. This is because the game looks at a table that determines the width and height of each map name when checking the Town Map.

The table is located at 0x3F2178. The format is very simple:
[WW] 00 [HH] 00

WW = Width
HH = Height

Spoiler:
I've wrote out the offsets that will take you to the dimensions of the Kanto map locations:
3F2178 = PALLET TOWN
3F217C = VIRIDIAN CITY
3F2180 = PEWTER CITY
3F2184 = CERULEAN CITY
3F2188 = LAVENDER TOWN
3F218C = VERMILION CITY
3F2190 = CELADON CITY
3F2194 = FUCHSIA CITY
3F2198 = CINNABAR ISLAND
3F219C = INDIGO PLATEAU
3F21A0 = SAFFRON CITY
3F21A4 = ROUTE 4
3F21A8 = ROUTE 10
3F21AC = ROUTE 1
3F21B0 = ROUTE 2
3F21B4 = ROUTE 3
3F21B8 = ROUTE 4
3F21BC = ROUTE 5
3F21C0 = ROUTE 6
3F21C4 = ROUTE 7
3F21C8 = ROUTE 8
3F21CC = ROUTE 9
3F21D0 = ROUTE 10
3F21D4 = ROUTE 11
3F21D8 = ROUTE 12
3F21DC = ROUTE 13
3F21E0 = ROUTE 14
3F21E4 = ROUTE 15
3F21E8 = ROUTE 16
3F21EC = ROUTE 17
3F21F0 = ROUTE 18
3F21F4 = ROUTE 19
3F21F8 = ROUTE 20
3F21FC = ROUTE 21
3F2200 = ROUTE 22
3F2204 = ROUTE 23
3F2208 = ROUTE 24
3F220C = ROUTE 25
3F2210 = VIRIDIAN FOREST
3F2214 = MT. MOON
3F2218 = S.S. ANNE
3F221C = UNDERGROUND PATH
3F2220 = UNDERGROUND PATH
3F2224 = DIGLETT'S CAVE
3F2228 = VICTORY ROAD
3F222C = ROCKET HIDEOUT
3F2230 = SILPH CO.
3F2234 = POKéMON MANSION
3F2238 = SAFARI ZONE
3F223C = POKéMON LEAGUE
3F2240 = ROCK TUNNEL
3F2244 = SEAFOAM ISLANDS
3F2248 = POKéMON TOWER
3F224C = CERULEAN CAVE
3F2250 = POWER PLANT
(Sevii Islands continue on right after, I only wrote Kanto offsets because I'm lazy)

Now to demonstrate what I mean, let's say you're in Pallet Town.


At 0x3F2178, the offset for Pallet Town's dimensions (as well as the start of the whole table), we see the bytes 01 00 01 00. The first 01 simply means that on the Town Map, Pallet Town is only 01 tile high, and the second 01 simply means that on the Town Map, Pallet Town is only 01 tile wide.

Because of that, no matter where you are in Pallet Town, on the Town Map, you'll be limited to those dimensions:


Now lets change Pallet Town's Town Map width to 03. Simply change the byte at 0x3F2178 to 03. Now let's walk all the way to the right side of Pallet Town.


So we changed Pallet Town's Town Map width to 03, let's check the Town Map:

As you can see, it affects our visual position on the Town Map. This is because we altered Pallet Town's Town Map width to 03.

If we go to the middle of Pallet Town, then we get this:


And all the way to the left:


The same applies to height. This is how your position is controlled on the Town Map, as each Map name as a width and height associated with it.
I'm pretty sure that functionality is built into AdvanceMap 1.92. I did that a couple weeks ago on my Ruby hack. Maybe it's different between RSE and FRLG, though. I'm not sure, and I'm at school so I can't check right now.

In AM, though, you pull up the world map editor, and on the right there's boxes for the width and height, close to where the position boxes are.
Reply With Quote
  #435    
Old February 6th, 2014 (01:12 PM).
GoGoJJTech's Avatar
GoGoJJTech
http://GoGoJJTech.com (WIP!)
Community Supporter
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Quote originally posted by darkprince909:
I'm pretty sure that functionality is built into AdvanceMap 1.92. I did that a couple weeks ago on my Ruby hack. Maybe it's different between RSE and FRLG, though. I'm not sure, and I'm at school so I can't check right now.

In AM, though, you pull up the world map editor, and on the right there's boxes for the width and height, close to where the position boxes are.
FRLG is more strongly built, so AMAP isn't supporting that. You usually had to make a map that fit kanto before
__________________
Reply With Quote
  #436    
Old February 6th, 2014 (08:07 PM).
Chaos Rush's Avatar
Chaos Rush
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
Quote originally posted by darkprince909:
I'm pretty sure that functionality is built into AdvanceMap 1.92. I did that a couple weeks ago on my Ruby hack. Maybe it's different between RSE and FRLG, though. I'm not sure, and I'm at school so I can't check right now.

In AM, though, you pull up the world map editor, and on the right there's boxes for the width and height, close to where the position boxes are.
The boxes for width and height is only there if you're hacking Ruby/Sapphire/Emerald. It's not there for FR/LG, so to edit the width/height you would have to refer to the offsets I posted earlier.
__________________
Reply With Quote
  #437    
Old February 7th, 2014 (05:39 AM).
kearnseyboy6's Avatar
kearnseyboy6
Aussie's Toughest Mudder
 
Join Date: Dec 2008
Finally no more trouble with OAK, GARY, HERO introduction sprite palettes!

They are 256 colours so when you look them up on a palette viewer you might find that OAKs palettes are stored in slots 7 and 8. This means you can have 32 colours for these sprites too!!

So all you have to go is into Infranview --> decrease colour depth to 32 --> Increase colour depth to 256. Next just move all colours into rows 7 and 8 and save and insert in NLZ-Advance as 256 colours (also make sure your transparent is at the first tile.. I forgot). Then simply hex edit find the palette in the ROM or APE and insert it! Wahla! No more glitchy greenish and red intro sprites!
__________________
HOLIDAYING CURRENTLY!!
Reply With Quote
  #438    
Old February 7th, 2014 (07:06 AM).
xGal's Avatar
xGal
Playing some ESL
 
Join Date: Nov 2011
Location: A tree
Gender: Male
Nature: Bold
The songtable format goes like this:
Code:
XX XX XX 08 YY 00 YY 00
XX XX XX = Pointer to the song
YY = 01 or 02. 01 results regular songs, but if you put 02, the song ingame will stop play if there is another sound (like PC sound, menu open sound, etc.).

Gamefreak used 01 for regular songs (like city/battle themes) and 02 for fanfares.
__________________
Hey guys, I made a soundcloud account not long ago, and I would be very happy if you guys will check it out: https://soundcloud.com/dewombat. Thanks .

Also, if you ever wanted to make a ROM hacking tool, click here: http://www.pokecommunity.com/showthread.php?t=334348
Reply With Quote
  #439    
Old February 7th, 2014 (12:22 PM).
GoGoJJTech's Avatar
GoGoJJTech
http://GoGoJJTech.com (WIP!)
Community Supporter
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Quote originally posted by xGal:
The songtable format goes like this:
Code:
XX XX XX 08 YY 00 YY 00
XX XX XX = Pointer to the song
YY = 01 or 02. 01 results regular songs, but if you put 02, the song ingame will stop play if there is another sound (like PC sound, menu open sound, etc.).

Gamefreak used 01 for regular songs (like city/battle themes) and 02 for fanfares.
This has been known since 2007 :D
03 is for other things too you know
__________________
Reply With Quote
  #440    
Old February 18th, 2014 (06:06 AM).
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Quote originally posted by DavidJCobb:
During my analysis of cmda6, I discovered that Game Freak implemented their own script-controlled walking ASM into the Advance-generation games. There can be up to eight subroutines to run on every frame of animation, only one of which may be active at any given time. You can select a subroutine to activate using cmda6.

At 0x03005090, there is a list of ASM functions to be executed on every frame of animation. Each entry in the list is a pointer to the routine, some metadata about the list item itself, and thirty-or-so bytes for the routine to work with (so that it may maintain its state).

When on the overworld, one of the items on this list is 0x0806E811, a walking routine manager. This routine manager will check one of the bytes in its execution-list-item (set by cmda6) and based on that byte, it will call one of eight walking subroutines.

Those subroutines in turn check the player's coordinates against stored values to see if the player has moved. If so, the subroutine processes player movement accordingly (check the tile they're standing on, change it if necessary, what have you).

There are eight slots for walking subroutines, and the defined subroutines (pointed to by pointers at 0x083A7310) are:
#0 at 0x0806E955: Nop
#1 at 0x0806EB55: Broken (R/S/E leftover: Route 113 ash-covered grass)
#2 at 0x0806E955: Nop
#3 at 0x0806E955: Nop
#4 at 0x0806E9E1: Icefall Cave ice tiles
#5 at 0x0806E955: Nop
#6 at 0x0806E955: Nop
#7 at 0x0806EC41: Broken (R/S/E leftover: Granite Cave/Sky Pillar broken floor tiles)

(The three defined subroutines basically change certain tiles out from under the player's feet. Theoretically, though, a subroutine can do anything it wants on every frame of animation that the overworld is being processed.)

What this means is that we now have an official way -- something that was designed for this use -- to set up our own custom-made ASM functions to run the very instant the player takes a step. If we keep the broken functions in the table, we can define up to four custom ASM subroutines; if we ditch those, we can define six.

(We could also repoint and extend the subroutine pointer table, and modify the related ASM code, thereby allowing up to 255 custom subroutines to be predefined and activated with cmda6.)

One possible use case for all of this would be an alternate (and more script-friendly) implementation of JPAN-style walking scripts, which would work without breaking other game functions (i.e. wild encounters in tall grass).

For more information, see the description for cmda6 in my FireRed script command reference.

Oh, something else: the R/S/E leftovers prove that this discovery applies to all Advance-generation games. The offsets will differ, and the walking subroutines will have some differences in R/S/E, but the system itself exists in all Pokemon GBA games.
I just had a thought while skimming through the older posts in this topic. Could this information be used to create phenomena? You know, the shaking grass and sky shadows and dark blue water featured in B2/W2?
Reply With Quote
  #441    
Old February 18th, 2014 (04:23 PM).
Merak's Avatar
Merak
Because reasons.
 
Join Date: Jul 2013
Age: 18
Gender: Male
Nature: Quiet
Quote originally posted by Deokishisu:
I just had a thought while skimming through the older posts in this topic. Could this information be used to create phenomena? You know, the shaking grass and sky shadows and dark blue water featured in B2/W2?


Hmm...
I think if enough was put into it, it could be possible. If I understand correctly, a routine could be created to use the RNG each step to give a chance of shaking grass, dark water, or the clouds. The routine would need to check if one such event is already active though. It would also need to reset after the player enters a battle or leaves the map, or other similar instances. Finally, it would need to check if the player is on the set tile and--if yes--generate a wild encounter or give an item.
Resetting after leaving a map wouldn't be a problem since I think it would most likely do that on its own. I don't know how a routine would check if an event is already going though, and I really don't have a clue how the RNG or whatnot work in the GBA pokemon games.


I know my input isn't much of a help, sorry.
__________________
"it is nearly 11 pm and we're discussing an alien eating the personification of humanity's evil desires
help"


Credit for the userbar goes to xVaporeon; credit for the avatar goes to Snakeyem12.
MY WRITING
Reply With Quote
  #442    
Old February 19th, 2014 (10:52 AM).
Spherical Ice's Avatar
Spherical Ice
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
playsong2 is supposed to be used in 0x3-type level scripts to automatically play the song specified instead of the song that map usually plays.

For example:

Code:
#dynamic 0x800000

'---------------
#org @start
compare 0x40C6 0x0
if 0x1 call @snippet1
end

'---------------
#org @snippet1
playsong2 0x15A
return
Would play the song 0x15A as soon as the map is loaded so long as 0x40C6 is set to 0x0, and, if it isn't, the song that is set to be the map's music on AMap will play as usual. playsong, on the other hand, would not work in this situation as there would be a couple of seconds of delay.

I dunno if I'm just really slow, but if others didn't know this then there's no harm in posting it. (Now that I think about it, this is probably obvious as movesprite2 is another command that's specifically for level scripts)
__________________
Reply With Quote
  #443    
Old February 19th, 2014 (06:43 PM).
Merak's Avatar
Merak
Because reasons.
 
Join Date: Jul 2013
Age: 18
Gender: Male
Nature: Quiet
Info on the scripting command "cry" here, about the effect.

Cry
0x0: normal.
0x1: normal but cut short.
0x2: higher pitch than normal.
0x3: higher pitch than normal, with a bit of echo, like pokemon on the overworld is roaring.
0x4: short reversed cry.
0x5: low cry
0x6: hard normal pitch cry, sort of like a roar.
0x7: short lower cry.
0x8: normal pitch but just a tiny bit short I think?
0x9: slightly lower than normal but not by much.
0xA: lower than the last one.
0xB: short lower.
0xC: short lower.
0xD:normal?
0xE:normal?
0xF: normal?


I just remembered I had this saved in a text file on my laptop. I'll have to re-test this though, I might have had a few of those wrong(the ones marked with ? at the end). Also gonna have to test and see if it could go past 0xF. I have a feeling that this may have something to do with certain bits being set, though I'm not too sure since I don't know about any routine behind this.
If anybody else has any info to add to this, then please do. Or if this has been covered already, let me know.
__________________
"it is nearly 11 pm and we're discussing an alien eating the personification of humanity's evil desires
help"


Credit for the userbar goes to xVaporeon; credit for the avatar goes to Snakeyem12.
MY WRITING
Reply With Quote
  #444    
Old February 20th, 2014 (03:55 PM).
Merak's Avatar
Merak
Because reasons.
 
Join Date: Jul 2013
Age: 18
Gender: Male
Nature: Quiet
Quote originally posted by Merak:




Hmm...
I think if enough was put into it, it could be possible. If I understand correctly, a routine could be created to use the RNG each step to give a chance of shaking grass, dark water, or the clouds. The routine would need to check if one such event is already active though. It would also need to reset after the player enters a battle or leaves the map, or other similar instances. Finally, it would need to check if the player is on the set tile and--if yes--generate a wild encounter or give an item.
Resetting after leaving a map wouldn't be a problem since I think it would most likely do that on its own. I don't know how a routine would check if an event is already going though, and I really don't have a clue how the RNG or whatnot work in the GBA pokemon games.


I know my input isn't much of a help, sorry.
Just had another thought. Using the same command and using ASM and all that, I think it could be possible to make it so that when the player walks, it plays a sound dependant on the type of tile they step onto, like in HG/SS. I don't know if its been done yet or if its been done another way or not, but I just thought it could be possible to do it using this info.
__________________
"it is nearly 11 pm and we're discussing an alien eating the personification of humanity's evil desires
help"


Credit for the userbar goes to xVaporeon; credit for the avatar goes to Snakeyem12.
MY WRITING
Reply With Quote
  #445    
Old February 20th, 2014 (04:26 PM).
GoGoJJTech's Avatar
GoGoJJTech
http://GoGoJJTech.com (WIP!)
Community Supporter
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
Quote originally posted by Merak:


Just had another thought. Using the same command and using ASM and all that, I think it could be possible to make it so that when the player walks, it plays a sound dependant on the type of tile they step onto, like in HG/SS. I don't know if its been done yet or if its been done another way or not, but I just thought it could be possible to do it using this info.
It has been done by tile behaviors and asm, (a mix of both) but I think it'd be easy
__________________
Reply With Quote
  #446    
Old February 21st, 2014 (04:56 AM).
Spherical Ice's Avatar
Spherical Ice
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
Quote originally posted by tajaros:
Ok, I found this over at the pokahacking forum and it seems to be useful for legendary events! So I did not discovered this credits to Steven and Casta for some Info about this.

So ever wanted to make your game like a movie or something like that. xD Well you can you can now make something look like this.



So how to do it huh? Pretty easy just put this in your script.

Ruby:


Fire red:


Emerald:


Just include them in every script that you want it only goes away after a warp to another place. That's all. :D

Credits:
Steven
Casta
Warping is not necessary to reset this; for FireRed, just use

Code:
writebytetooffset 0xff 0x4000044 
writebytetooffset 0x0 0x4000045
On that note, does anyone know if it is possible to reset the grayscale/sepia filters without warping?
__________________
Reply With Quote
  #447    
Old February 21st, 2014 (07:04 AM).
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote originally posted by Spherical Ice:
On that note, does anyone know if it is possible to reset the grayscale/sepia filters without warping?
for a full reload of palettes and blocksets call 08055148 (mapdata_load_assets_to_gpu_and_full_redraw)

if you only want to reload the palettes you can call 08059AD8 with the pointer to the mapdata-header in r0.
Code:
push {lr}
ldr r0, current_mapheader
ldr r0, [r0, #0]
bl 08059AD8
pop {pc}
.align 4
current_mapheader: .word 0x02036DFC
Code:
02036E28 = 0: normal colors
02036E28 = 1: grayscale
02036E28 = 2: sepia
(none of this was tested, can anyone confirm this?)
__________________
Firered IDA 6.5 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support
Reply With Quote
  #448    
Old February 21st, 2014 (07:34 AM).
Spherical Ice's Avatar
Spherical Ice
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
Quote originally posted by knizz:
for a full reload of palettes and blocksets call 08055148 (mapdata_load_assets_to_gpu_and_full_redraw)

if you only want to reload the palettes you can call 08059AD8 with the pointer to the mapdata-header in r0.
Code:
push {lr}
ldr r0, current_mapheader
ldr r0, [r0, #0]
bl 08059AD8
pop {pc}
.align 4
current_mapheader: .word 0x02036DFC
Code:
02036E28 = 0: normal colors
02036E28 = 1: grayscale
02036E28 = 2: sepia
(none of this was tested, can anyone confirm this?)
Hm, this still necessitates warping unless I'm doing something wrong.
__________________
Reply With Quote
  #449    
Old February 21st, 2014 (07:59 AM).
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote originally posted by Spherical Ice:
Hm, this still necessitates warping unless I'm doing something wrong.
Try calling 08070474 afterwards.
EDIT: calling 08055148 alone works for me.
__________________
Firered IDA 6.5 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support
Reply With Quote
  #450    
Old March 5th, 2014 (04:07 PM).
HidoranBlaze's Avatar
HidoranBlaze
 
Join Date: Apr 2013
Age: 18
Gender: Male
I was able to find the battle animation background table for Emerald.
The table starts at 0x525D54 and ends at 0x525E97. The structure is the same as FireRed's. We can now have custom battle animation backgrounds for Emerald as well by repointing and expanding this table.
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 12:23 PM.