So your question is, how can you remember all the party members at a particular time and then restore them after the battle.
That would a byte order mark, https://en.wikipedia.org/wiki/Byte_order_mark
class RPG::Actor def initial_mp @note =~ /<initial_mp:\s+(\d+)>/ ? $1 : 4 endend class Game_Actor def init_mp actor.initial_mp endend
Well Ruby has a lot of sugar in it (beware diabetics)
As Tsukihime mentioned, you can index an Array backwards.
array = [1, 2, 3]array[-1] # =>...
>_< FINE HAZ IT YOUR WAY *storms off, leaving a bit of code behind*
module Vocab class << self def const_missing(sym) if...
Just overwrite everything (its what I do, and I'm more productive that way)
Sometimes you gotta break stuff to make it better, like a few bones...
Ah *facepalms*, I forgot it only works with downcased method names
:P just use Theo.TestConst or Theo.test_method
You can cheat.
module Vocab constants.each(&:remove_const) def self.ConstName "Stuff" endend
ruby allows ::method_name calls as well.
5 cents: (copy and pasted)
## kode-xchange/lib/core/locale.rb# by IceDragonclass Locale ## # @return [String] name of this Locale...
Could be done by adding a third option for patch-ing (aka chaining)
Right, just make it the second arg.
patch :method_name, :chain do...
Nice idea, I like,
However a few problems:
1. Don't use global variables to store context sensitive functions.
2. there is a chance (1 out...
Anyone wanted a zip/rar file?
Just read the README in the zip file for more information.
yeah, I kinda removed that to match the screenshot you provided, sowwy?
I've commented out the code, try it now.
I was just looking over the code myself, I made a small mistake on the #on_item_cancel
:) I've fixed it now.
Herp Derp, I know its lazy, but it gets the job done right?
## IEK/lib/simple_item_window.rb# dc 16/11/2013# dm 16/11/2013# by IceDragon#...
:D Wassup bro? *bro-hugs*
Welcome to my code exchange thread. Or maybe I should call it snippet dump?
.. What Is This?
Over the course of...
Um, you know ruby allows you to open a file, and leave it open... while still adding stuff to it without worrying about closing it?...
Good Point :) Alrighty, RGSSx Script Dev. it is then.
I wanna make a thread to share random bits of ruby code (mostly targetting RGSS3), anyone know where I could post it?
Separate names with a comma.