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

[Scripting Question] Hide Enemy Level

79
Posts
8
Years
    • Seen Jan 17, 2017
    I want the enemy's pokemon levels to be hidden in certain situations.
    For example instead of "Lvl. 30" = "???".
     
    296
    Posts
    9
    Years
  • 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
     
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    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:

    Franzo

    Developing something...
    95
    Posts
    16
    Years
  • I tried it and it works fine, are you sure you turned the switch on?
     
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    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 :/
     
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    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:
    296
    Posts
    9
    Years
  • 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:
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    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.
     
    79
    Posts
    8
    Years
    • Seen Jan 17, 2017
    Thank you for your help but the problem is still there. :/
    The Level completely disappears.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    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