Proper Script Usage for Custom Scripts
Never try to edit a script that doesn't offer you some getter or setter method or an extra variable or array or hash or Constant.
Learn some basic scripting first!
Learn some basic scripting first!
Many scripters get bored of listening to lazy game developers that pretend to be top notch but know nothing about coding and still state stuff like a script is crappy. Most of the time its the users' fault! They don't know any RGSS or Ruby or JS or anything and they change complex stuff and later complain about what they have broken.
Don't use Constants as simple variables!
They are named Constants because their contents should remain the same!! So if it's a boolean or a number or an array or a hash, leave it as it is! Only change them if the scripter told you what values were valid there!
Scripts Are No Miracle Workers!
They are just some tools to let you extend a game engine's list of available features. Scripts have limitations like practically having no access to low level functions unless you get libraries like the incompatible and forgotten and deprecated Win32API. Of course modern replacements of your game engine might let you use a lot more features by default or by loading custom rubygems available online. Don't forget to install them on your system to test the rubygems!
High Level Programming Languages Usually Are Not as Fast as Low Level Ones!
Even so languages like Ruby (version 2.x and above) really care about speed and get improved every single time they find a way to do so. Yeah, that's the price you pay for making a language as human readable as possible. Still, Python, Ruby and others let you compile your code to bytecode to make them run in no time. They can also be compiled if needed. Compiling stuff makes it a closed project for average users like you. High level languages actually let you extend a language at some specific point or at any time in Ruby's case! You're free to create as many classes and modules are you wish.
Do Not Rely on Global $Variables!
Most of the time newbies come up with their so called amazing scripts but forget one thing... They create too many $variables!! That's a hard blow for your game! You could end up cutting off its head... if it ever had any. They consume most resources so spare them as much as possible. Only depend on them if you excessively need dinamic loading or stuff updating. In my experience changing stuff like $game_temp might end up getting quite ugly in the RM series. Still, you could load stuff like items list to a module's variable if you wanted.
X Y Coordinates
Thank Descartes for his contribution since he let us use them in silly stuff like videogames. In the RM series you set a sprite or window or event at some coordinate by setting their x and y cartesian coordinate system. In the original version and even in OpenGL rendering IIRC, the X 0 and Y 0 position is located at the lower left corner of your paper or monitor or phone screen. Most applications place it at the upper left corner and the RM series are part of this trend.
In RGSS every single tile has a fixed width of 32 pixels and the same is valid for its height. If talking about maps every single position should be multiplied by 32 to let you know it's real position on the map. On scenes that isn't necessary at all. Curiously there are times when sprites or windows might get placed on screen even if they are supposed to be located outside the current view (called the camera view IIRC). I'm not sure if that's a feature or a bug.
Usually windows ask you to pass one or more arguments concerning its actual coordinates or its width and height. Window_Command only asks you to send it some width and array of strings to be used as labels for every single option you'd ever need. Sprites don't necessarily need that, but you can pass a custom Viewport or later on call their setter methods to define its x and y coordinates. Their default values are well known, they're 0 and 0.
Passing Strings as Arguments
If you want to pass anything that is not a string to let the RM print it, use the .to_s method by appending it there. There's also a feature called interpolation and printf but they might be kind of advanced for most people. The only valid exceptions to this rules are puts and print, they might get ANY value and they'll try to print it at all costs.
Fear the Devious Loops!
Never place methods or complicated stuff there, especially if you don't need to keep updating them every single frame! Every single unnecessary stuff located there will slow down your script! So don't even dare to place a second or third loop there ever!!
Your Main Task
All scene scripts need a main method. Either you define it in your class or its parent class but you can never ever skip it! You won't see anything related to it if you never defined it! Actually your game should crash immediately! Never include a main method in Sprites or Windows!!
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE