Chaos Project

Featured Projects => Tasks => Advanced RPG Creator => Finished Tasks => Topic started by: Blizzard on March 07, 2011, 03:50:56 pm

Title: [Finished] [RGSS] RMXP Hidden classes
Post by: Blizzard on March 07, 2011, 03:50:56 pm
Somebody has to put a Ruby script together and insert it into RMXP. Make use of Ruby's reflection to extract all the methods and (possibly) instance variables of the hidden classes such as Tilemap, etc. It will make it easier to clone RMXP's functionality. Who's up for it? The script shouldn't take more than an hour.
Title: Re: RMXP Hidden classes
Post by: ForeverZer0 on March 07, 2011, 04:51:57 pm
I can do this, but I won't be home nor able to start on it until tomorrow night.
If you someone else wants to do it sooner, go ahead, but let me know so I don't start working on it tomorrow when someone else already has.
Title: Re: RMXP Hidden classes
Post by: Ryex on March 07, 2011, 05:10:55 pm
done. a folder with the information in txt files has been committed to SVN.
Title: Re: RMXP Hidden classes
Post by: Blizzard on March 07, 2011, 05:17:27 pm
It would be good if we have this until the weekend so we can put a structure together for the C++ classes.

Lol!

EDIT: I modified the script. Can you rerun it?
Title: Re: RMXP Hidden classes
Post by: Ryex on March 07, 2011, 05:30:34 pm
good call there. much easier to read.
Title: Re: RMXP Hidden classes
Post by: Blizzard on March 07, 2011, 05:31:29 pm
Yeah, I used to do that when debugging some heavy stuff. xD

EDIT: Would be good if you also added the hidden modules Graphics, Audio and Input. I think those are all.
Title: Re: RMXP Hidden classes
Post by: Ryex on March 07, 2011, 06:02:42 pm
Done.
Title: Re: [Finished] [RGSS] RMXP Hidden classes
Post by: ThallionDarkshine on September 07, 2012, 05:16:02 pm
Sorry for the necropost, but could someone post the information the script got?
Title: Re: [Finished] [RGSS] RMXP Hidden classes
Post by: Ryex on September 07, 2012, 08:52:58 pm
I could, I actually went back in our reapo to find the files (had to go back to revision 52). but what do you need it for?
Title: Re: [Finished] [RGSS] RMXP Hidden classes
Post by: ForeverZer0 on September 08, 2012, 01:25:22 am
Its literally just a list of methods and variables.
Ruby has the feature built in:

ex.
Tilemap.methods
Bitmap.private_methods
Table.instance_variables
Title: Re: [Finished] [RGSS] RMXP Hidden classes
Post by: Ryex on September 08, 2012, 01:44:01 am
yes, actually I would be easier for me to give you the script I used to generate the files, it simple and has no bearing on the project it self so... here.

Spoiler: ShowHide

def reflect(obj)
io = open("./" + obj.class.to_s + ".txt", 'wb')
io.write("Instance variables:\n")
(obj.instance_variables - Object.new.instance_variables -
Class.instance_variables - Module.instance_variables).sort.each {|name|
io.write("\t" + name.to_s + " => " +
obj.instance_variable_get(value).to_s + "\n")
}
io.write("Methods:\n")
(obj.methods - Object.new.methods - Class.methods - Module.methods).sort.each {|name|
io.write("\t" + name.to_s + "\n")
}
io.write("Public Methods:\n")
(obj.public_methods(true) - Object.new.public_methods(true) -
Class.public_methods(true) - Module.public_methods(true)).sort.each {|name|
io.write("\t" + name.to_s + "\n")
}
io.write("Private Methods:\n")
(obj.private_methods(true) - Object.new.private_methods(true) -
Class.private_methods(true) - Module.private_methods(true)).sort.each {|name|
io.write("\t" + name.to_s + "\n")
}
io.write("Protected Methods:\n")
(obj.protected_methods(true) - Object.new.protected_methods(true) -
Class.protected_methods(true) - Module.protected_methods(true)).sort.each {|name|
io.write("\t" + name.to_s + "\n")
}
io.write("Singleton Methods:\n")
(obj.singleton_methods(true) - Object.new.singleton_methods(true) -
Class.singleton_methods(true) - Module.singleton_methods(true)).sort.each {|name|
io.write("\t" + name.to_s + "\n")
}
end

begin
 reflect(Bitmap.new(32, 32))
 reflect(Color.new(255, 255, 255, 255))
 reflect(Font.new())
 reflect(Plane.new())
 reflect(Rect.new(0, 0, 32, 32))
 reflect(Sprite.new())
 reflect(Table.new(10, 10, 10))
 reflect(Tilemap.new())
 reflect(Tone.new(255, 255, 255, 255))
 reflect(Viewport.new(0, 0, 640, 480))
 reflect(Window.new())
 reflect(RGSSEror.new())
end
Title: Re: [Finished] [RGSS] RMXP Hidden classes
Post by: ThallionDarkshine on September 08, 2012, 09:00:37 am
Thanks Ryex