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.

Checking if an actor is in the party

Let's say I have an alchemy system, but the player can only select it if the alchemist is in the party, otherwise it's disabled. How would I do this checking?

Thanks in advance.
 

OS

Sponsor

Try using $game_party.actors.include?(actor_id), where actor_id is the id of the Alchemist in your database. Of coarse there is more to it than just this method, but I'm sure you know the rest. Peace!
 
That's won't work, Akahi. Game_Party#actors holds the actual actor data, not the index of actor. Armor Nick, try this little quick method:
Code:
class Game_Party
  def has_actor?(id)
    @actors.each { |actor| return true if actor.id == id }
    return false
  end
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