Display Actor's Name By ID

Status
Not open for further replies.
Joined
May 14, 2020
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMVXA
I'm using Ace Save Engine with this addon snippet:
Code:
class Window_FileList < Window_Selectable
  def draw_item(index)
    header = DataManager.load_header(index)
    enabled = !header.nil?
    rect = item_rect(index)
    rect.width -= 4
    draw_icon(save_icon?(header), rect.x, rect.y, enabled)
    change_color(normal_color, enabled)
    header = DataManager.load_header(index)
    if header.nil?
      text = sprintf(YEA::SAVE::SLOT_NAME, (index + 1).group)
    else
      text = sprintf(header[:party].members[0].name)
    end
    draw_text(rect.x+24, rect.y, rect.width-24, line_height, text)
  end
end
It displays first actor in the party's name on each savefile
Code:
text = sprintf(header[:party].members[0].name)
What I want instead is to use the nth actor in the database. Not sure how to do that.
 
Last edited:

Traverse

Veteran
Veteran
Joined
Jul 3, 2014
Messages
162
Reaction score
103
First Language
English
Primarily Uses
The object/variable that the game loads stuff from the Database files into are all named "$data_xxxx" (you can see where this is set up in the DataManager).

You are looking to reference "$data_actors[n]" rather than "header[party].members[n]".

Just a caveat - the actors in $data_actors are indexed starting from 1 instead of 0. So while $game_party.members[0] returns the first member in the party, you will need to use $data_actors[1] for the first actor in the database.
 
Joined
May 14, 2020
Messages
17
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Thank you, this works.
As it turned out though, I actually needed the name from the current game session rather than database, where the player renamed it, so I switched it to "$game_actors[n]"
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,549
Reaction score
8,625
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Who would think putting a power button on a side of a laptop is a good thing? You want to move the laptop and you suddenly press the button.
The second draft of my script is almost done, and I don't think I'm going to write a third draft. I'll make changes to dialogue here and there, but I'm happy with the series of events the way they are.
How you feel about font and dialogue box changing for every main character while the minor cast and regular npc get their own styles? Too much?
Just found an obviously custom effect (i.e. edited by me) in my resources>sounds folder called "rip jaw off". Dear Lord what is wrong with me as a person that at some point I needed a sound *specifically* for THAT??
(...rhetorical question.)

Forum statistics

Threads
107,526
Messages
1,030,277
Members
139,652
Latest member
jasasewamobilbali
Top