Hime's class graphics: Undefined method error

Discussion in 'RGSSx Script Support' started by autophagy, Jan 17, 2015.

    Tags:
  1. autophagy

    autophagy tank nerd Veteran

    Messages:
    75
    Likes Received:
    62
    Location:
    Austria
    First Language:
    German
    Primarily Uses:
    RMMV
    Hello!

    I am using Hime's class graphic script. Everything works fine so far, but I wanted to borrow a function.

    What I'm trying to do is, making the player able to leave party members behind and have an event turn into the party member. The event would need to change into the current form of the party member.

    To achieve this, I put the actor's id into the variable 7. I then put the class id of the party member in the variable 25.

    This works.

    Then I wrote this, using one of the methods that is used inside Hime's script in line 80:

    #define actor idaid = $game_variables[7]#get actor objectactor = $game_actors[aid]#define class idacid = actor.class_id$game_variables[25] = acid#get array from methodch = actor.class_character(acid)#change event graphic$game_map.events[0].set_graphic(ch[0],ch[1])The method "class_character(class_id) is used to determine the sprite's graphic file and index. It puts them into an array.

    This is where the game crashes and it says that actor does not have a class_character method. Is there something I'm doing wrong?

    Could it be a conflict with another script? Or do I just have to start a new game?

    Thank you in advance!
     
    #1
  2. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,071
    Location:
    Toronto
    First Language:
    English
    class_character is defined in RPG::Actor. $game_actors holds Game_Actor objects.

    You can define a method in Game_Actor that will call RPG::Actor's class_character method

    class Game_Actor < Game_Battler def class_character_name(class_id) actor.class_character(class_id) endendAlternatively you can try placeholder graphics and use a placeholder as the event's graphic.This should allow you to change your actor's graphic based on class (using the class graphics script) and any events that reference it will automatically update.
     
    Last edited by a moderator: Jan 17, 2015
    #2
    autophagy likes this.
  3. autophagy

    autophagy tank nerd Veteran

    Messages:
    75
    Likes Received:
    62
    Location:
    Austria
    First Language:
    German
    Primarily Uses:
    RMMV
    Thank you, that was exactly what I was looking for, and it works like a charm!
     
    #3

Share This Page