[MV] Scripts in Show Text using Variables

ccarmine

Warper
Member
Joined
Oct 8, 2019
Messages
2
Reaction score
0
First Language
Italian
Primarily Uses
RMMV
Hi everyone, i'd like the event to say the name of the weapon i have equipped.

//in the event page
I save the script in a variable:
V002 = $gameActors.actor(1).equips()[0]
and then in the show text i put -> \v[2]

photo2.JPG

but when i'm in game it gives me the text [object Object] instead of (in this case) Dagger.

photo.JPG

Also, the character is dual wield, so i do similar things for the second weapon:
V003 = $gameActors.actor(1).equips()[1]
and in the show text -> \v[3], but it gives me the same thing.

I can't figure it out. Can someone please help me?
Thanks for reading.

PS. This is my first post, if i've done something wrong, let me know.
 

Attachments

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,547
First Language
English
Primarily Uses
RMMV
The problem is that the equips() function returns the actual Game_Item object that represents the weapon: you'd need to do $gameActors.actor(1).equips()[0].name
 

Hyouryuu-Na

Procrastinates 24/7
Veteran
Joined
Jun 15, 2017
Messages
631
Reaction score
1,334
First Language
Not English
Primarily Uses
RMMV
Use this: $gameActors.actor(1).equips()[0].name
Edit: ooh I was late by a few seconds
 
Last edited:

ccarmine

Warper
Member
Joined
Oct 8, 2019
Messages
2
Reaction score
0
First Language
Italian
Primarily Uses
RMMV
Thank you guys! :LZYcheeze:
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
483
Reaction score
212
First Language
English
Primarily Uses
RMMV
The problem is that the equips() function returns the actual Game_Item object that represents the weapon:
Just noting that it returns the database object, not the Game_Item object which is just a tiny wrapper with a type and an ID.
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
483
Reaction score
212
First Language
English
Primarily Uses
RMMV
Yes, that's why I cut the solution out of my quote. :)
 

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

Latest Threads

Latest Profile Posts

I'm having a fun time working with the MZ RTP. The waterfall hasn't changed, though, so I'm wondering if they didn't make a new one or if they forgot to put it in...

good progress on the typescript Definitions files almost done all the Manager and yet I still have to do the Battle Manager...who is seriously so much data lol
Are the export options for MZ known yet?
I thought they were supposed to be my friends T_T
Anyone else ever feel bad about always needing to ask for help on their game..?

Forum statistics

Threads
100,642
Messages
978,058
Members
132,259
Latest member
RegularManGuy
Top