• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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] Altering player backsprite size via script (or other automated means?)

  • 4
    Posts
    4
    Years
    • Seen Oct 4, 2020
    Documentation doesn't seem to cover my specific case in detail. If it does I apologise, but I spent a lot of time sifting through the wiki to no avail.

    Old thread regarding this: ht tps://ww w .pokecommunity.com/showthread.php?t=304456 (remove spaces in URL, can't post links because of anti-spam limit)

    My old sprite collection set up for EBS in v17.2 is not ideal for v18, since my backsprites are now too small/zoomed out. I want to automatically zoom in on them using a script instead of editing 2000 sprite images manually (if it can be automated somehow using the png files and not a script in essentials, please let me know).

    I found the class in question from the thread linked above, it's a bit different now but I found the equivalent (PBAnimationPlayerX) and the relevant lines therein. How do I go about making the suggested change from the old thread? (adding sprite.zoom_x*=2.0 if cel[AnimFrame::PATTERN]==-1 and sprite.zoom_y*=2.0 if cel[AnimFrame::PATTERN]==-1). If those lines to add in would still work, where exactly do they go? I tried a few configurations but they either had no effect or broke the syntax. (I'm a scripting novice. I'm trying to learn but this is beyond my atm.)
     
    Last edited:
    Welp. It's been multiple days on multiple posts across multiple forums and no answers, so I guess almost nobody knows the answer. Guess I'm entitled to just one bump and an extra question that may solve the issue: most back sprites I find are the same resolution, aspect, zoom, etc as the respective fronts... so how do people usually have it set up to look correct if not by this script? There has to be a way to do it without altering every image individually!!! There's no way that people are actually doing it manually? I find it hard to believe that I'm the only person moving from 17.2 EBS to v18 vanilla who is encountering this.
     
    Mind if I bump your thread by asking if anyone knows a way to grant the player character an infinitely-large backpack able to store 999,999x of each item?
     
    I don't know how much the engine can handle but this constant located in "Settings" should help:
    Code:
    BAG_MAX_PER_SLOT     = 999
     
    Alright well in the absence of knowing how to do this via scripts I did the following for anyone who has the same issue and wants a mostly script-free fix.

    Step 1: separate all of your backsprites for easy manipulation by searching name:~=b in your battlers folder and move them to a new folder. Back it up and then create a working folder copy.

    Step 2: Assuming your sprites are the same scale for front and back, batch multiply your bsprites sizes by 1.25x using the various software or online utilities around. I tried a few different sizes and this worked best. Your choice of tool will depend on your preferences for the quality of the output (interpolation etc). If you want it done hassle-free, go here: htt ps://bulkre sizephotos. com/en (remove spaces), upload the contents of your working folder.

    Step 3: paste the resulting images back into your battlers folder.

    Step 4: To correct our pokedex forms screen, in pscreen_pokedexentry find the line:

    @sprites["formback"] = PokemonSprite.new(@viewport)

    Paste the following under this line:

    @sprites["formback"].zoom_x=0.8 && @sprites["formback"].zoom_y=0.8.

    0.8 is the inverse of 1.25. If you use a different scale alter the 0.8s accordingly, eg: 0.5 if you doubled your image size (imo far too large).

    They will likely be positioned incorrectly when essentials checks metrics to determine the y position. This can easily be fixed by replacing this check with a y=256 constant. I tested this for all gen 1-8 pokemon and they all look good in the dex centered at y=256 from the back.

    Step 5: have fun repositioning the battle sprites ;)

    For those who want fantastic quality interpolation:

    1) Download and install ImageMagick
    2) create a folder on your desktop
    3) inside this, create a folder called "input" and put your sprites to resize inside it. Create an empty folder called "output" next to it, within the same folder on your desktop.
    4) run cmd, type in "cd", space, and paste in the path to your desktop folder. Hit enter.
    5) paste the following: magick mogrify -path output -resize 125% -filter point -interpolate nearest input/*.png
    6) Done, and looking much better for a few extra minutes of effort.
     
    Last edited:
    Back
    Top