Yanfly's Enh TP Vs SSG Item Sort

Koru-chan

Veteran
Veteran
Joined
Jul 30, 2012
Messages
43
Reaction score
16
First Language
English
Primarily Uses
RMMV
I'm trying to use Yanfly's Enhanced TP for a project.  It runs just fine with every other plugin I'm using. Until I activate SSG Item Sort.  If I go to my TP Mode menu option, I get the error "Cannot read property "0" of undefined".  I'm not sure what it means.  Anyone know how I can fix this?
 

izyees

My Secret Santa
Veteran
Joined
Oct 24, 2015
Messages
248
Reaction score
67
First Language
english
Code:
//Save as anything js.
(function () {
	if (SSG_Heartbreak !== undefined) {
		var parameters = $plugins.filter(function (plugin) {
				return plugin.description.indexOf('<SSG_ItemSort>') != -1;
			})[0].parameters;
		var sM = String(parameters['Sort Mode'] || 'descending');
		SSG_Heartbreak.itemSort = function (list) {
			list.sort(function (a, b) {
				var result;
				if (sM.toLowerCase() === 'ascending') {
					if (a.sortValue !== undefined && b.sortValue !== undefined)
						result = a.sortValue[0] - b.sortValue[0];
					if (result === 0) {
						if (a.sortValue !== undefined && b.sortValue !== undefined)
							result = a.sortValue[1] - b.sortValue[1];
					}
				} else {
					if (a.sortValue !== undefined && b.sortValue !== undefined)
						result = b.sortValue[0] - a.sortValue[0];
					if (result === 0) {
						if (a.sortValue !== undefined && b.sortValue !== undefined)
							result = b.sortValue[1] - a.sortValue[1];
					}
				}
				if (result === 0) {
					if (a.sortValue !== undefined && b.sortValue !== undefined)
						result = a.id - b.id;
				}
				return result;
			})
		};
	}
})();
 
Last edited by a moderator:

Koru-chan

Veteran
Veteran
Joined
Jul 30, 2012
Messages
43
Reaction score
16
First Language
English
Primarily Uses
RMMV
Thank you so much! Works perfectly.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top