RMMV Cannot read property 'TextColor' of undefined.

Status
Not open for further replies.

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,297
Reaction score
690
First Language
German
Primarily Uses
RMMV
i get this error , because of 2 plugins which are not mentioned in the error message.

plugin1 displays state icons on map events
(and updates them)

plugin2 uses "weapon/armor/item" -icons and displays them in $gameMessages after a steal skill happened
(for the steal result text)

So i am pretty sure this has something to do with displaying Icons and its frame updates

The error happens right after the Text was displayed that used such icon in its message:

(and that only happens if Plugin1 updates the frameCharacter of the displayed state icons)
=> strange thing is, it just happened also on other "result messages" which doesnt use icons such as "Failed" or "There is Nothing to Steal"


-> i was thinking about using a "debug - switch" to avoid the updates of the state icons when the text is displayed, but its quite hard to get the right timing, cose the errors happens after the message was displayed,,

Perhaps there might be any other better solution to fix this Issue?
any ideas are very welcome!


If needed i could post the 2 plugins which i mentioned..
-> but i am not sure if thats required, perhaps i missunderstand the Bug completly idk..
error img:
Screenshot_1.png


edit
there is also another thread related to this, but its not answered or solved properly..
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,930
Reaction score
10,513
First Language
German
Primarily Uses
RMMV
The key to the error message is "of undefined" - which basically means that the engine tries to access a dataobject that does not exist.

this is usually a missing configuration - a plugin set to use a default object that does not exist in your database because you forgot to configure the plugin.
in some cases this happens not because of a missing configuration but because you loaded an older and now incompatible savefile - the configuration of a new plugin never changes older savefiles, so they're missing that data.
the third possible cause is a wrong order of plugins, especially if those are yanfly plugins. Yanflys plugins have to be in exactly the order given on his website, or they will result in strange errors like this one.

If these tips don't help you in finding the cause, we need screenshots of your plugin manager to see your entire list of plugins.
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,297
Reaction score
690
First Language
German
Primarily Uses
RMMV
my yep plugins are in the right order..always
(and they are above everything else)

the info "textColor" tells me that it is "$gameMessage" related

and i know from enabling/disbling plugins or single plugin functions, that this error only happens if the"State Icons"(new Sprite_StateIcon()) get updated with :
"Sprite_Character.prototype.updateCharacterFrame = function() {"

i could show my pluginmanager but it is really long, and i already tried to switch the positions of the 2 mentionened plugins,which doesnt change anything
I didnt tested that with a "no plugins"-Project and only using the 2 mentioned Plugins but i bet that would be the same issue,because it also triggers default rpg plugins
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,465
Reaction score
16,386
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.



because of 2 plugins which are not mentioned in the error message.
Why would you think that? If that's really true, we can't help you if you don't tell us what the plugins are.

the info "textColor" tells me that it is "$gameMessage" related
This is an assumption only. From the below, I can tell that's not correct.

Code:
    return SceneManager._scene._statusWindow.textColor(n);

This is the line that's generating the error. It indicates there is no _statusWindow on the current scene.
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,297
Reaction score
690
First Language
German
Primarily Uses
RMMV
[move]Plugin Support[/move]


Why would you think that? If that's really true, we can't help you if you don't tell us what the plugins are.
the plugins are :
SRPG_EnemyEquip.js from my github and
ill attach the other one here


because this only happens if i use both plugins at the same time..
and it also only happens if my "enemyEquip"-plugin triggers the "result message" of an Steal skill..
(steal skill is part of my plugin)
before that skill is used, other skills dont trigger the error..

..and if disabling the :
"Sprite_Character.prototype.updateCharacterFrame = function() {"
from SRPG_UnitMapInfo, the error wont happen aswell..

the only thing both plugins have in common is that they display Icons on map
(one displays state icons, the other displays "weapon/armor/item"-icons)


edit

This is the line that's generating the error. It indicates there is no _statusWindow on the current scene.
i dont understand why the system is assuming that any statusWindow should be displayed anyway.. This happens in an mapScene
 

Attachments

  • SRPG_UnitMapInfo.js
    10.8 KB · Views: 0
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,930
Reaction score
10,513
First Language
German
Primarily Uses
RMMV
my yep plugins are in the right order..always
if that is really true, then you have a version conflict in your yanfly plugins - either one of those plugins or your project core is a too old version.

Because the error lists all javascript files involved in it. If a plugin is not listed as part of the console error trace, then it has absolutely nothing to do with the error - no matter what you believe or assume about it.
And since the backtrace only lists core scripts and yanfly scripts, this limits the cause of the error to:
1) wrong order of those yanfly plugins
2) wrong/old versions either in one of those plugins or the engine core
3) using incompatible saves with old data.

