Advertiser Content

wanderlustdemon

I'll get angry, and take a nap.

Age 24
Female
Kalt Island
Seen 10 Hours Ago
Posted 5 Days Ago
173 posts
218 Days
I'm not to great with knowledge of how essentials works.
but, can one change battle sprites based on a switch.

There's a part of my game where you'll be entering a GSC style area, and I'd love for the battle sprites to change to.
Possibly have it if a switch is set all battle sprites change from 001.png to 001_gsc.png

if that makes sense.

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 37 Minutes Ago
Posted 18 Hours Ago
622 posts
331 Days
I'm not to great with knowledge of how essentials works.
but, can one change battle sprites based on a switch.

There's a part of my game where you'll be entering a GSC style area, and I'd love for the battle sprites to change to.
Possibly have it if a switch is set all battle sprites change from 001.png to 001_gsc.png

if that makes sense.
Maybe this, from Relic Castle can help you. :D

wanderlustdemon

I'll get angry, and take a nap.

Age 24
Female
Kalt Island
Seen 10 Hours Ago
Posted 5 Days Ago
173 posts
218 Days
Maybe this, from Relic Castle can help you. :D
I'm wanting to change battle sprites though.
This appears to be for the player, and their overworlds.

Vendily

Female
Online now
Posted 17 Hours Ago
896 posts
3.9 Years
Ah, you wish to change the pokemon battle sprites. I suppose a place to start is def pbCheckPokemonBitmapFiles
the important part is here.
    bitmapFileName = sprintf("Graphics/Battlers/%s%s%s%s%s%s",
       getConstantName(PBSpecies,species),
       (tgender) ? "f" : "",
       (tshiny) ? "s" : "",
       (back) ? "b" : "",
       (tform!="") ? "_"+tform : "",
       (tshadow) ? "_shadow" : "") rescue nil
    ret = pbResolveBitmap(bitmapFileName)
    return ret if ret
    bitmapFileName = sprintf("Graphics/Battlers/%03d%s%s%s%s%s",
       species,
       (tgender) ? "f" : "",
       (tshiny) ? "s" : "",
       (back) ? "b" : "",
       (tform!="") ? "_"+tform : "",
       (tshadow) ? "_shadow" : "")
    ret = pbResolveBitmap(bitmapFileName)
We can add another %s to the sprintfs, and another ternary on a game switch ($game_switches[GBC_SPRITE_SWITCH] ? "_gbc" : "")
but it will make an invisible sprite if the switch isn't on. So we can push another factor into the factors array for our condition, like say
factors.push([6,$game_switches[GBC_SPRITE_SWITCH] ,false]) if $game_switches[GBC_SPRITE_SWITCH]     # gbc
then we add a new t-variable, tgbc=false.
now we add a new when
when 6   # gbc
        tgbc = ((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
finally, in the sprintf changes, instead of looking at the game switch directly, we use tgbc instead.

same idea for def pbCheckPokemonIconFiles for the pokemon icons.

wanderlustdemon

I'll get angry, and take a nap.

Age 24
Female
Kalt Island
Seen 10 Hours Ago
Posted 5 Days Ago
173 posts
218 Days
Ah, you wish to change the pokemon battle sprites. I suppose a place to start is def pbCheckPokemonBitmapFiles
the important part is here.
    bitmapFileName = sprintf("Graphics/Battlers/%s%s%s%s%s%s",
       getConstantName(PBSpecies,species),
       (tgender) ? "f" : "",
       (tshiny) ? "s" : "",
       (back) ? "b" : "",
       (tform!="") ? "_"+tform : "",
       (tshadow) ? "_shadow" : "") rescue nil
    ret = pbResolveBitmap(bitmapFileName)
    return ret if ret
    bitmapFileName = sprintf("Graphics/Battlers/%03d%s%s%s%s%s",
       species,
       (tgender) ? "f" : "",
       (tshiny) ? "s" : "",
       (back) ? "b" : "",
       (tform!="") ? "_"+tform : "",
       (tshadow) ? "_shadow" : "")
    ret = pbResolveBitmap(bitmapFileName)
We can add another %s to the sprintfs, and another ternary on a game switch ($game_switches[GBC_SPRITE_SWITCH] ? "_gbc" : "")
but it will make an invisible sprite if the switch isn't on. So we can push another factor into the factors array for our condition, like say
factors.push([6,$game_switches[GBC_SPRITE_SWITCH] ,false]) if $game_switches[GBC_SPRITE_SWITCH]     # gbc
then we add a new t-variable, tgbc=false.
now we add a new when
when 6   # gbc
        tgbc = ((i/(2**j))%2==0) ? factors[j][1] : factors[j][2]
finally, in the sprintf changes, instead of looking at the game switch directly, we use tgbc instead.

same idea for def pbCheckPokemonIconFiles for the pokemon icons.
so, like, I don't know alot about scripting.
Where do I find def pbCheckPokemonBitmapFiles ?

Vendily

Female
Online now
Posted 17 Hours Ago
896 posts
3.9 Years
so, like, I don't know alot about scripting.
Where do I find def pbCheckPokemonBitmapFiles ?
Aha! I get to teach a new handy trick! If you press CTRL + SHIFT + F all at together, it lets you search across all of the script sections at once.
It's PSystem_FileUtilities though. Do learn this trick though, makes sifting through the code much easier.

Well, give it a shot, and feel free to ask for help if my instructions were too vague.

wanderlustdemon

I'll get angry, and take a nap.

Age 24
Female
Kalt Island
Seen 10 Hours Ago
Posted 5 Days Ago
173 posts
218 Days
Spoiler:


How did I not know of this function!!?

wanderlustdemon

I'll get angry, and take a nap.

Age 24
Female
Kalt Island
Seen 10 Hours Ago
Posted 5 Days Ago
173 posts
218 Days
Also, it's worked, thanks!!!
Advertiser Content