Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old February 19th, 2014 (12:28 AM).
LocksmithArmy's Avatar
LocksmithArmy LocksmithArmy is offline
Mew!
     
    Join Date: Feb 2013
    Age: 28
    Gender: Male
    Posts: 415
    This short tutorial will teach you a nice script that will add an event into your Pokemon hack in which your player is tasked to defeat (or catch) stronger than normal Pokemon.

    This tutorial is written for FireRed but it can be easily altered to fit in any gen 3 game.

    What you will need:
    AdvanceMap
    PKSV (preferred, XSE will work but the scripts will need to be changed)
    A brain
    A little time
    Basic Knowledge on how to use AM and PKSV
    SHINYIZER (optioinal)

    Let us start with the person who gives the event...

    For the player to actually be tasked to fight these pokemon, he must talk to someone who needs them gone. In my hack I will be using a security guard that I have added all around Kanto.

    Simply use AMap to add your character to your hack... very simple... Im not even going to explain it, cause this is a Scripting tut not a Mapping tut. but I will give you pictures if it helps

    This mans script is very straight forward...
    simply copy and paste this code into PKSV and edit it to your liking.
    Spoiler:
    '--QUEST GIVER------------- (whoever gives the quest has this script)
    #dynamic 0x740000 ' any free space
    #org @start
    '--------------------------
    lock
    faceplayer
    checkflag 0x200 ' this flag is set once the quest has been given
    if true jump @started
    msgbox @hello
    callstd MSG_NOCLOSE
    setvar 0x4001 0x5 ' a variable must be set to tell how many pokemon there are
    Setvar 0x4002 0x1 ' this var activates the [S] tiles
    setflag 0x200 ' see, now the player cannot start the quest twice
    release
    end

    #org @started
    '-------------------------
    compare 0x4001 0x0 ' if the player beat all the pokemon
    if == jump @won
    storevar 0x0 0x4001 ' buffers the ammount left to \v\h02
    msgbox @playing
    callstd MSG_NOCLOSE
    release
    end

    #org @won
    '-------------------------
    checkflag 0x201 ' if this flag is set than the player already won
    if true jump @gotprize
    msgbox @giveprize
    callstd MSG_NOCLOSE
    textcolor GRAY
    checkitemspaceinbag GREATBALL 5 ' makes sure your bag isnt full
    compare LASTRESULT 0x0
    if == jump 0x81A6BF9 ' this says your bag is full...
    additem GREATBALL 0x5 ' you can give any prize/amount you like
    fanfare 0x101 ' happy song
    msgbox @item
    callstd MSG_NOCLOSE
    waitfanfare ' waits for song to end (short song)
    setflag 0x201 ' now player cannot get 2 prizes
    release
    end

    #org @gotprize
    '-------------------------
    msgbox @finished ' player sees this if they already got the prize
    callstd MSG_NOCLOSE
    release
    end

    '--- All of theses texts are just examples -----

    #org @hello
    = If you are going into MT. MOON,\nbe careful.\pThere are 5 powerful GOLBAT\non a rampage in there.\pIf you take care of them\nI will give you a good reward.

    #org @playing
    = There are still \v\h02 raging\nGOLBAT left to defeat.\pI am sure you can find\nthem all.

    #org @giveprize
    = Oh wow, you beat them all.\nYou are a very strong trainer\lindeed.\pPlease take these this as a reward.

    #org @item
    = You were given 5 GREATBALLs\nfor all your heard work.

    #org @finished
    = Thank you for clearing out those\nGOLBAT.

    *NOTE: ALL variables and flags must be changed to match YOUR hack layout*

    Basically, his main goal is to turn on the strong Pokemon you will be fighting later. and once they are all fought, he rewards you. all the text can be altered to your liking, including the reward item and everything else...

    NOW its time for... POKEMON.
    you cannot fight strong pokemon without having events for them... so agian, you are going to AMAP and adding your pokemon events... We will be using [S] tiles for this script...
    simply add 1 [S] per pokemon that you wish to have, and make the Var number = the var you used to activate the pokemon in the previous script (0x4002 in my example)

    The pokemons actual script should look like this: (in this example you will be fighting 5 Golbat)
    Spoiler:
    '--POKEMON---------------- (every pokemon gets this script)
    #org @pokestart# ' Each pokemon gets a DIFFERENT start script
    '-------------------------
    checkflag 0x202 ' Each pokemon needs a different flag
    if true jump 0x81A7AE0 ' if flag is set player cant fight again (jump @picker if using it)
    'setvar 0x8003 0x1 ' Use ONLY if you have SHINYIZER in your hack and want a shiny battle
    Call @battle ' A common battle can be used, or a unique one per pokemon
    setflag 0x202 ' flag is set if you won or caught pokemon
    subtractvar 0x409D 0x1 ' decreases the count of pokemon left to fight
    release
    end

    #org @battle ' (can be a different offset or the same one per pokemon)
    '-------------------------
    cry GOLBAT 0x2 ' Pokemon screams when player steps on [S] tile
    message @cry ' pokemon visually screams so player notices its not a normal battle
    showmsg
    waitcry ' waits to end sound
    pause 0x14 ' makes button mashers wait
    waitbutton ' makes non observant people read
    battle GOLBAT 22 NONE ' if using unique battles, this is what youd change
    setflag 0x807 ' some sort of fail check
    special BATTLE_PIXELLATE ' starts battle
    waitspecial ' makes sure battle ends before it continues
    clearflag 0x807 ' stops fail checker
    special2 LASTRESULT 0xB4 ' checks how battle ended
    compare LASTRESULT 0x4 ' if player ran...
    if == jump 0x81A7AE0 ' [S] tiles will still be active
    return

    #org @cry ' Cry can be anything you like
    = SCREEEE!


    now that wasnt too hard was it... you can change the pokemon and level of each battle, or use the same @battle offset and just change the flags for each battle. each one will count down... and when you hit 0, no more battles


    now lets talk about options and flexibility... You can do MANY different things with this script. What if you dont want the same pokemon to show up in the same spot every time. players could map it out and know exactly where to go to finish your quest easily. What if you want a 25% chance of finding the pokemon there so they may step on the tile 3 or 4 times before they get into the fight...

    Try this:
    Spoiler:
    #org @randomizer ' Use if you want a % chance of finding the pokemon on that [S] tile
    '-------------------------
    random 0x3 ' Alter number to alter the % (0x3 = 25%)
    compare lastresult 0x0
    if == jump @pokestart# ' use @picker if you want ordered battles
    release
    end


    Place this script in the [S] tile and your pokemon flag script (from above) would be in @pokestart#

    Now that makes the pokemon appear to not be in the same spot... what if you want them to face the pokemon in a specific order... maybe weaker pokemon first with a shiny at the end...

    check this one out:
    Spoiler:
    #org @picker ' player will battle event pokemon in a specific order
    '-------------------------
    compare 0x4001 0x5 ' this is your countdown var
    if == call @pokestart1
    compare 0x4001 0x4
    if == call @pokestart2
    compare 0x4001 0x3
    if == call @pokestart3
    compare 0x4001 0x2
    if == call @pokestart4
    compare 0x4001 0x1
    if == call @pokestart5 ' you can have as many as your countdown allows
    release
    end


    Now you can use both the above scripts to have a 25% (or whatever) chance of fighting your event pokemon in the order that you choose...

    but what if you cont care the order... what if you just want a percent chance of fighting any of your pokemon in any of your locations...
    you would use this script:
    Spoiler:
    #org @fullrandom ' % chance of battteling any event pokemon
    '-------------------------
    random 0x13 ' math = (n*x)-1 , n=number of pokemon x=%multiplier (4=25%) convert to hex
    compare last result 0x0
    if == jump @pokestart1
    compare last result 0x1
    if == jump @pokestart2
    compare last result 0x2
    if == jump @pokestart3
    compare last result 0x3
    if == jump @pokestart4
    compare last result 0x4
    if == jump @pokestart5
    release
    end


    If you think hard you can probably figure out how to be even more flexible with your scripts...

    for instance, make 10 nidoking battles using levels 40-50 that all count down the counter from 5, use the full random script and DONT give any of the battles flags, instead have them check if your countdown var is 0, if it is than jump to "release end" so there is no battle. place 15 [S] tiles all with the offset to your full random script. Now the player will fight 5 nidoking but their appearance rate and levels will be different, they may fight all 5 at level 48 adn higher, or all 5 at lower levels. they may walk over 3 [S] tiles and then fight on the next 2 [S] tiles in a row.

    the event could be a man giving rewards for feinting nidoking... and they arent 5 specific nidoking so levels can be randomized, he has a nidoking overpopulation problem. the possibilities are endless. This is not about making MY events, its an exercise in creativity. THINK, and make cool things happen in your hack.
    Attached Images
    File Type: jpg infront of varidian.JPG‎ (24.5 KB, 582 views) (Save to Dropbox)
    File Type: jpg by rock tunnel.JPG‎ (27.3 KB, 564 views) (Save to Dropbox)
    File Type: jpg by mt moon.JPG‎ (25.7 KB, 564 views) (Save to Dropbox)
    File Type: jpg varidian forest S tiles.JPG‎ (25.4 KB, 564 views) (Save to Dropbox)
    File Type: png golbat cry.png‎ (4.3 KB, 564 views) (Save to Dropbox)
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old March 6th, 2014 (7:22 AM).
    Dafting Dafting is offline
       
      Join Date: Feb 2013
      Gender: Male
      Posts: 5
      Loooooved this one. So easy and cool!

      Thanks!
      Reply With Quote
        #3    
      Old March 8th, 2014 (7:15 PM).
      Sniper's Avatar
      Sniper Sniper is offline
      ふゆかい
         
        Join Date: Nov 2013
        Location: Philippines
        Gender: Male
        Nature: Quiet
        Posts: 1,453
        Wow, good job on this one. Events are getting more x)
        __________________


        Reply With Quote
          #4    
        Old March 10th, 2014 (1:36 PM).
        Chaos_Darkrai's Avatar
        Chaos_Darkrai Chaos_Darkrai is offline
           
          Join Date: Apr 2012
          Gender: Male
          Posts: 284
          Hmm... Could the actual Battle Scripts, where you battle the Pokemon, be on different maps from each other? Because I was thinking about a semi-random Raikou, Entei, and Suicune encounter, right after Burned Tower? Would this work? With, like, no rewards, or something? This would be a great idea for a Johto hack, if it would work!
          __________________
          ░░░░░███████ ]▄▄▄▄▄▄▄▄
          ▂▄▅█████████▅▄▃▂
          Il███████████████████].
          ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤..

          If you're looking for a good time, or just want to chat, come over to Weloxux and I's channel at:
          http://mibbit.com/?server=irc.mibbit.net&channel=%23Dragons_Den

          Reply With Quote
            #5    
          Old March 10th, 2014 (1:56 PM).
          LocksmithArmy's Avatar
          LocksmithArmy LocksmithArmy is offline
          Mew!
             
            Join Date: Feb 2013
            Age: 28
            Gender: Male
            Posts: 415
            Quote:
            Originally Posted by 2012maniac View Post
            Hmm... Could the actual Battle Scripts, where you battle the Pokemon, be on different maps from each other? Because I was thinking about a semi-random Raikou, Entei, and Suicune encounter, right after Burned Tower? Would this work? With, like, no rewards, or something? This would be a great idea for a Johto hack, if it would work!
            Absolutely, there is no reason they need to be on a single map. Infact my Mt.Moon example, with the Golbats, has the battle scripts on the 3 different floors of Mt.Moon. As long as you set the var to turn them all on nomatter what map they are on, they will turn on.

            In that instance you would want to have 3 battles in the full random script, and each battle would need to set its flag if caught (or killed). its a great idea man. you can have as many battle [S] tiles as you want all sending the code to the full random script, then it would choose from the 3 battles (or a chance of not having one of the battles, however you wanna set it up), or if the battles have been won (caught or killed) it would skip em and choose from the remaining battles.

            genius idea for a johto hack
            __________________
            Reply With Quote
              #6    
            Old March 11th, 2014 (8:04 AM).
            Chaos_Darkrai's Avatar
            Chaos_Darkrai Chaos_Darkrai is offline
               
              Join Date: Apr 2012
              Gender: Male
              Posts: 284
              Quote:
              Originally Posted by LocksmithArmy View Post
              Absolutely, there is no reason they need to be on a single map. Infact my Mt.Moon example, with the Golbats, has the battle scripts on the 3 different floors of Mt.Moon. As long as you set the var to turn them all on nomatter what map they are on, they will turn on.

              In that instance you would want to have 3 battles in the full random script, and each battle would need to set its flag if caught (or killed). its a great idea man. you can have as many battle [S] tiles as you want all sending the code to the full random script, then it would choose from the 3 battles (or a chance of not having one of the battles, however you wanna set it up), or if the battles have been won (caught or killed) it would skip em and choose from the remaining battles.

              genius idea for a johto hack
              Thanks for the reply. If I ever make a Johto hack, this would be a great idea, you're right. That's why I thought of this.
              EDIT: How would this work for 3 different Pokemon? The random script? How would it choose from Raikou, Entei, or Suicune and not get the same battle twice? I know a flag would be set, but what about the other [S] tiles? how would it choose, say if you already caught Entei, how would it choose between Raikou and Suicune, and not Entei again? Could you possibly show what that script(s) would look like? Thanks!
              __________________
              ░░░░░███████ ]▄▄▄▄▄▄▄▄
              ▂▄▅█████████▅▄▃▂
              Il███████████████████].
              ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤..

              If you're looking for a good time, or just want to chat, come over to Weloxux and I's channel at:
              http://mibbit.com/?server=irc.mibbit.net&channel=%23Dragons_Den

              Reply With Quote
                #7    
              Old April 8th, 2014 (2:22 PM).
              TheRealDylanator's Avatar
              TheRealDylanator TheRealDylanator is offline
                 
                Join Date: Apr 2014
                Location: Scotland
                Gender: Male
                Nature: Quirky
                Posts: 37
                Great, in my upcoming hacks this will be very great to know.
                __________________
                I have nothing of interest to put here.
                Reply With Quote
                  #8    
                Old April 8th, 2014 (2:52 PM).
                LocksmithArmy's Avatar
                LocksmithArmy LocksmithArmy is offline
                Mew!
                   
                  Join Date: Feb 2013
                  Age: 28
                  Gender: Male
                  Posts: 415
                  Quote:
                  Originally Posted by 2012maniac View Post
                  EDIT: How would this work for 3 different Pokemon? The random script? How would it choose from Raikou, Entei, or Suicune and not get the same battle twice? I know a flag would be set, but what about the other [S] tiles? how would it choose, say if you already caught Entei, how would it choose between Raikou and Suicune, and not Entei again? Could you possibly show what that script(s) would look like? Thanks!
                  just got your edit (sorry i dont get email notifications for edits...

                  it would take a little more work to make a script like that. for instance: (wrote in psudo code, not real code)
                  after player catches entei a flag is set
                  in the full random code, if it lands on Enteis number,, it checks that flag,
                  if that flag is set, it jumps to the full random script again. to try again...
                  OR
                  if that flag is set it jumps to a release end code

                  Spoiler:

                  #org @fullrandom ' % chance of battteling any event pokemon
                  '-------------------------
                  random 0x1D ' math = (n*x)-1 , n=number of pokemon x=%multiplier (10=10%) convert to hex
                  compare last result 0x0
                  if == jump @Entei
                  compare last result 0x1
                  if == jump @Raikou
                  compare last result 0x2
                  if == jump @Suicune
                  release
                  end

                  #org @Entei# ' Each pokemon gets a DIFFERENT start script
                  '-------------------------
                  checkflag 0x202 ' Each pokemon needs a different flag
                  if true jump @fullrandom ' if flag is set player cant fight again

                  'setvar 0x8003 0x1 ' Use ONLY if you have SHINYIZER in your hack and want a shiny battle
                  cry ENTEI 0x2 ' Pokemon screams when player steps on [S] tile Change pokename for different battles
                  message @cry ' pokemon visually screams so player notices its not a normal battle
                  showmsg
                  waitcry ' waits to end sound
                  pause 0x14 ' makes button mashers wait
                  waitbutton ' makes non observant people read
                  battle ENTEI 45 NONE ' This is what you would change for other 2 battles
                  setflag 0x807 ' some sort of fail check
                  special BATTLE_PIXELLATE ' starts battle
                  waitspecial ' makes sure battle ends before it continues
                  clearflag 0x807 ' stops fail checker
                  special2 LASTRESULT 0xB4 ' checks how battle ended
                  compare LESULT 0x4 ' if player ran...
                  if == jump 0x81A7AE0 ' [S] tiles will still be active
                  setflag 0x202 ' flag is set if you won or caught pokemon
                  release
                  end

                  #org @cry ' Cry can be anything you like
                  = ROAR!


                  Its exactly the code from before, I bolded the important parts to show why it works...

                  after defeating entei, a flag is set
                  at the beginning of the entei script, that flag is checked
                  if that flag is set, it jumps back to the randomizer

                  NOTE
                  If you are forcing a battle (instead of giving a battle chance) you would want the "if flag is true" to jump to 0x81A7AE0 so it wont try and cycle through the 3 battles forever, never finding an end.

                  If you are using full random, the percent chance has MANY release end numbers (only 3 of 30 end in a battle) so it is not necessary to jump to 0x81A7AE0 you can just have it try again.
                  __________________
                  Reply With Quote
                    #9    
                  Old April 9th, 2014 (2:21 AM).
                  TheRealDylanator's Avatar
                  TheRealDylanator TheRealDylanator is offline
                     
                    Join Date: Apr 2014
                    Location: Scotland
                    Gender: Male
                    Nature: Quirky
                    Posts: 37
                    Would this work if I put a pokemon in the overworld as the one you need to battle or is that different, and would it be easier or more difficult. (Probably more difficult.)
                    __________________
                    I have nothing of interest to put here.
                    Reply With Quote
                      #10    
                    Old April 9th, 2014 (4:31 AM).
                    LocksmithArmy's Avatar
                    LocksmithArmy LocksmithArmy is offline
                    Mew!
                       
                      Join Date: Feb 2013
                      Age: 28
                      Gender: Male
                      Posts: 415
                      Quote:
                      Originally Posted by TheRealDylanator View Post
                      Would this work if I put a pokemon in the overworld as the one you need to battle or is that different, and would it be easier or more difficult. (Probably more difficult.)
                      You would use person events instead of [S] tiles... and the flag that is set after battle would need to be the person ID... other than that it should work...
                      __________________
                      Reply With Quote
                      Reply

                      Quick Reply

                      Join the conversation!

                      Create an account to post a reply in this thread, participate in other discussions, and more!

                      Create a PokéCommunity Account

                      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

                      Forum Jump


                      All times are GMT -8. The time now is 8:59 PM.