lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
160
First Language
English
Primarily Uses
RMMZ
[ THE ISSUE ]
TypeError: Undefined is not a function

[ THE RESULT ]: Fixed

* The problem was I translated the entire comments section using Google Translate, and therefore it messed up some of the plugin parameters (like the RGBA sections to #,#,#.0 instead of #,#,#,0) for example. So the script wasn't reading "." when it should be reading "," :)
 
Last edited:

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
160
First Language
English
Primarily Uses
RMMZ
[ UPDATE 2 ]
Curious. Bringing back the original and making the changes this time didn't produce any results. Still getting the error. So I've no clue what I did to make it work lol. Will keep trying until someone else figures it out or if I do.

[ UPDATE ]
Not really meant as a 'bump' as per rules, but just to notify that I've found something. Going through the code, I've placed a few semicolons in places where I'm used to them being, and it seemed to have fixed the issue... however, I'm not exactly sure how much is too much. Most of the code seems to be inconsistent.

I see code that goes like:
if(condition) {function.sub;};
if(condition) {return true}
if(condition) {this._function() }; and
if(condition) {function();}

And I'm not 100% sure what's supposed to be what. I'm going to try ONLY putting semicolons on the alias methods, and see if that works. (Will update this post instead of adding yet another one) to notify of results.
 
Last edited:

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
160
First Language
English
Primarily Uses
RMMZ
*Bump* Still can't figure this out. Pulling my hair out lol
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,373
Reaction score
8,395
First Language
German
Primarily Uses
RMMV
Usually "undefined" has only a few specific causes, and most of them don't require any change in code to solve.

The most common cause is to have loaded an incompatible savefile. Adding a plugin makes older savefiles incompatible in most cases, so you need to start a new game before the new plugin can work correctly.

Second most common problem is incompatibility with another plugin you installed - sometimes this can be solved by changing the plugin order, sometimes you need a specific compatibility patch between the two plugins written and sometimes nothing can be done.
But to solve this, you need to find and name the other plugin that is involved.
The easiest way to do that is to check the console (F8) when the error happens - which is why we always ask for a screenshot of the console in addition to the simple error message you gave.

Third most common cause is wrong configuration of either the plugin properties or the notetags - again best solved with a screenshot of what you did, but at this time there are too many possible options to say where to check.

An undefined error is almost never a problem in the code of the plugin reporting it - that would only be the case if the plugin itself was never finished and tested, and Moghunter doesn't release untested plugins.
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
160
First Language
English
Primarily Uses
RMMZ
Andar:

Thanks for the reply at least, but I know #1 and #2 aren't applicable in this case (unless MOG's scripts are incompatible with themselves), and have no save file (this is a purely "Test" project only with the Time System, Time System HUD, and Weather EX plugins). Again Have put Weather EX in, no issue; Time System with Weather EX, Time System without WeatherEX, TimeSystem w/out the HUD. it's just... Time System in general I'm getting the errors :\

Did the debug thing and these are the errors I got:
8Kxv0CB.png


Looking at this, everything seems to lead back to setup_time_system, but I can't see anything wrong with it o_O "var s = value.split(',');" is the line the error refers to, but just in case, included the function header as well since I know sometimes errors are thrown up from previous lines in code.

Code:
Game_System.prototype.set_time_var = function(object,value,type) {
    var s = value.split(',');
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,373
Reaction score
8,395
First Language
German
Primarily Uses
RMMV
that sounds as if you configured the wrong variables in the plugin properties or whereever Mog sets them - can you show us a screenshot of your configuration of the plugin?
"Split(',')" means that it takes a string seperated with commas and splits the different parts of that string to get data - and that usually means it tries to get data from a notetags string and gets confused because that string either doesn't exist or is formatted in the wrong way.

I don't know if it is a string read from a notetag or from a plugin property, but it can only be one of the both - and it is a string you either wrote wrong or forgot to write, so you need to check your configuration of the plugin.
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
160
First Language
English
Primarily Uses
RMMZ
Well the plugin and settings were all copied from MOG's demo project, I haven't written or modified anything so I could get an "accurate" test project to upload here (in OP). And yeah I know what Split(',') means :) I am still a 'novice' scripter by comparison, but I've meddled with the C language for 10 years in Neverwinter Nights (or what C-language they have available there), intro to Java, intro to programming, all fun stuff ^_^ But yeah, by the looks of it, it's referencing a plugin data. the script has a function to obtain Notetag data separately.

NOTE: At a glance I thought because the days of week were set with spaces (ie. 'Sunday, Monday') I tried putting them without spaces:
'Sunday,Monday', but that still didn't do anything. Following the screenshot I put in Code and Spoiler the two functions I think I've narrowed the problem to, but can't understand what might be wrong. I don't know, I feel pretty strongly I think there might be an error in the code itself (despite how reputable Moghunter himself may be), but I haven't been able to get the plugin working "out of the box" so something is conflicting or not working right :\

Here's the screenshot with all the defaulted settings:
9a1e7110-a58b-4631-ad08-3f198cb476bc
kIkahv5.png


//==============================
// * Setup Name TM
//==============================
Game_System.prototype.setup_name_tm = function() {
this._day_week_names = [];
this._season_names = [];
this._month_names = [];
this.set_time_var(this._day_week_names,Moghunter.day_week_names,0);
this.set_time_var(this._season_names,Moghunter.season_names,0);
this.set_time_var(this._month_names,Moghunter.month_names,0);
};

//==============================
// * Setup Tone TM
//==============================
Game_System.prototype.setup_tone_tm = function() {
this._tone_data = [0,0,0,0];
this._day_phase_tone = [[],[],[],[],[],[]];
this.set_time_var(this._day_phase_tone[0],Moghunter.sunset_tone,1);
this.set_time_var(this._day_phase_tone[1],Moghunter.day_tone,1);
this.set_time_var(this._day_phase_tone[2],Moghunter.dusk_tone,1);
this.set_time_var(this._day_phase_tone[3],Moghunter.night_tone,1);
this.set_time_var(this._day_phase_tone[4],Moghunter.dawn_tone,1);
this.set_time_var(this._day_phase_tone[5],Moghunter.sunrise_tone,1);
};
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
301
Reaction score
160
First Language
English
Primarily Uses
RMMZ
EDIT2: Nevermind my other Edit (deleted), Fixed the issue finally. Apparenlty when I edited the alias from setupNewGame = skipNewGame (as per my SkipTitle plugin), I forgot to also rename the MAIN function:
DataManager.setupNewGame = function() blahblah, etc.
^ fixed that line and it all works normal now <3

Thank you so much for your help and me being a dummy :p I should've done this a long time ago (deleting/putting in fresh demo plugins) instead of trying to figure out what the errors are referring to >_> *sighs*
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

having anxiety during all this virus stuff is the absolute worst. I'm the only one missing out on my friend's wedding in Sept. because I can't be in large groups of people anymore due to anxiety.
Well... I just spent most of the day making something I cant even use xD

Hero_1.png
The idea was to look at the original but at a medium distance.
In hindsight, I might as well have just edited the original lol... I didn't intend for it to end up so similar.
does anyone else feel tired after completing a sprite?
Fun fact: I always lower every tileset saturation (about 15%-25% of it) in my projects.

Forum statistics

Threads
113,903
Messages
1,078,316
Members
148,002
Latest member
Silvernimbus
Top