so no, the SRPG files are NOT involved in the error - not unless it is an incompatible savefile that causes it, because the savefiles can contain old configuration data from different plugin configurations. And such older data can collide with newly added plugin without mentioning those plugin names in the trace (because those plugins were not there when the savefiles were created).
So does the error happen on new game, on loading a savefile or in both cases?
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,297
Reaction score
690
First Language
German
Primarily Uses
RMMV
(...)


So does the error happen on new game, on loading a savefile or in both cases?
my tests where alway on using the new game option in my test project

- it might be possible that i use old rpg engine core plugins (v1.6.1 (community-1.3b)

I understand that in most cases all plugins that are related to an error should be displayed there, but i had situations where that wasnt the case
..mostly if editing scrips and these edits do things that can not work by default
--> in such cases any update chain gets mad and triggers the error

-> also if using those 2 SRPG plugins together would not be the cause, than the error should happen aswell without using these plugins...
(thats not the case)

==> more detailled :

the only thing that triggers the error is using my plugins "steal"-skill & its "result message" while at the same time letting the other plugin use :
"Sprite_Character.prototype.updateCharacterFrame = function() {"
-> to update the Sprite&frame of "state Icons"
 
Last edited:

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,297
Reaction score
690
First Language
German
Primarily Uses
RMMV
ok i figured it out!

there were 3 reasons together ,making this error;

1. the "display-stateIcon plugin",
Invoking StateIcon stuff ..
2."Yep buffstateCore"
having a function that asumes the menu status window scene is active if "state icon gets updated"
3.My plugin
triggering the updatechain for the YepBuffstatesCore, by loading other icons

So indeed it wasnt only the 2 plugins which i assumed to be responsible

i solved this by adding some code to the "display-stateIcon plugin"..
->this code replicates the gameAction that checks the Skill meta for steal skill and sets a "_PluginsVarSwitch" to "false" if StealSkill meta is "true"
(from my Plugin)
-> then the YepBuffStatesCore Function gets replaced (overwritten) and only triggers if switch is "true"
( this function should only trigger in a completly different scene anyway)
-> and adding the same switch is "true" condition, to the "update frame"-function from the "display-stateIcon plugin"
-> the Switch will be reseted to "true" in the srpg_map_scene "after action",
That way the Switch only disables the update chain for the few moments of the "Steal_battleAction"..

i tried aswell to remove each *switch = "true" Condition* , to look if its really required ect.. and yes each of these changes were required !

(i removed other changes that were not required)

So in my case it was 3 plugins together doing the Issues,..but i asume that in other cases this "yep buffstatescore" function can do similar Errors for others.
Because it assumes without checking the scene which is active.. that we are in the
"status window scene"..

( since Yep is one of the best scripters known in this forum, i dont understand why such mistake was made ,but I am a JS noob so ,who cares^^ )
->But it would probably be better to change this code, & checking the scene first before asuming that this scene is active


JavaScript:
// default -> caused error together with the 2 other plugins
Sprite_StateIcon.prototype.textColor = function(n) {
    return SceneManager._scene._statusWindow.textColor(n);
};

// maybe a better solution:
Sprite_StateIcon.prototype.textColor = function(n) {
    if (SceneManager._scene._statusWindow) {
        return SceneManager._scene._statusWindow.textColor(n);
    }
};
// Not tested!! my solution used a switch anyway^^
// but try this if you get a similar Error,
// with this first default Code from YEPsBuffStateCore

perhaps a mod could attach this info to the other thread which i mentioned in the first post ?

(will be reported as solved and can be closed.. also thank you very much
@
Andar
& Shaz )
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,465
Reaction score
16,386
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.



I won't merge it with the other thread, as that's from 2017 so would be necroposting. However, if someone searches for the error message, your thread, with solution, will come up for them.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Has it really been 50 streams? At this point it's just guilting me into pushing out a prototype. :kaoswt:



I should probably just bite the bullet and send it out, then go with my original plan to provide weekly updates.
I know it's just other small RM devs, but it still always feels legitimizing to have folks email me in private with a steam key, requesting a review of their game.:kaoluv: Look ma, I've made it to the big leagues. small edit: another email just came in. :kaoback:
time and time again I enjoy dramatic remarks on how I should find a better job.
As it stands, I go to work for 10-14 days a month. At work, I have time for my private projects. I arrive home, my mind is clear.
So yes, the pay sucks. But I have what so many lose after graduation. Freedom.
Came back cuz of the sale. Got MZ. The System 2 advanced settings for UI are so frustrating, and I see we still hate pixel fonts. Marvelous.
Did another YouTube short. This one has like 1k views (or maybe 380? Analytics is being weird). Getting them zoomer views, yo!

Forum statistics

Threads
129,720
Messages
1,204,651
Members
170,803
Latest member
JimGTz
Top