[RGSS] VERY LARGE SCRIPT PAGES

Posts

Pages: 1
Hello everyone,

I have a problem of convenience. One of the methods in my script editor is becoming very long. Is it possible to bridge a Ruby method across two separate script entries?

-Zack
Yeah. Just close whatever class/module you're in and reopen it in another file. So

in one file/page
class Character
  def hp
    return hp
  end
end


and in another page
class Character
  def mp
    return mp
  end
end


Is 100% legit ruby and it's fine to do so this way.
Thank you, although, I knew it was possible to span the class across multiple pages (the way RPG Maker's default Ruby scripts come as Interpreter 1, Interpreter 2, etc.). Is it possible to do it for the def alone? Like:

class AllMyInformation

def hugelist(argument_1, argument_2)
...part 1...
end

end


(Next script)
class AllMyInformation

def hugelist(argument_1, argument_2)
...part 2...
end

end
You could alias it. The syntax is: alias (identifier) (original method name)

Part 1
class AllMyInformation
  def hugelist(a, b)
    do_stuff
  end
end


Part 2
class AllMyInformation
  alias new_alias_name_for_hugelist hugelist
  def hugelist(a, b)
    new_alias_name_for_hugelist(a, b)
    do_more_stuff
  end
end
Pages: 1