Ellie Staff 763,147 Aug 13, 2008 #1 Quick question, in RMXP you can assign elements to items right? How would I test to see if an item had a certain element? For example, Code: item = $data_items[x] if item has element 1 do this else do that end
Quick question, in RMXP you can assign elements to items right? How would I test to see if an item had a certain element? For example, Code: item = $data_items[x] if item has element 1 do this else do that end
poccil Sponsor 327 Aug 13, 2008 #2 It would look like this: Code: if item.element_set.include?(1) # do something else # do something else end Upvote 0 Downvote
It would look like this: Code: if item.element_set.include?(1) # do something else # do something else end
Beran Member 104 Aug 13, 2008 #3 You can also leave the item = ... part out and just go Code: if $data_items[x].element_set.include?(1) stuff else other stuff end Upvote 0 Downvote
You can also leave the item = ... part out and just go Code: if $data_items[x].element_set.include?(1) stuff else other stuff end