Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Draconius GO
Reply
 
Thread Tools
  #1    
Old March 16th, 2011 (10:41 AM).
Luka S.J.'s Avatar
Luka S.J. Luka S.J. is offline
Jealous Croatian
     
    Join Date: Dec 2008
    Location: Croatia
    Age: 24
    Gender: Male
    Nature: Adamant
    Posts: 1,106
    Are you making your game with RMXP? Do you have loads of rebattles with the same trainer, where the trainer might have the same Pokemon, but they'd just be a different level? Or do you want to be able to rebattle a trainer, and have their Pokemon become stronger or weaker without creating a new PBS entry? There is a very simple solution for you, and it goes like this. Go to PokemonUtilities script and anywhere (outside a def of course) place the following code:
    Code:
    def pbLevelModifier(type,factor=nil)
      @levels=[]
      i=0
      ($Trainer.party.length).times do
        @levels.push($Trainer.party[i].level)
        i+=1
      end
      
      @[email protected]
      @sum=$Trainer.party[0].level
      
      i=1
      ($Trainer.party.length-1).times do
        @sum+=$Trainer.party[i].level
        i+=1
      end
      
      @[email protected]/($Trainer.party.length)
      
        if type=="max"
          [email protected]*factor
        elsif type=="avg"
          [email protected]
        end
      return level
    end
    The way you would use this is as follows: When creating a wild Pokemon Battle
    Code:
    pbWildBattle(species, pbLevelModifier(type,factor))
    Where type should either be "max" (to find the highest party level) or "avg" (to find the average party level). Quotation marks around the types are needed! The factor value has to be filled in if wanting to find the maximum level, whereby the max level would be multiplied by the factor percentage (where 0.01 is 1% and 1.00 is 100%)
    If you'd like to place it within trainer battles, you'll have to go into PokemonTrainers, and replace
    Code:
        level=poke[1]
    by
    Code:
    if $game_switches[X]==true
        level=pbLevelModifier(type,factor)
      else
        level=poke[1]
      end
    Where the switch X would be your trigger for level calculations. You can play around with the scripts to adjust it any way you want, but this is just a very basic method to return either the maximum level, or the average level.
    __________________

    Reply With Quote

    Relevant Advertising!

      #2    
    Old October 27th, 2012 (7:23 AM).
    Cilerba Cilerba is offline
    the hearts of lonely people
    • Silver Tier
     
    Join Date: Feb 2010
    Location: Massachusetts
    Age: 21
    Gender: Male
    Nature: Quiet
    Posts: 1,171
    Going to bump this because it's my fault this was never approved.
    __________________
    Reply With Quote
      #3    
    Old March 16th, 2014 (12:17 AM).
    mej71's Avatar
    mej71 mej71 is offline
    • Moderator
     
    Join Date: Mar 2014
    Location: Omnipresence
    Gender: Male
    Posts: 1,219
    Could you use this or something similar as a global modifier for all wild battles? I'm working on creating a pokemon game without a traditional storyline, so I'd really like to figure that out
    Reply With Quote
      #4    
    Old March 16th, 2014 (1:57 AM).
    PinkCatDragon's Avatar
    PinkCatDragon PinkCatDragon is offline
    The 17 year old programer. Now byte off
       
      Join Date: Dec 2009
      Location: 5cm meters from somthink with an IDE
      Gender: Female
      Nature: Calm
      Posts: 386
      hmm looking at the script it should be easy to add on to wild encounters its just finding the script its under is awkward
      Reply With Quote
        #5    
      Old March 16th, 2014 (11:54 AM).
      mej71's Avatar
      mej71 mej71 is offline
      • Moderator
       
      Join Date: Mar 2014
      Location: Omnipresence
      Gender: Male
      Posts: 1,219
      Figured it out, it actually wasn't that difficult. Just added this in PokemonEncoutersModifiers section

      Spoiler:
      Events.onWildPokemonCreate+=proc {|sender,e|
      pokemon=e[0]
      if $game_switches[100]
      pokemon.level=pbLevelModifier("max",1)
      pokemon.calcStats
      pokemon.resetMoves
      else
      level=poke[1]
      end
      }


      The only problem I'm having is that I can't put any number that isn't an integer in the (type,factor) section. Is that something that is fixable?
      Reply With Quote
        #6    
      Old March 18th, 2014 (2:43 PM).
      joeyhugg's Avatar
      joeyhugg joeyhugg is offline
         
        Join Date: Apr 2013
        Gender: Male
        Posts: 384
        I can't locate "level=poke[1]". I did a search with ctrl+shift+f and I didn't find anything.
        __________________
        This signature has been disabled.
        Signature exceeds height limit.
        Please review and fix the issues by reading the signature rules.

        You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

        Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
        Reply With Quote
          #7    
        Old March 19th, 2014 (4:00 AM).
        Luka S.J.'s Avatar
        Luka S.J. Luka S.J. is offline
        Jealous Croatian
           
          Join Date: Dec 2008
          Location: Croatia
          Age: 24
          Gender: Male
          Nature: Adamant
          Posts: 1,106
          Quote:
          Originally Posted by joeyhugg View Post
          I can't locate "level=poke[1]". I did a search with ctrl+shift+f and I didn't find anything.
          You do realize I've posted this in 2011. It may not correspond with today's Essentials.
          Reply With Quote
            #8    
          Old March 19th, 2014 (4:17 AM).
          venom12's Avatar
          venom12 venom12 is offline
          Pokemon Crystal Rain Relased
             
            Join Date: Sep 2006
            Age: 26
            Gender: Male
            Nature: Adamant
            Posts: 529
            Because now it is "level=poke[TPLEVEL]"
            Reply With Quote
              #9    
            Old March 19th, 2014 (4:03 PM).
            joeyhugg's Avatar
            joeyhugg joeyhugg is offline
               
              Join Date: Apr 2013
              Gender: Male
              Posts: 384
              The fact that it's outdated might help.
              ._.

              Anyway, thanks, Venom12! It worked perfectly!
              __________________
              This signature has been disabled.
              Signature exceeds height limit.
              Please review and fix the issues by reading the signature rules.

              You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

              Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
              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 11:37 AM.