- 38
- Posts
- 9
- Years
- Canada
- Seen Jul 10, 2022
So in my game i'm working on a while back i tried my hand at implementing a feature where you can switch between gen3 style and gen2 style overworld graphics, and that went fine more or less. However the way i did it involved exclusively using events and game switches, which i just found fairly clunky. So now that i'm a bit more familiar with scripting, i've been going back and changing some of the old complicated event chains and turning them into scripts. So far so good, but i've run into a bit of a problem that i just can't seem to figure out. I want to be able to switch the trainer and npc character sprites to and from gen2 and gen3 graphics by flipping a switch (or game variable, or whatever) and the problem is that when i flip the switch, the trainers, npcs, and player character all change their sprite as intended, but the player character bumps into invisible events as if they were walls. I have no idea at all why that might be happening! Anyway, here's what i did:
In the graphics folder i have 2 versions of every "trchar" file (in "Graphics/Characters") one normal one, that's included in default essentials, and one with "_gsc" added to the end for the gen 2 graphics.
In the script section, Sprite_Character, under "def update" in "class Sprite_Character < RPG::Sprite" i replaced this:
with this:
I'm pretty sure this is where the problem lies, since, when i revert back to just the original code, it works fine, just without any _gsc sprites being loaded. I think the problem is with the ".concat("gsc")" bit, but i don't know exactly what's happening to turn certain events into invisible walls.
Also, just for completion's sake, i also made a change in PBS file "metadata.txt". I added a couple new lines under [000], i just added a PlayerA_gsc and PlayerB_gsc with boy_run_gsc, girl_run_gsc, etc. Then i added a few lines in the scripts wherever "PlayerA" was found to make it use "PlayerA_gsc" if a particular switch is on. Not sure if it was necessary, i was just trying lots of different things to try and get this to work, and there's something different about how npcs and the player are rendered in game or something. Like i said, it works fine without the ".concat" bit, just without the npc gen2 sprites, so i'm pretty sure that's where the problem lies.
If any of you guys know what's going on, any help would be very much appreciated!
In the graphics folder i have 2 versions of every "trchar" file (in "Graphics/Characters") one normal one, that's included in default essentials, and one with "_gsc" added to the end for the gen 2 graphics.
In the script section, Sprite_Character, under "def update" in "class Sprite_Character < RPG::Sprite" i replaced this:
Code:
@charbitmap = AnimatedBitmap.new(
"Graphics/Characters/"[email protected]_name,@character.character_hue)
with this:
Code:
[email protected]_name
if char.include?("trchar000") || char.include?("trchar001") ||
char.include?("_run") || char.include?("_fish_offset") ||
char.include?("_bike") || char.include?("_surf")
@charbitmap = AnimatedBitmap.new(
"Graphics/Characters/"[email protected]_name,@character.character_hue)
else
char.concat("_gsc") if $game_switches[GSC_GRAPHICS_ON]
@charbitmap = AnimatedBitmap.new("Graphics/Characters/#{char}",@character.character_hue)
end
I'm pretty sure this is where the problem lies, since, when i revert back to just the original code, it works fine, just without any _gsc sprites being loaded. I think the problem is with the ".concat("gsc")" bit, but i don't know exactly what's happening to turn certain events into invisible walls.
Also, just for completion's sake, i also made a change in PBS file "metadata.txt". I added a couple new lines under [000], i just added a PlayerA_gsc and PlayerB_gsc with boy_run_gsc, girl_run_gsc, etc. Then i added a few lines in the scripts wherever "PlayerA" was found to make it use "PlayerA_gsc" if a particular switch is on. Not sure if it was necessary, i was just trying lots of different things to try and get this to work, and there's something different about how npcs and the player are rendered in game or something. Like i said, it works fine without the ".concat" bit, just without the npc gen2 sprites, so i'm pretty sure that's where the problem lies.
If any of you guys know what's going on, any help would be very much appreciated!