• 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.

Dynamax & Max Raid Battles [Essentials v18.1]

YashPokeFan123

#PokeFan
283
Posts
3
Years
    • Seen Apr 28, 2023
    I know. But it's no big deal and maybe you should try to do it yourself.


    You're getting this error when you do what?

    I'm also get these error

    -------------------------
    Pokemon Essentials
    ---------------------------
    [Pokémon Essentials version 18.1.dev]

    Exception: NoMethodError

    Message: undefined method `[]=' for 0:Fixnum



    Backtrace:

    Dynamax Mechanics:1628:in `pbDynamaxTimer'

    Dynamax Mechanics:1620:in `eachBattler'

    PokeBattle_Battle:421:in `each'

    PokeBattle_Battle:421:in `eachBattler'

    Dynamax Mechanics:1639:in `pbDynamaxTimer'

    Battle_Phase_EndOfRound:698:in `__clauses__pbEndOfRoundPhase'

    PokeBattle_Clauses:40:in `pbEndOfRoundPhase'

    Battle_StartAndEnd:341:in `pbBattleLoop'

    Battle_StartAndEnd:341:in `logonerr'

    Battle_StartAndEnd:341:in `pbBattleLoop'



    This exception was logged in

    C:\Users\USERNAME\Saved Games\Pokemon Essentials\errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
    I'm getting this error
    and

    also this
    ---------------------------
    Pokemon Essentials
    ---------------------------
    [Pokémon Essentials version 18.1.dev]

    Exception: NoMethodError

    Message: undefined method `[]=' for 0:Fixnum



    Backtrace:

    Dynamax Mechanics:1194:in `pbRaidKOCounter'

    Dynamx Compability:202:in `pbFaint'

    Battler_UseMove:731:in `pbProcessMoveHit'

    Battler_UseMove:731:in `each'

    Battler_UseMove:731:in `pbProcessMoveHit'

    Battler_UseMove:437:in `pbUseMove'

    Battler_UseMove:429:in `each'

    Battler_UseMove:429:in `pbUseMove'

    Battler_UseMove:60:in `pbProcessTurn'

    Battler_UseMove:59:in `logonerr'



    This exception was logged in

    C:\Users\USERNAME\Saved Games\Pokemon Essentials\errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    I m new plz tell what to do i donot know
    Quit spamming.
    And no, I'm not coding your game. You need to learn to do stuff by yourself. If you're not ready to do some scripting by yourself, then you're not ready to make your game. I have already given you enough hints to figure out what to do.

    About your bugs though, this is a piece of code I gave you, so I'm helping you debug it.
    Replace the code that I gave you with:
    Code:
    def pbMaxRaidBattleSimple(species, lvl, gmax)
      # species = PBSpecies constant (of the form: PBSpecies::KABUTOPS for example)
      # lvl = Pokémon level (will be converted to a rank level).
      # gmax = boolean
      pbResetRaidSettings
      setBattleRule("canLose")
      setBattleRule("cannotRun")
      setBattleRule("noPartner")
      setBattleRule(sprintf("%dv%d",MAXRAID_SIZE,1))
      
      s = pbGetSpeciesFromFSpecies(species)
      f,g = pbGetMaxRaidForm(s[0],rand(10),nil,nil)
      
      $game_switches[MAXRAID_SWITCH] = true 
      $game_variables[MAXRAID_PKMN] = [s[0], f, g, lvl,gmax]
      pbWildBattleCore(species, lvl)
      pbResetBattle
      pbResetRaidSettings
      $PokemonTemp.clearBattleRules
      for i in $Trainer.party; i.heal; end
    end
     
    Last edited:
    8
    Posts
    3
    Years
  • Can you post the whole code of your drawPageFour function?
    def drawPageFour
    overlay = @sprites["overlay"].bitmap
    moveBase = Color.new(64,64,64)
    moveShadow = Color.new(176,176,176)
    ppBase = [moveBase, # More than 1/2 of total PP
    Color.new(248,192,0), # 1/2 of total PP or less
    Color.new(248,136,32), # 1/4 of total PP or less
    Color.new(248,72,72)] # Zero PP
    ppShadow = [moveShadow, # More than 1/2 of total PP
    Color.new(144,104,0), # 1/2 of total PP or less
    Color.new(144,72,24), # 1/4 of total PP or less
    Color.new(136,48,48)] # Zero PP
    @sprites["pokemon"].visible = true
    @sprites["pokeicon"].visible = false
    @sprites["itemicon"].visible = true
    textpos = []
    imagepos = []
    # Write move names, types and PP amounts for each known move
    yPos = 98
    for i in [email protected]
    [email protected]
    if move.id>0
    #=======================================================================
    # Dynamax - Draws Max Move names and types.
    #=======================================================================
    movelist = drawDynamaxMoveSel(move,yPos,moveBase,moveShadow,moveToLearn)
    imagepos.push(movelist[0])
    textpos.push(movelist[1])
    #=======================================================================
    if move.totalpp>0
    textpos.push([_INTL("PP"),342,yPos+32,0,moveBase,moveShadow])
    ppfraction = 0
    if move.pp==0; ppfraction = 3
    elsif move.pp*4<=move.totalpp; ppfraction = 2
    elsif move.pp*2<=move.totalpp; ppfraction = 1
    end
    textpos.push([sprintf("%d/%d",move.pp,move.totalpp),460,yPos+32,1,ppBase[ppfraction],ppShadow[ppfraction]])
    end
    else
    textpos.push(["-",316,yPos,0,moveBase,moveShadow])
    textpos.push(["--",442,yPos+32,1,moveBase,moveShadow])
    end
    yPos += 64
    end
    # Draw all text and images
    pbDrawTextPositions(overlay,textpos)
    pbDrawImagePositions(overlay,imagepos)
    end

    def drawSelectedMove(moveToLearn,moveid)
    # Draw all of page four, except selected move's details
    drawMoveSelection(moveToLearn)
    # Set various values
    overlay = @sprites["overlay"].bitmap
    base = Color.new(64,64,64)
    shadow = Color.new(176,176,176)
    @sprites["pokemon"].visible = false if @sprites["pokemon"]
    @sprites["pokeicon"].pokemon = @pokemon
    @sprites["pokeicon"].visible = true
    @sprites["itemicon"].visible = false if @sprites["itemicon"]
    # Get data for selected move
    moveData = pbGetMoveData(moveid)
    basedamage = moveData[MOVE_BASE_DAMAGE]
    category = moveData[MOVE_CATEGORY]
    accuracy = moveData[MOVE_ACCURACY]
    #===========================================================================
    # Dynamax - Displays Max Move data.
    #===========================================================================
    maxMoveData = pbGetMaxMoveData(moveToLearn,moveid)
    if maxMoveData
    basedamage = maxMoveData[0]
    accuracy = maxMoveData[1]
    moveid = maxMoveData[2]
    end
    #===========================================================================
    textpos = []
    # Write power and accuracy values for selected move
    if basedamage==0 # Status move
    textpos.push(["---",216,154,1,base,shadow])
    elsif basedamage==1 # Variable power move
    textpos.push(["???",216,154,1,base,shadow])
    else
    textpos.push([sprintf("%d",basedamage),216,154,1,base,shadow])
    end
    if accuracy==0
    textpos.push(["---",216,186,1,base,shadow])
    else
    textpos.push([sprintf("%d%",accuracy),216+overlay.text_size("%").width,186,1,base,shadow])
    end
    # Draw all text
    pbDrawTextPositions(overlay,textpos)
    # Draw selected move's damage category icon
    imagepos = [["Graphics/Pictures/category",166,124,0,category*28,64,28]]
    pbDrawImagePositions(overlay,imagepos)
    # Draw selected move's description
    drawTextEx(overlay,4,218,230,5,
    pbGetMessage(MessageTypes::MoveDescriptions,moveid),base,shadow)
    end

    def drawMoveSelection(moveToLearn)
    overlay = @sprites["overlay"].bitmap
    overlay.clear
    base = Color.new(248,248,248)
    shadow = Color.new(104,104,104)
    moveBase = Color.new(64,64,64)
    moveShadow = Color.new(176,176,176)
    ppBase = [moveBase, # More than 1/2 of total PP
    Color.new(248,192,0), # 1/2 of total PP or less
    Color.new(248,136,32), # 1/4 of total PP or less
    Color.new(248,72,72)] # Zero PP
    ppShadow = [moveShadow, # More than 1/2 of total PP
    Color.new(144,104,0), # 1/2 of total PP or less
    Color.new(144,72,24), # 1/4 of total PP or less
    Color.new(136,48,48)] # Zero PP
    # Set background image
    if moveToLearn!=0
    @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_learnmove")
    else
    @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_movedetail")
    end
    # Write various bits of text
    textpos = [
    [_INTL("MOVES"),26,16,0,base,shadow],
    [_INTL("CATEGORY"),20,122,0,base,shadow],
    [_INTL("POWER"),20,154,0,base,shadow],
    [_INTL("ACCURACY"),20,186,0,base,shadow]
    ]
    imagepos = []
    # Write move names, types and PP amounts for each known move
    yPos = 98
    yPos -= 76 if moveToLearn!=0
    for i in 0...5
    move = @pokemon.moves
    if i==4
    move = PBMove.new(moveToLearn) if moveToLearn!=0
    yPos += 20
    end
    if move && move.id>0
    #=======================================================================
    # Dynamax - Draws Max Move names and types.
    #=======================================================================
    movelist = drawDynamaxMoveSel(move,yPos,moveBase,moveShadow,moveToLearn)
    imagepos.push(movelist[0])
    textpos.push(movelist[1])
    #=======================================================================
    if move.totalpp>0
    textpos.push([_INTL("PP"),342,yPos+32,0,moveBase,moveShadow])
    ppfraction = 0
    if move.pp==0; ppfraction = 3
    elsif move.pp*4<=move.totalpp; ppfraction = 2
    elsif move.pp*2<=move.totalpp; ppfraction = 1
    end
    textpos.push([sprintf("%d/%d",move.pp,move.totalpp),460,yPos+32,1,ppBase[ppfraction],ppShadow[ppfraction]])
    end
    else
    textpos.push(["-",316,yPos,0,moveBase,moveShadow])
    textpos.push(["--",442,yPos+32,1,moveBase,moveShadow])
    end
    yPos += 64
    end
    # Draw all text and images
    pbDrawTextPositions(overlay,textpos)
    pbDrawImagePositions(overlay,imagepos)
    # Draw Pokémon's type icon(s)
    type1rect = Rect.new(0,@pokemon.type1*28,64,28)
    type2rect = Rect.new(0,@pokemon.type2*28,64,28)
    if @[email protected]
    overlay.blt(130,78,@typebitmap.bitmap,type1rect)
    else
    overlay.blt(96,78,@typebitmap.bitmap,type1rect)
    overlay.blt(166,78,@typebitmap.bitmap,type2rect)
    end
    end
     

    StCooler

    Mayst thou thy peace discover.
    9,301
    Posts
    4
    Years
    • Seen May 5, 2024
    <--CODE-->
    Please next time, put long pieces of code inside
    Spoiler:
     

    YashPokeFan123

    #PokeFan
    283
    Posts
    3
    Years
    • Seen Apr 28, 2023
    Quit spamming.
    And no, I'm not coding your game. You need to learn to do stuff by yourself. If you're not ready to do some scripting by yourself, then you're not ready to make your game. I have already given you enough hints to figure out what to do.

    About your bugs though, this is a piece of code I gave you, so I'm helping you debug it.
    Replace the code that I gave you with:
    Code:
    def pbMaxRaidBattleSimple(species, lvl, gmax)
      # species = PBSpecies constant (of the form: PBSpecies::KABUTOPS for example)
      # lvl = Pokémon level (will be converted to a rank level).
      # gmax = boolean
      pbResetRaidSettings
      setBattleRule("canLose")
      setBattleRule("cannotRun")
      setBattleRule("noPartner")
      setBattleRule(sprintf("%dv%d",MAXRAID_SIZE,1))
      
      s = pbGetSpeciesFromFSpecies(species)
      f,g = pbGetMaxRaidForm(s[0],rand(10),nil,nil)
      
      $game_switches[MAXRAID_SWITCH] = true 
      $game_variables[MAXRAID_PKMN] = [s[0], f, g, lvl,gmax]
      pbWildBattleCore(species, lvl)
      pbResetBattle
      pbResetRaidSettings
      $PokemonTemp.clearBattleRules
      for i in $Trainer.party; i.heal; end
    end

    Sorry I will not ask anything now.
     

    YashPokeFan123

    #PokeFan
    283
    Posts
    3
    Years
    • Seen Apr 28, 2023
    Quit spamming.
    And no, I'm not coding your game. You need to learn to do stuff by yourself. If you're not ready to do some scripting by yourself, then you're not ready to make your game. I have already given you enough hints to figure out what to do.

    About your bugs though, this is a piece of code I gave you, so I'm helping you debug it.
    Replace the code that I gave you with:
    Code:
    def pbMaxRaidBattleSimple(species, lvl, gmax)
      # species = PBSpecies constant (of the form: PBSpecies::KABUTOPS for example)
      # lvl = Pokémon level (will be converted to a rank level).
      # gmax = boolean
      pbResetRaidSettings
      setBattleRule("canLose")
      setBattleRule("cannotRun")
      setBattleRule("noPartner")
      setBattleRule(sprintf("%dv%d",MAXRAID_SIZE,1))
      
      s = pbGetSpeciesFromFSpecies(species)
      f,g = pbGetMaxRaidForm(s[0],rand(10),nil,nil)
      
      $game_switches[MAXRAID_SWITCH] = true 
      $game_variables[MAXRAID_PKMN] = [s[0], f, g, lvl,gmax]
      pbWildBattleCore(species, lvl)
      pbResetBattle
      pbResetRaidSettings
      $PokemonTemp.clearBattleRules
      for i in $Trainer.party; i.heal; end
    end

    Should it fix that two error
     
    8
    Posts
    3
    Years
  • Spoiler:
    Please next time, put long pieces of code inside
    Spoiler:
    Spoiler:
     

    Attachments

    • Dynamax & Max Raid Battles [Essentials v18.1]
      levl.png
      33.6 KB · Views: 12
    • Dynamax & Max Raid Battles [Essentials v18.1]
      move work.png
      35.3 KB · Views: 6
    1,408
    Posts
    10
    Years
    • Seen today
    well in debug mode i just removed all filters of max raid data base and while searching i found this do you have any idea about this

    Your Mega Slowbro form is most likely using form 1. The Dynamax script is designed assuming you're using the Gen 8 project, or v18.dev where Galarian Slowbro is form 1 instead, and Mega Slowbro is form 2. Swap these Slowbro forms in your PBS/graphics and you won't have this problem.

    This is actually my fault, since I labeled this thread as a v18.1 project, which it is. But for compatibility with Gen 8 content, I swapped the Slowbro forms.
     
    Back
    Top