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

[Essentials Tutorial] Team Preview

FL

Pokémon Island Creator
2,452
Posts
13
Years
    • Seen today
    This tutorial explains how show the enemy's Poke Balls before taking the next Pokémon. Note that this isn't identical to original games. Tested on v13 and v17.2.

    In PokeBattle_ActualScene

    Change line:
    Code:
    @sprites["partybarplayer"].x-=16
    to
    Code:
    @sprites["partybarplayer"].x-=16 if @sprites["partybarplayer"]

    Change line:
    Code:
    @sprites["partybarplayer"].x=PokeBattle_SceneConstants::PLAYERPARTYBAR_X

    to

    Code:
    @sprites["partybarplayer"].x=PokeBattle_SceneConstants::PLAYERPARTYBAR_X if @sprites["partybarplayer"]

    Before line:

    Code:
    @sprites["enemy#{i}"].z=41

    Add:

    Code:
    @sprites["enemy#{i}"].y-=72 if @doublePreviewTop

    Change line:

    Code:
    @sprites["player#{i}"].x-=ballmovedist

    to

    Code:
    @sprites["player#{i}"].x-=ballmovedist if @sprites["partybarplayer"]

    Before line:

    Code:
    def partyAnimationUpdate

    Add:

    Code:
    def partyAnimationRestart(doublePreviewTop)
      @doublePreviewTop=doublePreviewTop
      yvalue=114
      yvalue-=72 if doublePreviewTop
      pbAddSprite("partybarfoe",-400,yvalue,"Graphics/Pictures/battleLineup",@viewport)
      @sprites["partybarfoe"].visible=true
      @partyAnimPhase=0
    end 
    
    def partyAnimationFade
      frame=0
      while(frame<24)
        if @partyAnimPhase!=3
          pbGraphicsUpdate
          next
        end
        frame+=1
        @sprites["partybarfoe"].x+=8
        @sprites["partybarfoe"].opacity-=12
        for i in 0...6
          partyI = i
          @sprites["enemy#{partyI}"].opacity-=12
          @sprites["enemy#{partyI}"].x+=8 if frame >= i*4
        end
        pbGraphicsUpdate
      end
      for i in 0...6
        partyI = i
        pbDisposeSprite(@sprites,"player#{partyI}")
      end
      pbDisposeSprite(@sprites,"partybarfoe")
    end

    In PokeBattle_Battle

    After line:

    Code:
    opponent=pbGetOwner(index)

    Add line

    Code:
    @scene.partyAnimationRestart(index==1 && @doublebattle) if index != 2

    Change:

    Code:
    end
    pbRecallAndReplace(index,newenemy,newenemyname,false,false)

    to

    Code:
    else
      # You can change the time delay for double/Set Option here
      timedelay=64 # Set Option
      timedelay=96 if @doublebattle
      for i in 0...timedelay
        @scene.pbGraphicsUpdate
      end
    end
    @scene.partyAnimationFade if index!=2
    pbRecallAndReplace(index,newenemy,newenemyname,false,false)
     

    Attachments

    • screen.png
      screen.png
      7 KB · Views: 360
    Last edited:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Basic and essential for people that want to make a game like official one (like me lol). Thanks for share!
     
    39
    Posts
    8
    Years
    • Seen today
    Trying the script, but line @scene.partyAnimationRestart(index==1 && @doublebattle) if index != 2 throws me syntax error. I'm using v17.2.
     

    FL

    Pokémon Island Creator
    2,452
    Posts
    13
    Years
    • Seen today
    Trying the script, but line @scene.partyAnimationRestart(index==1 && @doublebattle) if index != 2 throws me syntax error. I'm using v17.2.
    Tutorial fixed! For some reason, when I copied/pasted, there were two typos on code.
     

    XVR

    14
    Posts
    3
    Years
    • Seen Feb 27, 2024
    I've followed the tutorial step by step, but I got an error:

    Code:
    ---------------------------
    [Pokémon Essentials version 17.2]
    
    Exception: NoMethodError
    
    Message: undefined method `x' for nil:NilClass
    
    PokeBattle_Scene:1805:in `partyAnimationUpdate'
    
    PokeBattle_Scene:1426:in `pbGraphicsUpdate'
    
    PokeBattle_Battle:1439:in `pbSwitch'
    
    PokeBattle_Battle:1438:in `each'
    
    PokeBattle_Battle:1438:in `pbSwitch'
    
    PokeBattle_Battle:1405:in `each'
    
    PokeBattle_Battle:1405:in `pbSwitch'
    
    PokeBattle_Battle:4310:in `__clauses__pbEndOfRoundPhase'
    
    PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
    
    PokeBattle_Battle:2778:in `pbStartBattleCore'
    ---------------------------

    The line which the error comes from looks like this, as in the tutorial:

    Code:
    @sprites["partybarplayer"].x-=16 if @sprites
     

    FL

    Pokémon Island Creator
    2,452
    Posts
    13
    Years
    • Seen today
    I've followed the tutorial step by step, but I got an error

    The line which the error comes from looks like this, as in the tutorial:

    Code:
    @sprites["partybarplayer"].x-=16 if @sprites
    The correct line was:

    Code:
    @sprites["partybarplayer"].x-=16 if @sprites["partybarplayer"]

    When the thread broke, I incorrectly fixed this line.

    Now is correctly fixed.
     
    Back
    Top