Status
Not open for further replies.

ArbalestSD

Villager
Member
Joined
Jun 15, 2020
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMV
I once again come to you with what is probably a pretty obvious mistake, but I can't figure it out. So when I start my game normally (new game) everything works just fine. What I want to do is modify:
JavaScript:
Scene_Map.prototype.isReady

So I add the following code:

JavaScript:
_DynamicCharacterSprite__Scene_Map_prototype_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function(){
    _DynamicCharacterSprite__Scene_Map_prototype_isReady.call(this);
}

As far as I can tell this code should literally do nothing. Right now it should just intercept the normal call for 'Scene_Map.prototype.isReady' and then call the actual function 'Scene_Map.prototype.isReady' and looking at the debugger, that is what is happening.
However, my game won't start anymore. If I start a new game with the only change being that added bit of code the game will get stuck in an indefinite loading screen.
1638216522457.png
What is going on here? Why does it do that and how do I prevent it from getting stuck in an infinite loop?
 

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
152
Reaction score
126
First Language
German
Primarily Uses
RMMV
Your code will work if you change it to the following:
JavaScript:
_DynamicCharacterSprite__Scene_Map_prototype_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function(){
    return _DynamicCharacterSprite__Scene_Map_prototype_isReady.call(this);
}

The original isReady-function returns if the scene is ready - apparently this is used to determine how when it is no longer necessary to show the 'now loading' - screen. You intercept that with your own function. And while you do call the original, you don't pass on the value it returns. That currently just vanishes into the void.

Of course the return statement will cause the function to end. So if you want to execute some code after the call to the original function you need to do something like this:
JavaScript:
_DynamicCharacterSprite__Scene_Map_prototype_isReady = Scene_Map.prototype.isReady;
Scene_Map.prototype.isReady = function(){
    var result = _DynamicCharacterSprite__Scene_Map_prototype_isReady.call(this);
    //your custom code goes here
    return result;
}
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,735
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Micro rant. The worst part of working from home when you live with your family is seeing how inconsiderate they are. "Hey, you're sitting in front of your computer, that means you're not doing anything! I want to put the TV at 200 decibels!"

If I was working in the office would you still talking me like that?
It's definitely discouraging when streamers give a try-to-say-it-nicely (i.e. bad) review of your game demo. It's like jumping into a cold pool. Bad initally, but it gets better with time. And you are now more alert and see better.
Some screenshots of the pub and lodging with the beginnings of clutter taking shape
TTp8uCw.png

jtC202e.png

bSXgyVl.png

eRx9PUF.png
Backgrounds are not my strong suit... :kaodes:
DazI8jt.jpg

Just realized I forgot doing the clouds... woops
Went to get some stuff for February 10, the birthday of my favorite ink monster...
I have a little one-person party for Bendy every year, complete with the life-size plushie I made. And yes, I bake a birthday cake!

Forum statistics

Threads
118,503
Messages
1,116,439
Members
155,503
Latest member
holydark1031
Top