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

How to credit if change the trainer back character

20
Posts
10
Years
    • Seen Jul 16, 2015
    Ok, it's me again = =

    I tried to change the trback picture in essential today ,
    i used the BW style picture

    the new picture's size is 750*240, but the original one is 640*128

    I changed the picture simply without changing the script ,and of course got the very strange result (crying)

    how to script?


    this is the original script above,thanks!
    #################################################
    if @battle.player.is_a?(Array)
    trainerfile=sprintf("Graphics/Characters/trback%03d",@battle.player[0].trainertype)
    pbAddSprite("player",Graphics.width+64-48,96+@traineryoffset,trainerfile,@viewport)
    trainerfile=sprintf("Graphics/Characters/trback%03d",@battle.player[1].trainertype)
    pbAddSprite("playerB",Graphics.width+64+48,96+@traineryoffset,trainerfile,@viewport)
    if @sprites["player"].bitmap
    if @sprites["player"].bitmap.width>@sprites["player"].bitmap.height
    @sprites["player"].src_rect.x=0
    @sprites["player"].src_rect.width=@sprites["player"].bitmap.width/5
    end
    @sprites["player"].x-=(@sprites["player"].src_rect.width-150)/2
    end
    if @sprites["playerB"].bitmap
    if @sprites["playerB"].bitmap.width>@sprites["playerB"].bitmap.height
    @sprites["playerB"].src_rect.x=0
    @sprites["playerB"].src_rect.width=@sprites["playerB"].bitmap.width/5
    end
    @sprites["playerB"].x-=(@sprites["playerB"].src_rect.width-150)/2
    end
    else
    trainerfile=sprintf("Graphics/Characters/trback%03d",@battle.player.trainertype)
    pbAddSprite("player",Graphics.width+64,96+@traineryoffset,trainerfile,@viewport)
    if @sprites["player"].bitmap
    if @sprites["player"].bitmap.width>@sprites["player"].bitmap.height
    @sprites["player"].src_rect.x=0
    @sprites["player"].src_rect.width=@sprites["player"].bitmap.width/5
    end
    @sprites["player"].x-=(@sprites["player"].src_rect.width-150)/2
    end
    end
     

    tImE

    It's still me, 44tim44 ;)
    673
    Posts
    17
    Years
  • The size of the picture you use doesn't matter, what matters is the amount of "frames" in the picture.
    The standard backsprite is 640 pixels wide, divided in 5 frames which are 128 pixels wide each.
    Since your new sprite is 750 pixels wide, it should be divided into 5 frames which are 150 pixels wide each.
    Having 4 or 6 frames does not work. (It does work, but you'd need to script.)

    Simply make sure your backsprite has 5 frames, and there shouldn't be a problem.
     
    20
    Posts
    10
    Years
    • Seen Jul 16, 2015
    The size of the picture you use doesn't matter, what matters is the amount of "frames" in the picture.
    The standard backsprite is 640 pixels wide, divided in 5 frames which are 128 pixels wide each.
    Since your new sprite is 750 pixels wide, it should be divided into 5 frames which are 150 pixels wide each.
    Having 4 or 6 frames does not work. (It does work, but you'd need to script.)

    Simply make sure your backsprite has 5 frames, and there shouldn't be a problem.



    I know what you mean ,and my new pictures do have 5 frames , i tried to change the number 128 to 150, but it still had some problems.

    i want to know what do the standard number "96" and "48" mean
    can you tell me ?thanks!
     

    tImE

    It's still me, 44tim44 ;)
    673
    Posts
    17
    Years
  • Well, it's hard to know what you mean by "problems".
    Could you take a screenshot of the backsprite and the problem it has in-game?
    Because, I'm using an 800x160 backsprite, and I didn't have to change the scripts at all.

    @ 96 and 48 though.
    Player A's X position = - 48
    Player B's X position = + 96

    The first half of the script is for tag battles, defining the positions of the two backsprites shown, you and your partners.

    The 96 is the offset in the Y direction which both sprites have.
    Which means the top of the sprite begins at pixel 96 from the top instead of 0.
     
    Back
    Top