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
154
Reaction score
130
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,740
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 Posts

Latest Profile Posts

I think it's by time I make use of this feature in the forums. I'm never one to share profile updates or anything the sort, but hey, you gotta start somewhere! I think I'll use this place primarily to post maps actually, so here, have a goblin cave!

PqleoRp.png

Inspired largely by Wynncraft's Aseado Leaf cave
Does anyone know if Yanfly's Ace scripts are still free for use in both commercial and noncommercial projects? Can't find much except for the wordpress Terms of Use, but not sure if it's not outdated.
I just realized two of My series are beginning to look virtually identical to one another in mechanics and general themes, I never had this problem before.

This is Stifling! Must resolve this!
Lord's Reincarnation III (LR3) MOBILE is coming!!!
iu_534706_7630675.png
ScreenShot_1_20_2022_2_19_41.png
Juice FX is amazing... the portal in the middle is actually animated and moves thanks to Juice FX. so I edited part of a map I have and then drew the portal around it. threw it into Juice FX and now it's lively instead of static.

Forum statistics

Threads
118,711
Messages
1,118,098
Members
155,848
Latest member
Xenios
Top