• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Code: ASM Resource Thread

Blah

Free supporter
1,924
Posts
11
Years
  • In the games, "sales" for the big shopping stores can happen randomly. Guessing he may be trying to have some control over it.

    I don't think this needs any routines though. You could always create an NPC that sells you an item for a set price. Unless you make your own multichoicebox, it will only be able to sell one item type at a time. :s

    Oh I see, thanks for explaining to me. I don't play the new games, so half of these things I don't know/understand :P

    It could also be used to sell an item to the player that the player cannot sell back. I think it would be cool\handy\awesome. So I to request this.:P

    I'll put it on my todo-list.

    I know that part, but I meant can pokemon be stored there which the player does not have, or has not store in them??
    Such that when the game starts you can have a whole party stored in PSS & trade it for your starter pokemon at the beginning of the game?? or does it require you to have to manually store the pokemon in the PSS as a trainer??

    Oh. For that effect you would use the Party-swap addon I created for the PSS. Basically it lets you swap the player's party and the PSS. First you'd call the Party-swap routine then you would add the Pokemon you wanted to the Player's party (which would be the PSS's party) and finally call Party-Swap to swap the party and the PSS. It creates the same effect as giving the PSS Pokemon the player doesn't own.

    Ok FBI agent, I have some challenges you will enjoy

    1: the bike having 2 gears like in DPP

    2: a way to stop the player using running shoes in certain areas

    1) ugh, changing the speed is ez, but detecting the "b" keypress is going to be a pain I think

    2) Remove the running shoes and give them back, or make that place count as "indoors" in A-map

    I've got a suggestion.
    It would be interesting to lower the players speed in half, both while walking and running, while walking on specific tiles.
    Or better yet being able to control the speed, say speed in lowered slightly when walking in mud, puddles, or tall grass.
    Pokemon ORAS has a similar feature when you step in sand.

    This may go hand in hand with research done on the dual geared bikes if you choose to work on it.

    Hi, there's already a behaviour byte on A-Map to slow the player's speed. It's used on some stair tiles to create the illusion the player is climbing the stairs! :)


    Oh, wow, thank you so much for taking a shot at my stupidly complicated request! I'll definitely be using the routines you posted, which should be more than good enough for what I'm wanting to do :) so thanks again!

    I think with a bit of ingenuity and resourceful use of the PSS, I can get over the final hurdle, too – which is enabling steal events even when the player has a full party of six. (I just don't want to force people to be constantly heading back to the PC to dump their new Pokémon so that they don't miss out on an event. It always annoyed me when I had to do that in the official games, haha.) So, yeah, here's my idea…

    For a Snag Ball battle, I'd use countpokemon before starting the battle. Then, if the result is <5, I can just use your lovely routine as provided. :) If it's 0x6, though, I could activate the PSS intercept system to push any snagged Pokémon into the PSS.

    That done, I could take advantage of the fact that OTs can be modified in the overworld, and do that inside the PSS. Then (hopefully) I could push the Pokémon out of the PSS and into storage.

    This would circumvent the problem I currently have, which is that Pokémon snagged by a Snag Ball go straight into the PC without the correct OT attached (if the player has a party of six). It'd also work for givepokemon events, which I'd be using as 'steals' – I'd countpokemon first, then activate the intercept and do much the same thing as for the snagged monsters.

    So I just have a couple of questions, really:

    1) Does the PSS intercept routine work on the givepokemon command as well as with captures? (Also, how safe is the nicknaming bit of the intercept routine? I saw it was commented out...)
    2) Is there a way to push Pokémon from the PSS into PC storage space?

    Oh, and I'm assuming that renaming the OT of a Pokémon in the PSS would be as simple as using your existing overworld routine, but replacing this line:
    Code:
                    ldr r0, =(0x2024284)
    with this:
    Code:
                    ldr r0, =(0x203C001)
    My ASM knowledge is pretty much based on staring at your code in wonder and bemusement and painstakingly trying to figure out how the magic happens, though, so please feel free to correct me if I'm being stupid :P

    Thanks for the kind words. I VM'd you replies to all of that, and don't really want to retype them again. Check your VMs :D

    You may want to do more testing on this. I inserted it into my game and it's crashing every time I get into a battle.

    Thanks, report any bugs you encounter of any of the routines here.

    Can't you just remove the running shoes temporarily?

    yes, yes he can :P

    Please don't do that. Pokemon data is stored in 100 bytes for the party, but the Pokemon stored in the PC is a different matter. It only records 80 bytes of the structure. And if my 10 second glance at FBI's PSS routine didn't deceive me, FBI stored 80 bytes for each Pokemon, which means that if you just change that line, you are going to screw yourself over.

    You're right. I save 20 bytes of space because I'm using saveblock space which is very limited unfortunately :(

    FBI how about
    ...
    setvar 0x8000 0x85
    setvar 0x8001 0x1
    callasm 0x800001
    compare LASTRESULT 0x1
    if = goto @1
    ...

    what I want is the NPC will check if the player has eevee holding masterball, if it has it will jump to #org @1 and if it doesnt have it will jump to #org @2.. I dont understand how the game will check if I have eevee with well in fact it just set a var but nothing to compare with, like in flag, checkflag will check if the desired flag has been set.

    If you read the post, you'd know it returns 0x6 in variable 0x8000 if it failed to find an eevee with masterball. So you use
    Code:
    ...
    setvar 0x8000 0x85
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if == jump @noMatches
    ...

    For number one I mean to be able to have like a discount store, where items cost half their original price.

    The second one, I think I know to solve it ;)

    Yeah, I see. I'll look into that. The mart prices are rather static in the code, so maybe it's just a simple routine :x

    well duh! lol dont know why I ddnt just think of that :) thanks
    It's OK. Everyone has that kind of moment :P

    So I was going to not post until I had some content. Now I have content but answering people have taken up half a page. So I apologize moderators, but please let me double post. It's for the organisation of the first post :P
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Minute Routines Frame Structure


    This is very similar to my original Battle Modes routines. It's another frame structure routine. I was working on roaming and now swarming and encountered myself using this quite often. It's also the case that many people may need to access this kind of "minute executed" structure because there may be timed events and such you will need to hook out of the default routine!

    "But FBI, what about your Roaming Pokemon routine?" Good question, lad. I've updated that routine to work off of this as well. Optimizations which lead to expansion and custimization trigger my hacking sensation 10/10 rap.


    How to insert:

    First of all take a look at the orange text in the spoiler'd routine. The orange text needs to be modified to a pointer in the ROM which will be used as the table for all the routines which are called once every minute or upon the change of the minute. I would personally allot about 40 bytes of free space (that's enough for 10 routines).

    Once you've done that, compile the routine into free space.

    Spoiler:



    Now navigate to 0x548A8 and insert the following byte changes:
    Code:
    00 48 00 47 XX XX XX 08
    Where XX XX XX is where you inserted this routine +1 in reverse hex.

    Usage:

    This routine will run through all the pointers in the table you provided. It will keep going until it reaches FF FF FF FF with is read as the terminating pointer (i.e it stops reading pointers after that value is reached). So basically to add more routines into the list of executed routines, you would just append another pointer (in reverse hex +1) to your new routine's location. The actual calling and everything is done inside the game. I should and will also mention that this routine is called at the part where the game timer's Minute is updated.

    Even if you don't have minutes routines right now, I suggest you insert this one, because it will definitely come in useful for the near near future (I promise :P).


    Roaming Pokemon has also been updated to use this routine.
     

    Trainer 781

    Guest
    0
    Posts
    You may want to do more testing on this. I inserted it into my game and it's crashing every time I get into a battle.

    It working on my system. And this is your first insertion, so there might be some reasons why it got crashed
    1. Did you actually compile the code and create a .bin file corresponding to the .asm one.
    2. Did you replace XX XX XX in reverse hex? for example if at offset 720040 you placed the compiled routine XX XX XX should be replaced by 41 00 72.
     

    jAvAcOlA

    Banned
    152
    Posts
    15
    Years
    • Seen Feb 22, 2015
    2. Did you replace XX XX XX in reverse hex? for example if at offset 720040 you placed the compiled routine XX XX XX should be replaced by 41 00 72.


    Yep, there you go. My bad. I thought when people said "address" it referred to it NOT in reverse order, and when it should be reversed it was called a "pointer".
     

    El Diabeetus

    Amateur Voice Actor / ROM Editor ('Hacker')
    1,064
    Posts
    17
    Years
    • Age 30
    • Seen Jun 10, 2020
    Are forcing names for rivals and name extentions possible (so a few more character spaces for Pokémon/Trainers)?
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Swarming Pokemon


    Prerequisite routines needed:
    - Random number generator
    - Minute Routines Frame structure

    If I ever make a patch, I'll put it here. To reiterate, this is for FireRed only.



    Brief-ish Intro:


    Well, recently I've been finding myself writing routines for rather large projects as requests. This one was requested by MrDollSteak over IIRC and I accepted because I like what he's been doing with his ROM base :)

    I'm going to quickly describe the mechanics which I'm using for this swarming Pokemon port to FR.

    Like previous games, Pokémon Black 2 & White 2 have included a varierty of swarms. These swarms, like the past swarms, activate after you have received the National Dex, change each day at midnight and go through a random selection of possibilities. The focus of these swarms are Pokémon that don't normally exist within the Unova region and as such can only be obtained in the wild using this method

    In order to check the swarms, you need to enter a gate between two areas and look at the ticket going along on the back wall. It will mention that there is a swarm of Pokémon going on in that particular route. Go to that route and you'll find the Pokémon.

    Taken from: http://www.serebii.net/black2white2/swarms.shtml

    If you read the quote, you'd quickly understand that there's a few things that need to be done to keep this expandable, and practical like it is in BW 2. I couldn't find any articles of newer games, so I'm assuming this is the newest version.

    BW2 features:
    1) Pokemon swarm in specified routes only
    2) Pokemon swarm is time based
    3) Pokemon swarming is randomized

    Some features I've added:
    4) User can change the currently swarming Pokemon
    5) User can change map swarming Pokemon is swarming in
    6) Easy buffering of Name of Pokemon and Route it's swarming in
    7) Swarming Pokemon levels match route levels
    8) On/Off switch

    It's a long ride so stick get yourself some water, and a clean ROM so we can get started!


    Map name Buffering


    So this routine is very standalone, and way beyond useful for things besides just for just swarming. I was tempted to make it in a seperate post, but there's only so much double posting I can get away with. Basically what it does is it takes into variable 0x4081 and 0x4082 the map bank and map number respectively, and buffers into the string buffer in RAM the map's name. It's the routine I use to return the map name Pokemon are swarming in.

    Pre-insertion:

    This routine is a little special, because it needs a set up. We need to be able to derive map name from Map bank and map number (which are given in advance map). Unfortunately, there is no correlation between <Map Bank><Map Number> and <Map value>. Map value is used to transverse a name table, but using Bank and Number to do the same feat is impossible. The way you do it, is you use a table. The format of the table needs to be in the following format for all swarm-able maps.
    Code:
    <Map Bank (1 Byte)> <Map Number (1 byte)> <Map value (1 byte)>

    You: "But FBI making a table for all the maps is a lot of work :("
    Me: "Yes I know, but you're in luck because I did it for you! :D"

    Copy paste the following hex into a table free space (and write down the offset you've put it in).
    Code:
    03 00 58 03 01 59 03 02 5A 03 03 5B 03 04 5C 03 05 5D 03 06 5E 03 07 5F 03 08 60 03 09 61 03 0A 62 03 13 65 03 14 66 03 25 67 03 16 68 03 17 69 03 18 6A 03 19 6B 03 1A 6C 03 1B 6D 03 1C 6E 03 1D 6F 03 1E 70 03 1F 71 03 20 72 03 21 73 03 22 74 03 23 75 03 24 76 03 25 77 03 26 78 03 27 79 03 29 7A 03 2A 7B 03 2B 7C 03 2C 7D 01 00 7E 01 01 7F 01 04 80 01 1E 81 01 21 82 01 24 83 01 27 84 01 2A 85 01 2F 86 01 3B 87 01 3F 88 01 4B 89 01 51 8A 01 53 8B 01 58 8C 01 48 8D 01 5F 8E 03 0C 8F 03 0D 90 03 0E 91 03 0F 92 03 10 93 03 11 94 03 12 95 03 2D 96 03 2E 97 03 2F 98 03 30 99 03 31 9A 03 32 9B 03 33 9C 03 34 9D 03 35 9E 03 36 9F 03 37 A0 03 38 A1 03 39 A2 03 3A A3 03 3B A4 03 3C A5 03 3D A6 03 3E A7 03 3F A8 03 40 A9 03 41 AA 02 00 AE 01 60 AF 01 6D B0 01 6E B1 01 72 B2 02 01 B3 01 73 B4 02 12 B5 01 79 B6 01 7A B7 02 22 B9 02 23 BA 02 38 BB 02 1B BC 02 1C BD 02 1D BE 02 1E BF 02 1F C0 02 20 C1 02 21 C3 02 39 C4 00 00 C5 FF FF FF

    How to add more maps into the table:

    Spoiler:



    How to insert:

    Once you've got the hex table above in free space in your ROM, you're ready to insert the routine. But before we can do that, we need to fix a pointer in the routine to point to the table you just inserted. That pointer is in orange below. Remember the pointer is not in reverse hex and you do not add one to it. All you do is add the 0x8 prefix. So if I put my table at 0x750000, the pointer would simply before 0x8750000.

    After you've fixed the pointer compile and insert into free space.

    Spoiler:



    Usage:

    The routine assume that variable 0x4081 =Map Bank and that variable 0x4082 = Map number. Both in hex of course. It returns into the string buffer, which is at RAM location 0x2021D18. I'll include some sample scripts.

    PKSV:
    Spoiler:


    XSE:
    Spoiler:




    Setting up your Swarm Table


    Oh did you think we were done with tables? Nope! If you're a hacker, you'll come to love tables. They're used everywhere in the ROM, and honestly one of the best ways to organize like data structures. Anyways, the Swarm table is very easy to set up, so that's the good news.

    The table must follow the following format:
    Code:
    [Species (2 bytes)] [Map Bank (1 byte)] [Map Number (1 byte)]
    Where obviously, the Map Bank and Map Number are in hex, and as appears in Advance-Map. Before you set up your table, you need to make sure the address you're starting at it word aligned (so divisible by 4). The fast way to check this is to make sure the offset ends in a 0, 4, 8 or C. Keep count of how many entries that you've inserted into the table. Once you've finished with the table, take the number of entries in it and write to a byte somewhere how many entries there are. Keep track of the offset you've written the byte to (this offset is unrestricted, except that it needs to be in free space in the ROM!).

    Here's a sample table for a swarming Bulbasaur:
    Code:
    00800000: 01 00 03 00 FF FF FF ...
    00800100: 01 FF FF FF FF FF FF...
    So 01 00 is reverse hex for 00 01 which is equal to 0x1 which is Bulbasaur's species ID. The next two bytes, 03 00
    represent Map bank 03 and Map number 00, which of course is palette town. Make sure everything is in hex.

    Once you've finished making the table, you should have written pointers to the offsets for both the table and the byte which determined the length of the table. I'll refer to these as the Swarm table and the Swarm table length respectively from now on.



    Keeping the Swarm Random


    Before you can insert this routine, you first needed to have inserted the Random Number generator routine and the Minute Routines Frame structure. This routine uses them both! Alright, after all that table work, it's finally time to do some swarm work! This routine is rather simple, it's toggled by the flag 0x248. If flag 0x248 is set, then every X in-game minutes a new swarm will appear.

    How to insert:

    First of all there's some orange text in this routine that needs fixing. I've added instructions in the form of comments to tell you what each is. Once you've adjusted the orange text, then you can compile and insert the routine into free space.

    Spoiler:


    Finally, we need to make the routine become called by the Minute Routine caller. So go to where the Minute Routine caller's call table is and append " XX XX XX 08" where XX XX XX is the reverse hex pointer to where you just compiled this routine to +1.


    Usage:

    The routine is run automatically by the Minute Routine Framework! All you need to do is sit back, and get ready to insert the last routine! Yup, last!



    Encounter Swarm


    Finally, we've done all the insertions, now it's fine for the final piece of the puzzle. This routine handles the interception of a wild encounter to the swarming Pokemon. I've designed it to not conflict with the Roaming Pokemon routines, however, I've set swarming Pokemon as a lower Priority than Roaming. That means if there's a Pokemon Roaming the same map a swarm is happening, the encounter chance of the Roaming Pokemon is calculated first. If it fails to be encountered, then finally the swarming Pokemon's encounter gets a chance to roll!

    How to insert:

    This routine also uses the Random Number Generating routine I made, as well as a pointer to the Swarm Table. Open the routine below and fix the pointers in Orange to the right ones following the instructions given by the comments!

    Spoiler:


    Once you've fixed the orange text, you can compile the routine, and insert it into free space.

    Navigate to 0x82A2A and insert the following byte changes:
    Code:
    00 00 00 49 08 47 XX XX XX 08
    Where XX XX XX is the reverse hex pointer to where you just inserted this routine to +1.



    Overall Swarming System Usage


    I'm going to first explain how this system is used to achieve the features I claimed it to achieve. But before that, I need to explain a few resources I'm using.

    First of all there are 3 variables I'm using they are:

    0x4080 - Swarming Species ID
    0x4081 - Map Bank currently being swarmed
    0x4082 - Map Number currently being swarmed

    There is also Flag 0x248 which I'm using as a toggle. If the flag is set, the swarm system kicks in, otherwise the encounters are not modified and the game doesn't even run any of this code.

    1) Pokemon swarm in specified routes only
    This is achieved by the Swarm Table. You select a species and a route it swarms in. To make a species be able to swarm more than 1 route, you give it two entries in the table.

    2) Pokemon swarm is time based
    I'm using the Minute Routine framework I built to achieve this.

    3) Pokemon swarming is randomized
    I'm using the Random Number Generator routine I wrote to achieve this.

    Some features I've added:
    4) User can change the currently swarming Pokemon
    Variable 0x4080 = species. Set it to a species you want. Otherwise it's going to be randomly generated every X minutes.

    5) User can change map swarming Pokemon is swarming in
    Variables 0x4081 and 0x4082 control map bank and map number. Set them to your custom map to change the values.

    6) Easy buffering of Name of Pokemon and Route it's swarming in
    See the sample script I provided in the Map buffering section. To buffer the pokemon name:
    PKSV:
    ...
    storepokemon 0x0 0x4080
    msgbox @text
    callstd MSG_NORMAL
    ...
    = The swarming Pokemon is \v\h02

    XSE is the same thing but replace storepokemon with bufferpokemon and \v\h02 with [buffer1].

    7) Swarming Pokemon levels match route levels
    I hacked after the level had been generated. So we get to keep route levels!

    8) On/Off switch
    Flag 0x248 turns to whole system on or off.



    Demonstration:


     
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023
    Hello,
    I was wondering if you could help me with a few things.

    1.Bank System with Atm system
    Basically I have been trying to get this bank system to work for years.
    Summary- A Bank System with an account of course that with the activation of a flag can take the money the player wins in a battle and adds it to the account instead. And to add simple things like interest, the ability to withdraw and deposit set amounts...
    The Atm would work by getting a item which I am sure can all be done with XSE...
    Now I will pay you if you can do this Bank System for me and the community because I would like it to be public as well...This is what I really need to be able to Start my long time awaited Mod =(

    2.The ability to Lose a trainer battle and not be warped to a healing spot.
    Now I know that this can only be done in the beginning of the game when you first get challenged by your rival in Oaks lab.
    If you let the player lose the script will go back to lab an rival will start talking, if then you look at your pokemon they it will be fully healed...
    I tried for hours to get it to work with no avail =(
    I even asked for help and no one could help or just didn't want to... sadly

    3.Dawn Stone =(
    I have asked so many for this and I know a few have it but refuse to release it which is quite sad....

    4.Poke-rus,
    As fire red Does not have Poke-rus and the one I found really don't have good enough documentation for me to be able to follow how it works, nor are there any sample scripts...
    I would like it to use the RTC unless there is a better way...

    *Disregard any you have no interest in...

    5.New RTC and or updated version of primedialgas along with new DNS I find it can be very buggy =(

    6. Now this is much needed,
    But a new or updated "Fire Red Hacked Engine" (This might be stretching it I know >_<)

    7.Trainer Ability's,
    ergo attack boost, heal a % each turn, lower opponent accuracy ect..

    8.Building lights (On and Off) capabilities
    *I know its graphical but it is much needed by all

    9.Mega-Evolutions,
    Now I know you have Silent evolutions but I am still not sure how that even works...

    10.Pokemon Ability Tutor/Remover,
    Again not sure if can even be done.

    11.Working Fossil Reviver Routine
    Not sure if this can be done or not...

    12.Follow me routine
    This would make interesting Trainer battles as well...
    Trainers who could walk around and look for you possibly?
    I realize there is a thread just for this.... so I understand if not possible...

    13.Day and Night switching of wild pokemon with out breaking the map editor capabilities.

    14.Ability to make Shedinja's HP more than 1.
    I tried to change it with KarateKids tool with again no avail.
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen today
    That's awesome! The Pokemon is right. But there's still a problem that the scene of writing Pokedex data still showed the first Pokemonv of the trainer. (For example, I caught Gary's Squirtle but the Pokedex showed that I caught Pidgey. ) Did I miss anyting?
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • Will these codes will work in Checking party system
    Code:
    ...
    setvar 0x8000 0x85
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has
    setvar 0x8000 0x86
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has2
    setvar 0x8000 0x87
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has3
    setvar 0x8000 0x88
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has4
    ...

    All it does is check if one of the 4 pokemon is holding masterball, if yes, then it will continue to has script.?
     
    Last edited:
    416
    Posts
    11
    Years
    • Seen Feb 10, 2024

    Minute Routines Frame Structure


    Usage:

    This routine will run through all the pointers in the table you provided. It will keep going until it reaches FF FF FF FF with is read as the terminating pointer (i.e it stops reading pointers after that value is reached). So basically to add more routines into the list of executed routines, you would just append another pointer (in reverse hex +1) to your new routine's location.

    could we get a routine that simply adds 1 to a given var.
    and has a max number (also editible)

    so if the var == 500 it stops adding 1 and calls a script, but if var < 500 it adds 1 every minute.

    there would need to be a check, to make sure no other script or battle is running, if it is running itll wait for that event to end before calling the script

    the idea is we can make event happen every so many minutes. so if the var is set to 480, in 20 minutes an event will happen, and in that event the var will be set to say 470, so in 30 minutes another event will happen.

    maybe a phone call or a mini game ends or something.
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • Hello,
    I was wondering if you could help me with a few things.

    1.Bank System with Atm system
    Done 100% by script.

    2.The ability to Lose a trainer battle and not be warped to a healing spot.
    FBI has already made this look at OP.

    3.Dawn Stone =(
    Its just a new evolutionary stone. Follow some of the tutorials to add them in or check out Locksmitharmy's item editor that adds them for you.

    4.Poke-rus,
    Isnt that already a thing in Fire Red? Although I wouldn't know cause I've never played it.

    5.New RTC and or updated version of primedialgas along with new DNS I find it can be very buggy =(
    It is buggy but its not the only option.

    6.Now this is much needed,
    But a new or updated "Fire Red Hacked Engine" (This might be stretching it I know >_<)
    This isnt really needed as the current one works fairly well if you know how to use it.

    8.Building lights (On and Off) capabilities
    Use a time based event level script and do setmaptiles. Its time consuming and difficult but it doesnt require the need for asm.

    9.Mega-Evolutions,
    Read earlier post you would have read that this is already being worked on.

    11.Working Fossil Reviver Routine
    Done by script. Checkitem givepokemon. That simple.

    12.Follow me routine
    Done by touched. Read around.

    13.Day and Night switching of wild pokemon with out breaking the map editor capabilities.
    Wait till MEH is finished. It supports that.

    14.Ability to make Shedinja's HP more than 1.
    I feel like someone figured out how to do it but I cant remember who.

    Answers in qoute..
    Also maybe you should read around a little. Most of these have been answered in this topic alone.
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Hello,
    I was wondering if you could help me with a few things.

    1.Bank System with Atm system
    Basically I have been trying to get this bank system to work for years.
    Summary- A Bank System with an account of course that with the activation of a flag can take the money the player wins in a battle and adds it to the account instead. And to add simple things like interest, the ability to withdraw and deposit set amounts...
    The Atm would work by getting a item which I am sure can all be done with XSE...
    Now I will pay you if you can do this Bank System for me and the community because I would like it to be public as well...This is what I really need to be able to Start my long time awaited Mod =(

    This is a script. It's not an ASM routine at all, though admittedly, you can greatly enhance the current versions using a little bit of ASM tweaking (in terms of interest being given on a time basis). Ultimately it's a script though (and this is an ASM thread). Maybe I'll make an interest routine later on.


    2.The ability to Lose a trainer battle and not be warped to a healing spot.
    Now I know that this can only be done in the beginning of the game when you first get challenged by your rival in Oaks lab.
    If you let the player lose the script will go back to lab an rival will start talking, if then you look at your pokemon they it will be fully healed...
    I tried for hours to get it to work with no avail =(
    I even asked for help and no one could help or just didn't want to... sadly
    I've done this already. Look at the first post, it's called "Battle Modes add-on no Whiteout" or something similar to that :P

    3.Dawn Stone =(
    I have asked so many for this and I know a few have it but refuse to release it which is quite sad....
    Ask GoGo, he's got a working version apparently. Also, this isn't ASM? It's just creating a new evolution stone. There's tutorials right in this forum for achieving that :X

    4.Poke-rus,
    As fire red Does not have Poke-rus and the one I found really don't have good enough documentation for me to be able to follow how it works, nor are there any sample scripts...
    I would like it to use the RTC unless there is a better way...

    *Disregard any you have no interest in...
    There wouldn't be any sample scripts for PokeRus because it's interally done. There's literally a byte you flip on, and that controls the Pokerus stat. I will look into PokeRus in the near future, but not in conjunction with an RTC. I believe that RTCs do more bad to hack games than good. You should always use the ingame playtime for any and all of your timer needs.

    5.New RTC and or updated version of primedialgas along with new DNS I find it can be very buggy =(

    I don't know about his RTC. What I do know is that you shouldn't be using an RTC. Here's, in my opinion, the best D/N system ever:
    https://github.com/shinyquagsire23/Wizard-DN

    6. Now this is much needed,
    But a new or updated "Fire Red Hacked Engine" (This might be stretching it I know >_<)

    This was JPAN's best work. It took him many many months of work. There's no way I can just, go out and do it. I can however update some features and add other features which I've kinda done. I've upgraded (some by a lot) a few of his routines like backsprites, party routines, roaming and swarming all which he's done too.

    7.Trainer Ability's,
    ergo attack boost, heal a % each turn, lower opponent accuracy ect..

    This is a battle script and I said earlier that battle scripts are against my policy. I hear that MrDollSteak, HidoranBlaze and DoesntKnowHowToPlay are working on abilities. So if you want, maybe you can ask one of them.

    8.Building lights (On and Off) capabilities
    *I know its graphical but it is much needed by all

    There are scripting commands that do this. Check out my HM crusade link on the first post. It's one of the last posts in that thread.

    9.Mega-Evolutions,
    Now I know you have Silent evolutions but I am still not sure how that even works...

    daniilS has requested to let him finish megas. I'm going to let him finish, you can pester him about it. Though I'm not understanding why you don't know how silent evolutions work? I documented it pretty heavily while keeping it as easy to understand as possible. It's literally:
    - Look up next evolution
    - Set evolution
    - Negate Exp curve level gain/loss
    - Update stats

    10.Pokemon Ability Tutor/Remover,
    Again not sure if can even be done.
    I already made a routine which swaps around the Pokemon's base ability. Look for it in the first post!

    11.Working Fossil Reviver Routine
    Not sure if this can be done or not...
    This is just a check item script. It's really easy honestly. The game has a scripting solution for it too, there's no way for someone to not be able to expand that

    12.Follow me routine
    This would make interesting Trainer battles as well...
    Trainers who could walk around and look for you possibly?
    I realize there is a thread just for this.... so I understand if not possible...
    1) follow me is hard, and definitely not trivial
    2) there's an Advance Map option for making trainers wander around
    3) I'm not writing a new AI for wandering trainers if that's what you're asking

    13.Day and Night switching of wild pokemon with out breaking the map editor capabilities.
    This is going to be very specific for each D/N engine you're using. There's some that run off an RTC and a few that utilize the playtime. It's specific to each one. Though, D/N switching can be added by simply opening a hex editor and changing some bytes? Why do you want me to basically noob-ify a process that already isn't hard? It's not often when you're setting wild Pokemon, you set them once a map?

    14.Ability to make Shedinja's HP more than 1.
    I tried to change it with KarateKids tool with again no avail.
    Oh here's something that I can actually help with. iirc, there's specific code to keep it's HP at one. I'll look into it.


    That's awesome! The Pokemon is right. But there's still a problem that the scene of writing Pokedex data still showed the first Pokemonv of the trainer. (For example, I caught Gary's Squirtle but the Pokedex showed that I caught Pidgey. ) Did I miss anyting?

    Nope, doesn't look like you missed anything, it's a graphical bug. I didn't have this happen to me either. I'll take a look to see what's causing it later. Thanks.

    Will these codes will work in Checking party system
    Code:
    ...
    setvar 0x8000 0x85
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has
    setvar 0x8000 0x86
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has2
    setvar 0x8000 0x87
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has3
    setvar 0x8000 0x88
    setvar 0x8001 0x1
    callasm 0x800001
    compare 0x8000 0x6
    if 0x0 jump @has4
    ...

    All it does is check if one of the 4 pokemon is holding masterball, if yes, then it will continue to has script.?

    Lance, this isn't a script thread :/
    If you're having troubles there's an assembly/dissassembly help thread as well as a script help thread. Only ask here if you think you've encountered a bug or if the usage isn't specific enough. From a quick glance, I don't see anything wrong with that script, no.


    could we get a routine that simply adds 1 to a given var.
    and has a max number (also editible)

    so if the var == 500 it stops adding 1 and calls a script, but if var < 500 it adds 1 every minute.

    there would need to be a check, to make sure no other script or battle is running, if it is running itll wait for that event to end before calling the script

    the idea is we can make event happen every so many minutes. so if the var is set to 480, in 20 minutes an event will happen, and in that event the var will be set to say 470, so in 30 minutes another event will happen.

    maybe a phone call or a mini game ends or something.

    Sounds like a good idea. I'm going to have to check a few things to confirm the player isn't in battle and such. I'll work on this.
     
    199
    Posts
    12
    Years
    • Seen Jul 18, 2016
    I got an idea now.

    Item Limits!
    My idea is that you can only hold say...20 Potions, 15 Super Potions, 10 Max Potions and 5 Full Restores. If you come across an item that you already have maxed out it will show the typical "Too bad! Bag is full..." string. Also keep in mind that once you max out an item to the limit (default x99), a new stack will be created. We don't want that since it pretty much makes any changes pointless.

    I think it will be interesting to see how the game will be played when you can only carry a limited amount of items. :D
     
    Last edited:

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Adjusting Market Price by Percentage!


    So apparently a few people wanted this feature, and as I was making it I kinda saw use for it. So I stand corrected, this is actually a very useful and practical feature. I'm not going to explain the mechanics too much, but basically it hooks from the item price checker and modifies the item's price depending on variable 0x8000. Whether the modification is an increase or decrease depends on variable 0x8001. Well, without further delay lets get to it!


    How to insert:

    Compile and insert into free space the following routine:

    Spoiler:


    Now navigate to 0x9A914 and insert the following byte changes:
    Code:
    00 49 08 47 XX XX XX 08
    Where XX XX XX is the reverse hex pointer to this routine +1.

    Usage:

    The usage is straight forward. Basically it operates on a percentage increase or decrease system.

    Variable 0x8001 is used to toggle between increase and decrease. When variable 0x8001 is 0x0 the routine interprets it as an increase (anything except 0x0 is considered a decrease).

    Variable 0x8000 is the percent multiplier. You set 0x8000 to the amount you want the price to swing by (in hex) and multiplied by 100. For example:
    50% is 0.5, but we multiply that by 100 to get 50. Then converting 50 to hex yields 0x32. So setvar 0x8000 0x32 will sway the price by 50% in the direction noted by 0x8001.

    Flag 0x260: Toggler. It determines whether or not to activate the price swaying.

    If you're interested this is the formula I'm using: Price = (((Percent *100) *OriginalPrice) // 100) +/- OriginalPrice
    Where "//" is integer division.

    Picture of prices reduced by 10%
    iHpujA4.png


    Picture of prices increased by 10%
    DPX8JvV.png




    I got an idea now.

    Item Limits!
    My idea is that you can only hold say...20 Potions, 15 Super Potions, 10 Max Potions and 5 Full Restores. If you come across an item that you already have maxed out it will show the typical "Too bad! Bag is full..." string. Also keep in mind that once you max out an item to the limit (default x99), a new stack will be created. We don't want that since it pretty much makes any changes pointless.

    I think it will be interesting to see how the game will be played when you can only carry a limited amount of items. :D

    Well, actually this isn't as hard as you may think it is. In your script you can do a checkitem to check how many they have, and if they have too many you just say, "aww too bad". The only difficulties would be the mart checking if you have bag space...hmmm. I'm sure there's more cases of failure, but does anyone really max out their bags? I know I used to carry like 700 revives with me, but I think that's just me.
     
    Last edited:

    Zehn

    [color=red][font=Foto Serif]Sacred[/font][/color][
    988
    Posts
    9
    Years
  • Ok I know this will be partially a script but is it possible for there to be an NPC who will tells you where the pokemon is currently

    Basically this is an extension for the roaming pokemon thingy to make it easier to find.

    I also have some things I think you should implement into the roaming pokemon,
    1: after the set time, there is a 1/3 chance for the pokemon to move location
    2: when you fly to a location there is a 1/3 chance for the pokemon to move
    3: the same as above but with dig,teleport and escape ropes

    Also will the roaming pokemon still be a shiny if it moves? (If there is a way to make it a shiny, if not, there is another challenge
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Ok I know this will be partially a script but is it possible for there to be an NPC who will tells you where the pokemon is currently

    Basically this is an extension for the roaming pokemon thingy to make it easier to find.

    I also have some things I think you should implement into the roaming pokemon,
    1: after the set time, there is a 1/3 chance for the pokemon to move location
    2: when you fly to a location there is a 1/3 chance for the pokemon to move
    3: the same as above but with dig,teleport and escape ropes

    Also will the roaming pokemon still be a shiny if it moves? (If there is a way to make it a shiny, if not, there is another challenge

    For locating it, it's the same routine as map buffer which you'll need to use. You would need to do a little formulating, and you need to back up the old variable values. Here's how you do that in a script:

    Code:
    #dyn 0x740000
    #org @start
    lock
    faceplayer
    copyvar 0x8004 0x4081 '@ back up swarming map bank
    copyvar 0x8005 0x4082 '@ back up swarming map number
    copybyte  02023D066 0x4081 '@set variables to match roamer's details
    copybyte 0x2023D067 0x4082
    callasm 0x[Map name buffer] '@get map of roamer
    storetext 0x0 0x2021D18 '@in xse storetext = bufferstring
    copyvar 0x4081 0x8004 'restore variables we modified
    copyvar 0x4082 0x8005
    msgbox @roamMap
    callstd MSG_NORMAL
    release
    end
    
    #org @roamMap '\v\h02 = [buffer1] in xse
    = It's in \v\h02 now!

    1) They already move after time passes, the frequency of the movement is determined by the user
    2) EHHHHHHH, I'm too lazy. It's very simple, you place a hook at the fly routine, and then use the random number generator routine for the 1/3 thing and then just change the map details and return back. You can do it yourself since I told you how, right :D?
    3) same technique as 2.

    I'll maybe do something for sudden teleportation. I suppose it makes the chase harder, but it's already kinda hard since it always flees /:
     
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023
    This is a script. It's not an ASM routine at all, though admittedly, you can greatly enhance the current versions using a little bit of ASM tweaking (in terms of interest being given on a time basis). Ultimately it's a script though (and this is an ASM thread). Maybe I'll make an interest routine later on.



    I've done this already. Look at the first post, it's called "Battle Modes add-on no Whiteout" or something similar to that :P


    Ask GoGo, he's got a working version apparently. Also, this isn't ASM? It's just creating a new evolution stone. There's tutorials right in this forum for achieving that :X


    There wouldn't be any sample scripts for PokeRus because it's interally done. There's literally a byte you flip on, and that controls the Pokerus stat. I will look into PokeRus in the near future, but not in conjunction with an RTC. I believe that RTCs do more bad to hack games than good. You should always use the ingame playtime for any and all of your timer needs.



    I don't know about his RTC. What I do know is that you shouldn't be using an RTC. Here's, in my opinion, the best D/N system ever:
    https://github.com/shinyquagsire23/Wizard-DN



    This was JPAN's best work. It took him many many months of work. There's no way I can just, go out and do it. I can however update some features and add other features which I've kinda done. I've upgraded (some by a lot) a few of his routines like backsprites, party routines, roaming and swarming all which he's done too.



    This is a battle script and I said earlier that battle scripts are against my policy. I hear that MrDollSteak, HidoranBlaze and DoesntKnowHowToPlay are working on abilities. So if you want, maybe you can ask one of them.



    There are scripting commands that do this. Check out my HM crusade link on the first post. It's one of the last posts in that thread.



    daniilS has requested to let him finish megas. I'm going to let him finish, you can pester him about it. Though I'm not understanding why you don't know how silent evolutions work? I documented it pretty heavily while keeping it as easy to understand as possible. It's literally:
    - Look up next evolution
    - Set evolution
    - Negate Exp curve level gain/loss
    - Update stats


    I already made a routine which swaps around the Pokemon's base ability. Look for it in the first post!


    This is just a check item script. It's really easy honestly. The game has a scripting solution for it too, there's no way for someone to not be able to expand that


    1) follow me is hard, and definitely not trivial
    2) there's an Advance Map option for making trainers wander around
    3) I'm not writing a new AI for wandering trainers if that's what you're asking


    This is going to be very specific for each D/N engine you're using. There's some that run off an RTC and a few that utilize the playtime. It's specific to each one. Though, D/N switching can be added by simply opening a hex editor and changing some bytes? Why do you want me to basically noob-ify a process that already isn't hard? It's not often when you're setting wild Pokemon, you set them once a map?


    Oh here's something that I can actually help with. iirc, there's specific code to keep it's HP at one. I'll look into it.




    Nope, doesn't look like you missed anything, it's a graphical bug. I didn't have this happen to me either. I'll take a look to see what's causing it later. Thanks.



    Lance, this isn't a script thread :/
    If you're having troubles there's an assembly/dissassembly help thread as well as a script help thread. Only ask here if you think you've encountered a bug or if the usage isn't specific enough. From a quick glance, I don't see anything wrong with that script, no.




    Sounds like a good idea. I'm going to have to check a few things to confirm the player isn't in battle and such. I'll work on this.



    Thank you very much for your reply FBI Agent,
    Now I know that the majority of the Bank System is a script but the ASM that is needed is the ability to take the money the "player" wins in a battle and send it to the account in the bank...
    KarateKid was helping me with it but he has been quite busy so he hasn't been able to help me finish it...
    He is the one who told me I would need ASM to get this working.
    Bela has already given me some sample bank scripts so that is not really needed to be honest..

    I had a thread on PHO about the Bank System but for some reason PHO will not work on my browser... =(
    So I can't really go there and see if anyone has posted on my Thread...

    Also sorry for all the questions that had no relevance here...
    Don't mean to waste your time.

    I also Thank you for all the work you are doing...
    Much appreciated!!!
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Some stuffs ...
    I also Thank you for all the work you are doing...
    Much appreciated!!!
    Wow, you took that well. I was expecting you to be a little annoyed at me for practically butchering through most of your suggestions. I like people who understand. Here's something you'll enjoy :)


    Introducing ASM to your Bank scripts


    Bank scripts are normally very simple. There's a variable which holds the amount of money you have, normally holding $65, 535. Or if the scripter who wrote the script is good like I am, it'd become 999, 999, 999. Anyways, bragging aside, I made two routines to help improve your banking experience :P



    Adding Interest into your variable


    Before you can insert this, you need to have the Minute Routines Framework inserted.

    This is very specific to the bank variable you're using. I'll show you the routine first. There's some orange text for you to look at again. The first orange text is how often to add interest, 0x1 is every minute and 0x3b would be every hour. The second orange text is the amount you need to subtract from 0x4100 to reach your variable. Note, you bank variable should be in the range of 0x4011 - 0x40FF. If it's not you're using an unsafe variable and should change it to something.

    After you've fixed the orange text to match your bank script compile and insert into free space.

    Spoiler:


    After you've inserted this routine, append a pointer to it to the Minute Routine Framework table.

    Usage:

    No usage. Interest is added on a minute basis to your variable of choice (which should be deposited value).



    Battle Money Straight into a variable


    So this one is kind of specific, but I kinda felt like helping someone out so I did it. All it does is, intercept the money being given to the bag, and adds it to a given variable instead. It's toggled by flag 0x250.

    How to insert:

    Look at the orange text. Similar to the first routine, you will need to change the amount subtracted to match your variable (remember you're subtracting two hex numbers). Once you've fixed it, you can go ahead and compile the routine into free space (write down the place you compiled it to).

    Spoiler:


    Now navigate to 0x259EC and insert the following byte changes:
    Code:
     00 49 08 47 XX XX XX 08
    Where XX XX XX is the reverse hex pointer to where you inserted this routine +1.

    Usage:

    Flag 0x250 must be set for the routine to be toggled on, else money will be put in the player's bag as normal.
     
    Back
    Top