Hey all, I'm trying to find a way to create a variable that's set to the name of the graphic used for an event. So say, for example, I have an NPC whose character graphic is set to a sprite sheet named Bob.png. How could I create a variable for the name of that graphic so when I type \V[x] into a message, it returns a value of Bob?
Make a variable from graphic name
● ARCHIVED · READ-ONLY
-
-
Use script call (on the last tab of the event commands): $game_variables[id] = "Bob.png"
-
You don't even need to do that.
Control Variables (select your variable), choose the Script option at the bottom, then put $game_map.events[@event_id].character_name
If you put that onto your NPC event (onto Bob's event), you can type it exactly as I have it there, without substituting. If you have it on one event but you want to get a different event's graphic name, replace @event_id with the number of the event you want it to look at (EV003 would be 3). -
ah. I forgot about that :)
-
My thanks to the both of you. I couldn't use your option, Shaz, because it wouldn't fit in the limited space there (it cut off the last two letters), but you gave me exactly what I was looking for as far as the script goes. So I just combined both of your ideas and made the script: $game_variables[18] = $game_map.events[@event_id].character_name
Now I can pull up the name off the file and be lazy while making dialogue! :D -
Ah yes, the good old character length limitation. Let's hope that's removed with the next incarnation of RPG Maker.