• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Scripting Question] Hide Enemy Level

  • 79
    Posts
    9
    Years
    • Seen Jan 17, 2017
    I want the enemy's pokemon levels to be hidden in certain situations.
    For example instead of "Lvl. 30" = "???".
     
    In PokeBattle_Scene script section, replace this section:
    Code:
        textpos=[
           [_INTL("Lv {1}",@battler.level),@spritebaseX+202,8,true,base,shadow]
        ]

    With this code:
    Code:
    if(Condition)
        textpos=[
           ["???",@spritebaseX+202,8,true,base,shadow]
        ]
    else
        textpos=[
           [_INTL("Lv {1}",@battler.level),@spritebaseX+202,8,true,base,shadow]
        ]
    end
     
    Thank you! ^^

    Oh i got a problem.
    For the condition I used "if $game_switches[61]" but the level
    still shows up oO
     
    Last edited by a moderator:
    I tried it and it works fine, are you sure you turned the switch on?
     
    Yes...
    I forgot that I use the EBS so i added the changes there too
    but it still doesnt work. I cant seem to find the problem :/
     
    Ok so it works without ebs.
    Even though I changed it there too.. :(
    The other problem is that i dont see my own level.
    I just want the opponent's level to be hidden if theres a way... ^^'

    Yes.
     
    Last edited by a moderator:
    Try with the following method. In EliteBattle_UI script section, replace this line:
    Code:
    str = "Lv."

    Whit this one:

    Code:
    if(!@playerpoke && $game_switches[61])
      str = "???"
    else
      str = "Lv."
    end

    Replace also this section:
    Code:
    str = "#{getBattler(@battler).level}"
        x = @playerpoke ? -30 : -26
        pbDrawOutlineText(@sprites["text"].bitmap,x+o,-20,@sprites["text"].bitmap.width,@sprites["text"].bitmap.height,str,Color.new(255,255,255),Color.new(0,0,0),2)
        x -= @sprites["text"].bitmap.text_size(str).width+(@playerpoke ? 3 : 2)

    With this:
    Code:
    if(($game_switches[61]==false and !@playerpoke) or @playerpoke)
    str = "#{getBattler(@battler).level}"
        x = @playerpoke ? -30 : -26
        pbDrawOutlineText(@sprites["text"].bitmap,x+o,-20,@sprites["text"].bitmap.width,@sprites["text"].bitmap.height,str,Color.new(255,255,255),Color.new(0,0,0),2)
    end
    x -= @sprites["text"].bitmap.text_size(str).width+(@playerpoke ? 3 : 2)
     
    Last edited:
    Thanks!
    If I do everything except the last step the "???" is shown but the level
    is right after it. If I do your last step everything disappears.
     
    Thank you for your help but the problem is still there. :/
    The Level completely disappears.
     
    Code:
    if ($game_switches[61] && ((@battler.index&1)==1 || (@battler.index&1)==3))
           # Do nothing
        else 
          textpos=[
             [_INTL("Lv{1}",@battler.level),@spritebaseX+202,8,true,base,shadow]
          ]
          pbDrawTextPositions(self.bitmap,textpos)
        end

    I used this in my game.
     
    Back
    Top