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.

Class members of Data/rmxp.rxdata

This may be a little deep, but I am trying to get under the hood a little and I haven't tinkered about with RMXP for a while. Still don't know if I want to move over to VX (feels more restrictive than XP)

(this'll sound like a dopey question, but I wasn't sure, gotta learn these things by asking)
Are the rxdata files, class libraries with data? They seem to be accessed and used like classes. Is there a way other than scanning through the script and making notes of each call to identify all the class members? (Has somebody already done this? I know I am being lazy)

I am deconstructing the script and trying to get a good measure of all it's functions. (RMXP is great for sandbox programming)
 
You can save anything as a .rxdata. You can even have your own extension, it doesn't matter. But usually, the data files (let's take Skills.rxdata as an example) are hashes containing classes.

Here's how Skill.rxdata would look in the script editor:
Code:
@skills = { RPG::Skill.new, RPG::Skill.new, RPG::Skill.new, etc.}
Then, @skills is "Marshalized", compressed in a binary format like this:
Code:
save_data('Data\Skills.rxdata', @skills)

Now, you load this data like that
Code:
$data_skills = load_data('Data\Skills.rxdata')
and this will restore Skills.rxtada, the binary version of @skills to $data_skills.
In short, @skills becomes $data_skills. And that's why you can access the skills by using
Code:
$data_skills[1] ...
 
(They are actually arrays, with nil being the first object)

Adding to what Dargor said, whenever you save a project from the editor, all those rxdata files are created from everything you have set (from the database, map and script editor). They are all RPG objects from the RPG module (look in the helpfile under RPGXP Data Structure).

save_data and load_data are just the two built-in methods rmxp has provided doing as Dargor described above.

Traditionally, you would only use these for adding new data structure objects or saving savefiles.
 
Thanks for your insights.

I am interested in the data files, because I wanted to explore being able to use the data differently or with extra data added.

For instance, I wanted the player character to have different STR, AGI gain per level dependending on the class the player has chosen to play. Kinda like pointing the class data at the actor data for STR etc, and removing the way actor data uses the STR etc. The script for this is beyond me at the moment, but most of the fun is in the getting there, even if I don't even arrive. (or arrive in a different location so to speak)

If I wanted to add elementary efficiency that is based on attack not just on defence, I suppose I would just need to script that in. (probably a bit too difficult for me to do at this time) and it can be done by using exclusive skills.

I'm not always comfortable just cutting and pasting someone elses script into my work. I prefer to try and understand and appreciate the creators work, so that I may learn something from it.
 
Well you don't really have to read any of the data from rx/rvdata files.

I made a tutorial about adding attributes in the tutorial forum. If you are wanting to add things like new instances to objects, I suggest reading into that. Then changing the way something like the actor reads something, you just need to figure out which method to look in and replace.

If you have something in particular you would like me to guide you through, just ask.
 

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