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,551
Reaction score
8,629
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 Profile Posts

Having problems with enemy/monster designs. :kaosigh:
While we prepare the official trailer, enjoy this kind-of-second teaser! ^^
-Ele
New Episodes of RPG Shenanigans Uploaded to Youtube!

Episode 5 - Surprise Party!
Youtube Link:
Episode 6 - Killer Gin
Youtube Link:
Episode 7 - Gaia's Melody: Echoed Melodies
(Coming soon!)

Episode 8 - Clarent Saga: Tactics
(Coming soon!)

Episode 9 - Star Shift
(Coming soon!)
When the Map Generator throws in the assets in the most dumbest way possible - your path is blocked :D

I went to sleep at 3 am because of my anxiety. Set up my alarm for 7 am so that I could have sasagues for breakfast and do morning routine before lessons starts at 8 am. I knew I wouldn't be able to sleep even after my lessons finished because I have to visit my grandparents today I was sad bc I was really tired. Thats when I realised. My lesson starts at 9 am. I could get one extra hour of sleep if I didnt forget it

Forum statistics

Threads
107,565
Messages
1,030,600
Members
139,671
Latest member
WDRS
Top