I just finished the official tutorials, but none contained information about creating scripts. I've poked around and found plenty of tutorials on how to learn Ruby, but I've been having trouble learning how to use that knowledge to create scripts for VX Ace. Like, if this was C++, would scripts be like functions, or entire programs? Are any variables already defined, and what information do the scripts input and output, and how? Like, how do I get a script to import a value for the current hp of the first hero in the party or something like that?
I'm not looking for answers for these special questions, I'm just using them as examples what I mean about using Ruby.
Can anyone point me to any applicable tutorials or instructional videos or anything? Even just being pointed in the right direction would be immensely helpful.
Also, what's the difference between rgssx and rgss3? Does x mean "placeholder for a number?" And is only rgss3 used for vx ace?
I apologize if this thread is redundant. I tried to find an answer, but couldn't, probably because I'm new here and don't really know what I'm doing yet.
Programming in Ruby is the same as writing scripts.
Small scripts are usually modifications of the existing engine, overriding single functions - larger scripts may either rewrite parts of the engine or add completely independent additions to the engine.
If you want to modify something, you need to look up that something in the existing engine in the script editor, and then write a script that overrides or alias and append to the existing functions/objects. If you want to add something new, you'll have to provide your own data structure. There is no additional documentation beyond the direct code in the script editor, but you can ask for help understanding it here in the forums.
RGSSx means "anything involving RGSS1 (RMXP), RGSS2 (RMVX) or RGSS3 (RMVXA)".
I suppose you know how to code somewhat in C++? And are familiar (or know where to learn) Ruby syntax and such small gimmicks?
As for RGSSs, they are just libraries created in Ruby language in specific purpose to build games. Different RPGMakers use different versions of RGSS libraries. Ruby, as language, has functions and other data structures, like C++. Script in these forums refers to just independent code segment that modifies the RPGMaker RGSS functionality for specific purpose. It is not exactly Ruby-related term, I don't think it is even RGSS-related term per se.
Like Andar said, yes, pretty much all that information (character health, level, how the textboxes are drawn...) can be found in the existing RGSSx. It communicates with database of the game and updates and retrieves the information there. When you code/script for the game, you need to modify the existing code by adding or changing the scripts in script editor. Usually adding scripts that overwrite the original scripts (everything that natively exists in your script editor) is recommended for compatibility and keeping your RPGMaker default scripts functional.
As scripts usually are supposed to work directly, they often are more than just a function, since you need to call it too. From RPGMakerAce onwards you can do script calls in events natively, so if you wanted to just call one function on certain types of events: yes you could make the script just contain the function definition and call it in events. Or your script might not require any functions, if you just overwrite some variables in original scripts... How vast your script is and what it should contain, depends on what you need from it.
And as for what I personally find important in getting from understanding Ruby syntax and basics of coding overall to creating RPGMaker scripts: understanding classes, being able to create or at least manipulate them and knowing how inheritance works are something you should look into. Small snippets or edits on someone else's scripts can be done without that knowledge, but you'll need it for anything more advanced. There should exist some material on classes and inheritance in Ruby in general.
For RGSSx specific examples, there are few tutorials on writing small scripts for specific purpose in YouTube (I sought for RPGMaker scripting and got a few). When you know inheritance, you can learn from these examples, how to search for and modify the segments that affect the feature you want to change by your code. And that in the end is what gets you there from general coding: knowing how to overwrite and add in existing code without need to modify the original. And for that you need to know inheritance to know what all you are affecting, when overwriting a function or structure, and what all properties the object you create for overwriting inherits.