[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,956
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
936
Reaction score
2,186
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

Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.
I checked out Genshin Impact gameplay out of curiosity. I can't believe it's available as a mobile game too. Smooth animation, great music, and stellar sound effects (the ambient sounds are pretty detailed).

I'm flabbergasted to see games have becoming more and more advanced. Maybe also because I'm oblivious to current trend for a long time, it almost feel like I'm being sent into distant future. xD
xDRAGOONx wrote on WaywardMartian's profile.
Your artwork is amazing!!!
:ewat:
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!
I should finish the cat video I'm editing and finish the indesign stuff. So far only 1 is done and 4 to go

Forum statistics

Threads
105,666
Messages
1,015,392
Members
137,341
Latest member
jasapembuatanwebsite
Top