game_variables vs gameVariables etc in scripts

alphawiz

Veteran
Veteran
Joined
Feb 8, 2017
Messages
67
Reaction score
10
First Language
English
Primarily Uses
RMMV
In my research and in reading the forums and various pages put online by many of you, I keep coming across references to variable names like $game_variables, $game_party, etc, yet whenever I have tried to use these values they give undefined reference areas or other errors.

How is it that some people can use them and some can't? Am I missing something, or is this just VX users writing code for MV users and not knowing the variable names? Is there a comprehensive reference put out by Kadokawa ?
 

JtheDuelist

Your Friendly Nieghborhood Stygian Zinogre
Veteran
Joined
Dec 9, 2017
Messages
1,185
Reaction score
1,440
First Language
English
Primarily Uses
Other
@alphawiz It is a matter of the programming language- VX/VXAce uses Ruby, while MV uses JS. They are writing the plugins as if it were in Ruby, not JS.
 

alphawiz

Veteran
Veteran
Joined
Feb 8, 2017
Messages
67
Reaction score
10
First Language
English
Primarily Uses
RMMV
That makes sense. Unfortunately, it doesn't make it any easier when trying to follow coding examples, though. LOL
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,422
First Language
English
Primarily Uses
RMXP
Actually, it makes things easier because it's usually pretty easy to identify whether it's for XP/VX/VX Ace or if it's for MV.
That's much better than the alternative where the code looks similar but actually works differently.
 

alphawiz

Veteran
Veteran
Joined
Feb 8, 2017
Messages
67
Reaction score
10
First Language
English
Primarily Uses
RMMV
It may be easy for people who are familiar with XP/VX/VX Ace. Having not seen any of them, I can't tell the difference. I'm not that familiar with Ruby and honestly, a lot of the scripting languages look very similar when dealing with basic assignment and statements and function calls.

Too bad the RPG Maker developers didn't use names like MV_Varname and VXA_Varname huh? :)

I've been trying to find reference guides and there just don't seem to be any. If anybody has a link, I'd love to get it. (RPG Maker MV only!)
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
Just an FYI: There's no requirement to write variables like_this in Ruby or likeThis in Javascript, it's just the preferred style, and the RPG Maker developers followed each style.

You may see some early plugins for MV by former Ace users that use the "wrong" style, although it is still perfectly valid syntax.

If you're following a VXAce tutorial, and replace all instances of game_variables to gameVariables, it probably still won't work because built-in methods are different between Ruby and Javascript.

Best to try to use MV-specific tutorials wherever possible.
 

alphawiz

Veteran
Veteran
Joined
Feb 8, 2017
Messages
67
Reaction score
10
First Language
English
Primarily Uses
RMMV
Oh, I know the syntax is valid, it's the fact that the variables don't exist when you try to reference them and it throws an error like 'undefined is not a function" or "unknown" or some such. Errors like that tell me that it's not a valid variable as far as MV goes. It's not as if they're interchangeable.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
How is it that some people can use them and some can't?
same way some people can translate French into English, or Spanish into Portuguese :D

It's not as if they're interchangeable.
they are, and they are not.
an object identifier in Ace that references the same object in MV may be named differently, but if you unify both under one denomination, they'll always reference *the same object*

*the opening onto a wall to fit a movable separator mounted on hinges*, will always be *a door*, name it in English, German or Chinese.
 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
163
Reaction score
243
First Language
French, German
Primarily Uses
RMMZ
Is there a comprehensive reference put out by Kadokawa ?
I don't know about that, but you can easily see what those variables are called by looking into rpg_managers.js, where they're declared at the very beginning:
Code:
var $dataActors       = null;
var $dataClasses      = null;
var $dataSkills       = null;
var $dataItems        = null;
var $dataWeapons      = null;
var $dataArmors       = null;
var $dataEnemies      = null;
var $dataTroops       = null;
var $dataStates       = null;
var $dataAnimations   = null;
var $dataTilesets     = null;
var $dataCommonEvents = null;
var $dataSystem       = null;
var $dataMapInfos     = null;
var $dataMap          = null;
var $gameTemp         = null;
var $gameSystem       = null;
var $gameScreen       = null;
var $gameTimer        = null;
var $gameMessage      = null;
var $gameSwitches     = null;
var $gameVariables    = null;
var $gameSelfSwitches = null;
var $gameActors       = null;
var $gameParty        = null;
var $gameTroop        = null;
var $gameMap          = null;
var $gamePlayer       = null;
var $testEvent        = null;
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,585
Latest member
Reversinator
Top