[RESOLVED] Change default actor graphic via script

Started by zephrael, May 27, 2013, 06:23:30 pm

Previous topic - Next topic

zephrael

May 27, 2013, 06:23:30 pm Last Edit: May 27, 2013, 10:24:20 pm by zephrael
Hey,

I'm using a couple of scripts that use the character's default graphic (i.e. from the database) for various functions - a battle system, for example. However if I change the character's graphic via events, the scripts don't pay attention to that change - that is, when the battle scene starts etc, the 'old' character graphic defined in the database is shown rather than whatever I changed it to. Is there any way to change the default graphic via a script call so that my battle system etc will use the graphics I want?

Thanks!

G_G

$data_actors[ID].character_name = "your graphic here"

zephrael

May 27, 2013, 08:27:26 pm #2 Last Edit: May 27, 2013, 08:57:25 pm by zephrael
Thanks for the reply! I tried that out, but it gave a NoMethodError:

undefined method 'character_name=' for nil:NilClass

I assumed it was maybe that you didn't mean to write character name, so I tried 'character_sprites', but that gave the same error. Any suggestions?

KK20

May 27, 2013, 09:01:09 pm #3 Last Edit: May 27, 2013, 09:05:13 pm by KK20
Where are you using that script call? It looks like it's being called before the title scene.
But I think G_G meant to say $game_actors. Making a change to $data_actors wouldn't make any changes in-game since those are the database configurations. But you will have to turn Game_Actor#character_name into an attr_accessor first.

So open up your scripts, find Game_Actor, and then find
attr_reader   :character_name
Turn reader into accessor. Your script call should now be
$game_actors[ID].character_name = "your graphic here"

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

It's running in a parallel process. I tried what you said, but it returned the same error as before! What could be wrong?

KK20

When does the error occur? Before/After the title screen?
What scripts are you using?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

It's running after the title screen, in a parallel process on a map. Here's a list of all other scripts I'm using:
Prexus Crafting
ForeverZer0 Item Weight
Hermes CMS
game_guy's Quest Log
Modified Name Input (Don't remember who it's by!)
game_guy's Item Storage
game_guy's Skill Items
Reno-S--Joker's Ring Menu
Enu's Sideview Battle System

Could any of these be disrupting it?

KK20

May 27, 2013, 09:49:10 pm #7 Last Edit: May 27, 2013, 09:51:59 pm by KK20
Sounds like a possible script conflict then.
Make a new project (you'll delete it afterwards) and do the same things I have instructed you to do. If the error doesn't pop up, then I will require a demo. I don't know why but one of your scripts is most likely not defining $game_actors upon starting a new game.

EDIT: You aren't using a 0 in place of ID, right?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

Same errors in a blank project, yeah :/

Oh... I am using 0 for the ID, yeah. What should I be doing?

KK20

The values used should match the actor's position in the database. The first actor, Aluxes, is 1. Basil is 2. etc.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

zephrael

May 27, 2013, 10:06:09 pm #10 Last Edit: May 27, 2013, 10:07:50 pm by zephrael
Ah, there we go! Ha I'm quite an idiot.

It's fine now, but it hasn't really fixed my initial problem... My battle system still uses the charset set in the database rather than the one I set with that script command. Any idea at all how to fix that?

EDIT: Ulp, I'm a fool. I forgot that for testing purposes I set the script to change to 001-Fighter01 rather than the one I wanted. It's fine! Thanks for all your help!

G_G

@KK20: I meant $data_actors, because his issue it sounded like that the scripts were using $data_actors[ID].character_name rather than $game_actors[ID].character_name so that's why I chose that one.