RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
script tweak. Bestiary hide category until discovered.

0 Members and 2 Guests are viewing this topic.

**
Rep:
Level 75
RMRK Junior
Hi, I was hoping someone could help me tweak the code a little on the following script to keep a category hidden until it's list contains at least 1 entry.

The script is Venka's Bestiary v1.8 which can be found here in full: https://www.dropbox.com/s/j43haetbe00k0gq/Beastiary.txt?dl=0



the line of code I believe is needed for modification is the following, however, not being a coder I have almost 0 knowledge of how to link it up correctly. [line 921-923]

Code: [Select]
  def make_command_list
    @categories.each{|key, info| add_command(info[:name], key)}
  end

I thought it might be something simple like inserting an if function before adding a command to check if there is a monster in the list discovered. But to someone like me with no real coding experience, I couldn't fathom how to insert a check before the category command list is formed.


Either the seemingly simpler method I'm wanting or an option to hide only some categories until a monster is discovered would be brilliant if anyone knows how to solve my issue I would be very grateful for your help  :)

I love the script but the author seems inactive and I'd like to keep some locations secret until visited.

Thanks  :)