RPG Maker Forums

I have some problem with my script, umh i want to make a plugin command to switch off and on the image on the map. Here is my plugin:

var param = PluginManager.parameters("KAX_RealisticRain.js");
var RainGraphic = String(param['RainGraphic'] || "rainc6");
var RainSpeed = Number(param['RainSpeed'] || 3);
//=======================================================================
var alias_GI_plugincommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
alias_GI_plugincommand.call(this, command, args);
if (command === 'startRain') {
switch (args[0]) {
case '1':
RainSpeed = 1;
this.image.origin.y -= RainSpeed;
break;
case '2':
RainSpeed = 2;
this.image.origin.y -= RainSpeed;
break;
case '3':
RainSpeed = 3;
this.createRain();
break;
case '4':
RainSpeed = 4;
this.image.origin.y -= RainSpeed;
break;
case '5':
RainSpeed = 5;
this.image.origin.y -= RainSpeed;
break;
case '0':
SceneManager.push(Scene_Map);
break;
};
};
};
//===========================================================
function Window_Rain() {
this.initialize.apply(this, arguments);
}

Window_Rain.prototype = Object.create(Window_Base.prototype);
Window_Rain.prototype.constructor = Window_Rain;

Window_Rain.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};

Window_Rain.prototype.windowWidth = function() {
return 816;
};

Window_Rain.prototype.windowHeight = function() {
return 624
};

Window_Rain.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
};

Window_Rain.prototype.createRain = function() {
this.image = new TilingSprite();
this.image.bitmap = ImageManager.loadPicture(RainGraphic);
this.image._onBitmapLoad();
this.image.move(0, 0, Graphics.width, Graphics.height);
this.image.opacity = 70;
this.addChild(this.image);
this.updateRain();
};

Window_Rain.prototype.updateRain = function() {
this.image.origin.y -= 3;
};

Window_Rain.prototype.update = function() {
Window_Base.prototype.update.call(this);

};

Window_Rain.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};
//====================================================================
var ailias_SC_start = Scene_Map.prototype.start;
Scene_Map.prototype.start = function() {
ailias_SC_start.call(this);
this.windowrain = new Window_Rain(0, 0);
this.windowrain.opacity = 0;
this.addChild(this.windowrain);
};
//=====================================================================


I run my code with Plugin Command is startRain 3 and it gets errors below: 




I have just begin with creating MV plugin, i really don't know where i was wrong or maybe, i missed something. Sorry for bad english (i am an asian), i will be very appreciate if anyone can help me with my plugin, thanks in advance.

Latest Threads

Latest Posts

Latest Profile Posts

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.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top