why i can't overwrite rpg_scene function?

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Hi there : )
I tried to make a simple plugin that overwrite a function from rpg_scene.js
but it doesn't seem to work = |
for example:
Scene_Title.prototype.update = function() {
};
i put this plugin at bottom of my plugin list,
it should ruin the title scene but nothing happen = |
so ... why is that, can someone tell me please?
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,720
Reaction score
1,198
First Language
Greek
Primarily Uses
RMVXA
You'll need to do this:

Code:
this.Scene_Title.prototype.update = function(){

};
Adding the word "this." tells the interpreter to use this function instead of the one in rpg_scene.
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
You'll need to do this:

Code:
this.Scene_Title.prototype.update = function(){

};
Adding the word "this." tells the interpreter to use this function instead of the one in rpg_scene.
Thank you for the answer,
but it still doesn't work = |
i tried this but nothing happen
this.Scene_Title.prototype.update = function() {
};
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,637
First Language
Czech
Primarily Uses
RMMV
Adding the word "this." tells the interpreter to use this function instead of the one in rpg_scene.
Wrong. Whenever there is a new definition of an already defined function, it overwrites the previous one, therefore the keyword this has no use. Also, the keyword this has a completely different meaning, it's related to object oriented programming.

It should be working if everything is alright, So, is the plugin on?
Are there no syntax errors in the plugin? (most probable reason. Could you share the function?)
Is it in the correct folder?
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Hi @Poryg =)
It should be working if everything is alright, So, is the plugin on?
Are there no syntax errors in the plugin? (most probable reason. Could you share the function?)
Is it in the correct folder?
Yes, this is all of the plugin:
//=============================================================================
// master2015hp_delaytitlecommand.js
// by master2015hp
// 2018.08.31
//=============================================================================
/*:
* @plugindesc delay title command
* @author master2015hp@gmail.com
*
* @param wait_time
* @desc waiting time in frames
* @type number
* @min 0
* @max 9999
* @default 20
*
* @help
* delay appearance of Title Commands/ modify parameters as you will/ min = 0
*
* -----------------
*
*/
var parameters = PluginManager.parameters("master2015hp_delaytitlecommand");
var cke.wait_time = parameters["wait_time"];

Scene_Title.prototype.update = function() {
this.ckex = this.ckex || 0;
this.ckex++;
if (!this.isBusy() && this.ckex > cke.wait_time) {
this._commandWindow.open();
}
Scene_Base.prototype.update.call(this);
};
I am sure that i put it inside plugins folder & turned ON + put it at very last of plugins list =|
But it just doesn't work =(
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,637
First Language
Czech
Primarily Uses
RMMV
var cke.wait_time

that line is wrong (contains a syntax error). By var you define a variable, not an object property.
Transform the code to
Code:
var cke = cke || {}; // checks if cke object is defined and if not, it defines it
cke.wait_time = parameters["wait_time"]; // defines the cke's property "wait_time"
it should work afterwards.

You would have seen the error if you had opened the dev console with f8 in game btw.
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
ah yesss! the bad habit of naming variables randomly! (∥ ̄■ ̄∥)
Thanks @Poryg
You're right, the error right there in console.
I just didn't think about open console to check since the game wasn't crashed or anything.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,637
First Language
Czech
Primarily Uses
RMMV
Whenever there's spmething wrong, console should be the first thing to check :p
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People1.png & SF_People1.png added!!!!

Adventurer:
"Why your body looks like a bird?"

Stranger:
"Because I'm harpy"

Adventurer:
"Clap along if you feel like a room without a roof"

*Both dancing to Pharrell Williams song*
Stream will be live shortly with a make-up session of the Interactive Text Adventure! Feel free to drop by!
Pootscooter wrote on Pharonix's profile.
Hey @Pharonix, just wondering what you're up to lately and if you've had an opportunity to check out the LTBS thread in the past few days...(a couple of us could really use your expertise). Hope you are well and Happy Thanksgiving!

Forum statistics

Threads
105,506
Messages
1,014,263
Members
137,173
Latest member
zoetsoi
Top