Jump to content
kal

Ruby/RGSS3 questions that don't deserve their own thread

Recommended Posts

This is probably something simple so I'm posting it here rather than its own thread. Using the tag manager script:

 

http://himeworks.com/2013/03/tag-manager/

 

What would be the script call to check if any item in the inventory has a specified tag? Like if I tag some items "bossdrop" and I want to check if any of them are in $game_party.items? Thanks for your help!

Share this post


Link to post
Share on other sites
4 hours ago, staticispuink said:

This is probably something simple so I'm posting it here rather than its own thread. Using the tag manager script:

 

http://himeworks.com/2013/03/tag-manager/

 

What would be the script call to check if any item in the inventory has a specified tag? Like if I tag some items "bossdrop" and I want to check if any of them are in $game_party.items? Thanks for your help!

 

To check if any item in inventory contains a specific tag, use:

$game_party.items.any? {|i| i.tags.include? "tag"}

The code above returns either true or false, depending if there is an item with the specified tag in inventory.

 

Replace "tag" with the one you're looking for. For example;

$game_party.items.any? {|i| i.tags.include? "bossdrop"}

 

Share this post


Link to post
Share on other sites
1 hour ago, Rikifive said:

$game_party.items.any? {|i| i.tags.include? "tag"}

 

Actually, that'll likely be useful to me as well, since that script in particular is one of my most commonly used. So, double thanks. lolz

Share this post


Link to post
Share on other sites

I've always wondered the following:

How does one check the eight tiles surrounding the player for region and terrain IDs, without a lot of complicated eventing? I'm sure there's a way, just not sure how to check this.
 

Share this post


Link to post
Share on other sites

On a related note, possibly a more complex question about the tag manager: how would I go about finding the number of items in the inventory of a certain tag? I.e. the total number of "bossdrop" items added together.

 

Thanks again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×