Jump to content

Mattsuharu

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Days Won

    1

Mattsuharu last won the day on April 17

Mattsuharu had the most liked content!

Community Reputation

1

About Mattsuharu

  • Rank
    Newbie
  1. Mattsuharu

    Id and Quantity of something?

    Hello, me again with another script issue. I was breaking my head for 2 days in a row with this. In a script I'm trying to edit, I can't figure out how to create the next script call. This is the original script call that work perfectly: This return me if the card with a certain ID is in the deck of my actor. Now, the problem is that I tried to make another similar script call and I though it would be easy, but is not... (This is just an example, I know the * 2 won't return me the amount of that card) I want to create the almost exact script call but instead to return me if there's any copy of the card with that ID, I need to return me if there's 2 or more with the same id. I read a lot of articles of ruby code, but can't figure out how to separate the "ID" and the "object quantity". I can't find a way to ask by code how many copies of something with the same ID I have in the deck. I'm really struggling with this one. Thanks in advance to whoever hero who can help me out with this!
  2. Mattsuharu

    Trying to modify a script (actor = variable)

    Thank you very much for your answer!
  3. Nevermind, I just solved it. For some reason the code "for actor is" doesn't work for what I wanted, I changed it to actor = $game_actors[$game_variables[27]] and worked perfectly. --------------------------------------------------------------------------------------------------------------------------------- Hello there. This is my first post in this forum! Sorry if something like this was already answerd, but I can't figure out how to search for something like this. Here's my problem: I'm using an script that has a script call. The problem is that this script call do something with all party members, and I want to do it with an specific actor. Here's the piece of code: def has_card?(id) for actor in $game_party.members for card in actor.deck return true if card.id == id end end return false end And I tried to make my own custom one with an specific card in an actor deck and ended with this: def has_card_in_deck?(id) for actor in $gameActors.actor($gameVariables.value(27)) for card in actor.deck return true if card.id == id end end return false end While variable 27 determine the actor ID of the last action made in battle. I'm not good at ruby, maybe there's an easy way to get the ID of the actor who performed the last action, and maybe with this coding I'm making something wrong. The error I get is related to: undefined method 'value' for nil:NilClass As far as I understand, this say that my method to define the actor is wrong. But I don't know what else to do. Any help would be welcome!
×
Top ArrowTop Arrow Highlighted