ThreeSixNine

Veteran
Veteran
Joined
Jan 22, 2019
Messages
276
Reaction score
238
First Language
English
Primarily Uses
RMMV
Greetings makers!

I am running into some issues while working with Yanfly's Common Event Menu. I am using a couple different Yanfly plugins to show various information in a custom menu;
YEP_MessageCore,
YEP_MessageEvalText,
YEP_CommonEventMenu,
YEP_X_CEMSetupPack2.
-NOTE- YEP_X_CEMSetupPack2 is only used for the menu layout.

The issue is with the functions drawText and drawGauge in the \evalText<<>> portion of my subtext comment returning an 'Undefined' string because I'm using the 'this' keyword to call the functions.

Here's the code I used to draw some of the text:
JavaScript:
        \I[97]                   \evalText<< var text = $gameVariables.value(131); this.drawText(text, this.width / 2, 176, 48, 'left')>>                 \evalText<<var text = $gameVariables.value(121); text.padZero(4)>>/\evalText<<var text = $gameVariables.value(131) * 100; text.padZero(4)>>

        \I[105]                   \evalText<< var text = $gameVariables.value(133); text.padZero(2)>>                 \evalText<<var text = $gameVariables.value(123); text.padZero(4)>>/\evalText<<var text = $gameVariables.value(133) * 100; text.padZero(4)>>

        \I[103]                   \evalText<< var text = $gameVariables.value(134); text.padZero(2)>>                 \evalText<<var text = $gameVariables.value(124); text.padZero(4)>>/\evalText<<var text = $gameVariables.value(134) * 100; text.padZero(4)>>

Here's the code I used to draw the gauges and hide the 'Undefined' string:
JavaScript:
\px[999]\py[999]\evalText<<console.log(this, this.width, this.height, this.lineHeight()); var x = 348; var y = 140; var width = 180; var rate = $gameVariables.value(122) / ($gameVariables.value(132) * 100); var color1 = 'red'; var color2 = 'yellow'; this.drawGauge(x, y, width, rate, color1, color2);>>
\evalText<<console.log(this.width, this.height, this.lineHeight()); var x = 348; var y = 176; var width = 180; var rate = $gameVariables.value(121) / ($gameVariables.value(131) * 100); var color1 = 'red'; var color2 = 'yellow'; this.drawGauge(x, y, width, rate, color1, color2)>>
\evalText<<console.log(this.width, this.height, this.lineHeight()); var x = 348; var y = 212; var width = 180; var rate = $gameVariables.value(123) / ($gameVariables.value(133) * 100); var color1 = 'red'; var color2 = 'yellow'; this.drawGauge(x, y, width, rate, color1, color2)>>
\evalText<<console.log(this.width, this.height, this.lineHeight()); var x = 348; var y = 248; var width = 180; var rate = $gameVariables.value(124) / ($gameVariables.value(134) * 100); var color1 = 'red'; var color2 = 'yellow'; this.drawGauge(x, y, width, rate, color1, color2)>>

Here's an Image of the Menu and the undefined string:
MasteryMenuHelp.png

I can't figure out how to call these functions without 'this' and I can't figure out how to remove the 'Undefined' string without breaking the gauges.

The gauges issue is actually easily solved as I can move the 'Undefined' text off the visible layer with the \px[999] and \py[999] escape codes provided by the Message Core.

I'd like to be able to remove the undefined from the drawText(); to keep all the data aligned as the values change. The current setup, using text.padZero(); works but I believe it could be better.

I've tried using many other ways of calling the drawText() function but nothing has worked yet.
 

Latest Threads

Latest Profile Posts

I'm working on a modding system of my game and I screw the game up, so hard that I have to access my backup in my hard drive ;-;
Stop shutting the damn power down! Why always like this
Working on a slightly experimental horror game. It will be finished in approximately 88888888888 years.
Y'all will enjoy it though, I put lots of effort into making it stand out.

It's called Red Light and it's inspired by another obscure RPG Maker horror game, but I don't want to give too much away just yet.
Ohh man, Weapon animations plugin feels so mandatory. Seeing that same image regardless of the icon of the weapon....ugh :p
Ok so......Maaaaybe I've taken a ''little'' bit of inspiration from FF9 when it comes to battle hud xD

ff9.PNG

Just maybe....

Forum statistics

Threads
112,357
Messages
1,067,716
Members
146,004
Latest member
Faxify
Top