Game Development Your number one stop for anything related to creating games (except ROM hacks). You can even make your own!

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old January 29th, 2019 (4:36 PM).
LoneGamer's Avatar
LoneGamer LoneGamer is offline
     
    Join Date: Nov 2018
    Gender: Male
    Posts: 13
    Is there any way to have wild Pokémon, Trainers, and Gym Leaders scale with gym badges for like a open world type game?
    __________________
    Reply With Quote
      #2   Link to this post, but load the entire thread.  
    Old January 31st, 2019 (1:44 PM). Edited January 31st, 2019 by BadSamaritan.
    BadSamaritan BadSamaritan is offline
    Gone Fishin'
       
      Join Date: May 2009
      Gender: Male
      Nature: Rash
      Posts: 147
      https://www.pokecommunity.com/showthread.php?t=309204&highlight=happiness

      This thread gives you an example of how to do something similar, ableit only for trainer battles. Altering it to work with badges is pretty simple, but you first need to figure out how you want the formula to deduce to level.

      Personally I recommend looking at how badges influence the amount of money a player loses in battle, which you can find around line 3970 in the "PokeBattle_Battle" script.

      Edit: And for Wild Pokemon scaling, I believe I found a super simple fix for that. If you go into the script "PField_EncounterModifiers", right near the beginning you will see this code -

      Code:
      # Used in the random dungeon map.  Makes the levels of all wild Pokémon in that
      # map depend on the levels of Pokémon in the player's party.
      # This is a simple method, and can/should be modified to account for evolutions
      # and other such details.  Of course, you don't HAVE to use this code.
      Events.onWildPokemonCreate+=proc {|sender,e|
         pokemon=e[0]
         if $game_map.map_id==51
           newlevel=pbBalancedLevel($Trainer.party) - 4 + rand(5)   # For variety
           newlevel=1 if newlevel<1
           newlevel=PBExperience::MAXLEVEL if newlevel>PBExperience::MAXLEVEL
           pokemon.level=newlevel
           pokemon.calcStats
           pokemon.resetMoves
         end
      }
      As the explanation blurb before it indicates, this code automatically balances wild pokemon levels for maps marked as "random dungeons". So by simply removing the map id check from the code, it will run for all wild encounters. Your code should then look like so -

      Code:
      Events.onWildPokemonCreate+=proc {|sender,e|
         pokemon=e[0]
           newlevel=pbBalancedLevel($Trainer.party) - 4 + rand(5)   # For variety
           newlevel=1 if newlevel<1
           newlevel=PBExperience::MAXLEVEL if newlevel>PBExperience::MAXLEVEL
           pokemon.level=newlevel
           pokemon.calcStats
           pokemon.resetMoves
      }
      As you can see from the code, the function "pbBalancedLevel" is what's doing the work here as well as in the trainer battle example posted earlier. From a quick once over, it seems to work by finding the average level of your whole party. But once you figure out how you want your badge formula to work, you can define your own version such as a "pbBadgeLevel", and just plug that in its place.
      __________________

      Demo coming August 20!
      Reply With Quote
        #3   Link to this post, but load the entire thread.  
      Old 4 Weeks Ago (12:12 PM).
      LoneGamer's Avatar
      LoneGamer LoneGamer is offline
         
        Join Date: Nov 2018
        Gender: Male
        Posts: 13
        Hello im trying to add gym scaling in my game. Basically having it so trainers and gym leaders have there teams change depending on the amount of gym badges the player has. I have little experience in coding and need help or atleast a start to adding this feature. I any of you know how thanks in advanced!
        __________________
        Reply With Quote
          #4   Link to this post, but load the entire thread.  
        Old 4 Weeks Ago (12:51 PM).
        mgriffin's Avatar
        mgriffin mgriffin is offline
         
        Join Date: Apr 2014
        Posts: 304
        Moved your post here. Please don't create duplicate threads.
        Reply With Quote
          #5   Link to this post, but load the entire thread.  
        Old 4 Weeks Ago (1:01 PM).
        LoneGamer's Avatar
        LoneGamer LoneGamer is offline
           
          Join Date: Nov 2018
          Gender: Male
          Posts: 13
          Thank you so much i'm such a noob at coding its hilarious. I will give you credit! Have a great day!
          __________________
          Reply With Quote
            #6   Link to this post, but load the entire thread.  
          Old 4 Weeks Ago (3:25 PM).
          LoneGamer's Avatar
          LoneGamer LoneGamer is offline
             
            Join Date: Nov 2018
            Gender: Male
            Posts: 13
            Ok one more question. Can I make it so they have different teams depending on the amount of gym badges? Like if I challenge Brock and I have one badge he’ll use geodude and onix. But if I challenge him with 4 badges he’ll have gravaler, rhyhorn, and onix or Would I have to make a new script for that?
            __________________
            Reply With Quote
              #7   Link to this post, but load the entire thread.  
            Old 4 Weeks Ago (4:41 PM).
            NewAgeSteel NewAgeSteel is offline
               
              Join Date: Jan 2017
              Gender: Male
              Posts: 172
              Quote:
              Originally Posted by LoneGamer View Post
              Ok one more question. Can I make it so they have different teams depending on the amount of gym badges? Like if I challenge Brock and I have one badge he’ll use geodude and onix. But if I challenge him with 4 badges he’ll have gravaler, rhyhorn, and onix or Would I have to make a new script for that?
              It’s actually super simple. You don’t need to code anything just use conditional branches within the gym leader event. For each gym leader the player beats a switch should be turned on. For example a switch called “beat gym one” or “beat first gym” these are already in the list of essentials switches. Then you just do a conditional branch check for each badge. So conditional branch—->if switch beat gym one=ON
              Then use X-Team if switch beat gym two=ON then use Y-Team and so on.
              Reply With Quote
                #8   Link to this post, but load the entire thread.  
              Old 4 Weeks Ago (4:55 PM).
              LoneGamer's Avatar
              LoneGamer LoneGamer is offline
                 
                Join Date: Nov 2018
                Gender: Male
                Posts: 13
                Awesome thank you guys so much! Would this work for trainers?
                __________________
                Reply With Quote
                  #9   Link to this post, but load the entire thread.  
                Old 4 Weeks Ago (4:57 PM).
                NewAgeSteel NewAgeSteel is offline
                   
                  Join Date: Jan 2017
                  Gender: Male
                  Posts: 172
                  Quote:
                  Originally Posted by LoneGamer View Post
                  Awesome thank you guys so much! Would this work for trainers?
                  Yup! Keep in mind you’ll have to make a trainer for every scenario. Meaning you’ll have to make the same trainer 8 times essentially but with a more powerful team each time. But you’ll be applying the checks in the same exact way as the trainers. Same goes for the gym leaders you’ll be making 8 versions of each to cover the different points in your game depending on what order the player does the gyms in.
                  Reply With Quote
                    #10   Link to this post, but load the entire thread.  
                  Old 4 Weeks Ago (6:28 PM).
                  LoneGamer's Avatar
                  LoneGamer LoneGamer is offline
                     
                    Join Date: Nov 2018
                    Gender: Male
                    Posts: 13
                    Sweet this game may take awhile but it will be awesome.
                    __________________
                    Reply With Quote
                      #11   Link to this post, but load the entire thread.  
                    Old 4 Weeks Ago (6:46 AM).
                    LoneGamer's Avatar
                    LoneGamer LoneGamer is offline
                       
                      Join Date: Nov 2018
                      Gender: Male
                      Posts: 13
                      So if the player can challenge any gym in any order do i have to change the badges or their variables in anyway?
                      __________________
                      Reply With Quote
                        #12   Link to this post, but load the entire thread.  
                      Old 4 Weeks Ago (7:00 AM). Edited 4 Weeks Ago by NewAgeSteel.
                      NewAgeSteel NewAgeSteel is offline
                         
                        Join Date: Jan 2017
                        Gender: Male
                        Posts: 172
                        Quote:
                        Originally Posted by LoneGamer View Post
                        So if the player can challenge any gym in any order do i have to change the badges or their variables in anyway?
                        not exactly, but it depends on what you want to happen. Because you can have it set up where the badge you receive correlates with the switch youre checking at the start of the gym leader event. for example if you meet the condition of "beat fourth gym=ON" then within that conditional branch, youll turn on the switch "beat fifth gym" after the player wins. the only problem with that is I believe the gym badge icons may relate directly to the switch that's on? I may be wrong, you can test it out. but if that's the case and you were using something like the gen 1 gym leaders, then technically what could happen is you can battle misty as your fifth gym leader, but by then end the fifth gym beat switch will go on and youll receive the soul badge from koga. so the order of things may be a bit weird.


                        Now if you use a variable that may work better actually, because the gym leaders teams will be chosen by whatever count the variable is on, but at the end you can choose which switch gets turned on. so misty could be the fifth gym leader, and when you go to battle her, the variable counter will be on 4 by then, so itll use her team that's the fourth strongest, then at the end of the battle if you win, turn on the "beat second gym" switch, which will give you the right badge. then add +1 to your variable counter.
                        Reply With Quote
                          #13   Link to this post, but load the entire thread.  
                        Old 4 Weeks Ago (7:20 AM).
                        LoneGamer's Avatar
                        LoneGamer LoneGamer is offline
                           
                          Join Date: Nov 2018
                          Gender: Male
                          Posts: 13
                          I was going to make so you don’t see badges on your trainer card. Instead you receive them as key items for special side quests and events. That way the badges are in the order you got them and I won’t have to worry about the trainer card.
                          __________________
                          Reply With Quote
                            #14   Link to this post, but load the entire thread.  
                          Old 4 Weeks Ago (1:21 PM). Edited 4 Weeks Ago by NewAgeSteel.
                          NewAgeSteel NewAgeSteel is offline
                             
                            Join Date: Jan 2017
                            Gender: Male
                            Posts: 172
                            Quote:
                            Originally Posted by LoneGamer View Post
                            I was going to make so you don’t see badges on your trainer card. Instead you receive them as key items for special side quests and events. That way the badges are in the order you got them and I won’t have to worry about the trainer card.
                            honestly you shouldn't not do something just so you dont have to "worry about it". I mean you can edit the badge assignments to their proper switches anyways, and if youre trying to add them as key items to use them as checks for things later, then the gym badge switches already do that without you having to make an item for it. Also if its open world where you can get the badges in any order I would expect them to be out of order regardless. because each gym leader would have their own badge. It would also make sense if youre using old gym leaders like kanto or something that people know what badge belongs to who. so if you fought blaine people would expect his badge to be 7th and be the volcano badge. But at the same time I could see if you want people to have the badges in the order they got them. but either way that just comes down to changing the assigning of the icons to their switches.
                            Reply With Quote
                              #15   Link to this post, but load the entire thread.  
                            Old 4 Weeks Ago (5:08 PM).
                            komaoto's Avatar
                            komaoto komaoto is offline
                               
                              Join Date: Mar 2014
                              Location: Brazil
                              Gender: Male
                              Posts: 177
                              It's easier to make it with one variable instead of switches, because with a variable, you only have to keep track of how many badges the player has, while with switches you have to keep track of WHAT badges the player have at hand.
                              Defeat a gym and add 1 to a variable, no matter what gym. And than you make the gym team accordingly do your variable. With this, you don't even need to hide the trainer card.

                              I also agree to NewAgeSteel, it's much easier for keep progress from the trainer card. It's at least 1 less click the player has to use to access the badges (considering that the last thing they did in the bag was checking the badges). And you can also make key items along side to it, no need for a complete scrap them from the trainer card. Considering that they are our regular badges.
                              Reply With Quote
                                #16   Link to this post, but load the entire thread.  
                              Old 3 Weeks Ago (10:48 AM).
                              juliorain's Avatar
                              juliorain juliorain is online now
                               
                              Join Date: Aug 2016
                              Location: USA
                              Gender: Male
                              Nature: Quirky
                              Posts: 300
                              https://www.pokecommunity.com/showthread.php?t=409828

                              here you go ^.^
                              __________________
                              Reply With Quote
                                #17   Link to this post, but load the entire thread.  
                              Old 3 Weeks Ago (10:51 AM).
                              LoneGamer's Avatar
                              LoneGamer LoneGamer is offline
                                 
                                Join Date: Nov 2018
                                Gender: Male
                                Posts: 13
                                Ok I'll try this code and the keeping the badges on the trainer card thing. Thanks!
                                __________________
                                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
                                Ad Content
                                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:21 PM.