Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Tagging by Element Name instead of Element ID?

My CMS uses element tags to keep track of Item, Equipment and Skill types. I was wondering if there was a way to check for element_set(s) by the "Name" instead of the element's ID. For instance, I can name element 17 "Recovery Skills" and it automatically searches not for element_set 17, but the term "Recovery Skills" in which the element set was named.
 

poccil

Sponsor

You can use a line of code like the following instead of _include?_  when checking element sets:

Code:
if element_set.include?($data_system.any?{|i|  i=="Recovery Skills"} )
  #...
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top