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.

[Resolved] MrMo's SBABS - weird error

Status
Not open for further replies.
I'm getting a no method error in an addon I'm making to MrMo's ABS, and I have no idea why.

I added this method. It's basically just one of the methods in the script, but with a few lines taken out, the name changed, and an argument added for the skill value.

Code:
class MrMo_ABS
  def cast_skill_wyatt(skill_id)
    key = skill_id
    if STATE_EFFECTS
      for i in $game_party.actors[0].states
        return if STUN_EFFECT.include?(i) or PARALAYZE_EFFECT.include?(i) or MUTE_EFFECT.include?(i)
      end
      id = @actor.skill_keys[key]
      if RANGE_EXPLODE.has_key?(id)
        return player_explode(id)
      else
        return player_skill(id)
      end
    end
  end
end

I then called this method:

Code:
MrMo_ABS.cast_skill_wyatt(1) unless $game_party.actors[0].skill_keys[1] == nil

But this is getting a no method error. I've tried moving them around in the script editor so one's above the other and vice versa. I've made sure the ABS is above them... But still, same error:

"Undefined method cast_skill_wyatt for MrMo_ABS:Class".

Anyone got any ideas here?
 

khmp

Sponsor

I think the problem comes into play because you don't have an instance of said class. Like if I made:

Code:
class Simple_Thing
  def print_thing(thing)
    p thing
  end
end

I can't just say:
Code:
Simple_Thing.print_thing('text')

I need to first make an instance of the class.

Code:
thing = Simple_Thing.new
thing.print_thing('text')
 

arev

Sponsor

This topic has been resolved. If Wyatt or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

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