RPG Maker Forums

hi am trying add a global prototype to all my object.

ex:
if I create some new object in $Gamevariable. for fun

Code:
var NewPid = 20;
$gameVariables.Hud_PinBoard = new Hud_PinBoard(NewPid);
var NewPid = Preload_Hud_PinBoard(); // return the new PID

$gameVariables.Hud_Displacement= new Hud_Displacement(NewPid);
var NewPid = Preload_Hud_Displacement(); // return the new PID

$gameVariables.Hud_Info= new Hud_Info(NewPid);
var NewPid = Preload_Hud_Info(); // return the new PID
now i have all my object with specifique proprety and method in
Code:
$gameVariables.Hud_PinBoard
$gameVariables.Hud_Displacement
$gameVariables.Hud_Info

Now I would like add a global prototype, for all those objects
example this methods
Code:
function A(a, b,c) {
this.XY = [a,b,c];
}
how i can add this method for make example this call operational
Code:
$gameVariables.Hud_PinBoard.A(a,b,c); // change the proprety this.XY in the object Hud_PinBoard
$gameVariables.Hud_Info.A(a,b,c); // change the proprety this.XY in the object Hud_Info
i try add this prototype
Code:
Game_Variables.prototype.A = function A(a, b,c) {
this.XY = [a,b,c];
}
ist work only if i call
Code:
$gameVariables.A()
but no if i call
Code:
$gameVariables.Hud_Displacement.A(); // return undefined
Why ?

Tell me if I'm not clear
thanks a lot to help me more understand js

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top