[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,604
Reaction score
1,960
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

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
947
Reaction score
2,217
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
533
Reaction score
235
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
533
Reaction score
235
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 Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,243
Members
137,609
Latest member
shododdydoddy
Top