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.

Seperating Items by attribute

Okay, so, I'm working on a script that can seperate items into about 10 different bags. However, I need to know how to set them up by picking different attributes, like a sword could have te attribute "weapon" and thus, it goes in the "weapons bag". How would I go about doing this? I know it is done in Legacy's 1-scene CMS, but I couldn't figure out how it was done...
 
HAHAHA!

Check my sig for "Groupings and Details!" You can set up your Items menu into subgroups like "Weapons", "Armors", "Alchemy Items", "Potions", "Rocks"... what have you... and have special pop-up "extra information" screens for each.

Same goes for skills with it!

And, I have instructions for using it with RTAB and Ccoa's Battle System. Will work with Cybersam's no editing (since it hardly changes the default battle system).

Please... pretty please... get the .pdf file in the post (very easy read... detailed w/ pretty pictures), and edit the current version with the 'patch-fix' I posted in the topic.
 
know it is done in Legacy's 1-scene CMS, but I couldn't figure out how it was done...
well, if some one has said this, I must help, right? ^^
Code:
for i in 1...$data_items.size
        if $game_party.item_number(i) > 0 and 
          $data_items[i].element_set.include?(@attribute)
          @data.push($data_items[i])
        end
      end
      # Also add weapons and armors
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 and
          $data_weapons[i].element_set.include?(@attribute)
          @data.push($data_weapons[i])
        end
      end
     for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and
          $data_armors[i].guard_element_set.include?(@attribute)
          @data.push($data_armors[i])
        end
      end
taken from my CMS

the key line is this :
Code:
$data_items[index].element_set.include?(group element)
 

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