Arsist

Regular
Regular
Joined
May 16, 2014
Messages
140
Reaction score
10
Primarily Uses
I'm using a custom description script and a custom message codes script (of which I like where it lets you place strings like \#{10*$game_actors[1].hp} and I absolutely cannot access anything.

What I'm especially trying to access is whether the current object is an item/weapon/armor, and the objects numeric id from the database.

For example, I was trying to make descriptions for objects of an array if they haven't been "indentified" yet (via http://www.rpgmakervxace.net/topic/12352-identify-item/ ).

This was my modification to set_item in Window_Help.

def set_item(item) value = "" #If the object is an item if is_item? if !$game_party.identified_items[:item][id] [1,2,3].each {|data| if id == data then value = "Unknown vial." end} end end set_text((!item or value != "") ? value : item.description)I try viewing an unidentified standard potion I just get an undefined error for is_item? (item.is_item also returns this error).

But that's just an example.

From what I understand, using things like attr accessories, super, aliases, or that < function will allow for one class to have access to another, but I am unsure how to do it.

I think in this case I'm trying to access Game_BaseItem but I'm unsure.
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,153
Reaction score
16,960
First Language
English
Primarily Uses
RMMV
item.is_item? should work.


is_item? is incorrect, and item.is_item is incorrect.
 

Peridot Gaming

Regular
Regular
Joined
Nov 25, 2012
Messages
123
Reaction score
14
First Language
English
Primarily Uses
I've used

item.is_a?(RPG::Item)in the past to check if the item is in fact an Item.
 

Arsist

Regular
Regular
Joined
May 16, 2014
Messages
140
Reaction score
10
Primarily Uses
But then how do I check for its numeric id?
 

Latest Threads

Latest Posts

Latest Profile Posts

My game just got 35k downloads on Steam! Thank you everyone for helping me achieve this goal guys, I hope more people know more about Phil Alone!
I was wondering why Skyler's hair looked weird on their new sprite. Well I forgot adding their iconic hairband
Anyone up to give Holder, TRIDIUM, GenericFantasyDev and Black Mage the fight of their lives?
Go ahead.
"The internet made everyone way too comfortable with disrespecting each other and not getting punched in the face."
I woke up a touch early and was going to draw by the fireplace until it’s a more appropriate noise-making time, but I left my stylus AND my glasses (WHAT?!) upstairs and it’s just too cold to get out of the blanket now.

Forum statistics

Threads
134,878
Messages
1,251,485
Members
177,676
Latest member
Sundeviljw
Top