Trying to make NumInput come out!

Ozenky

Villager
Member
Joined
Sep 21, 2018
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
Hello everyone, it is me (again). I am now trying to tinker my way unto Window_NumInput (this is my true purpose) and I kind of ... want to use to to also start learning little by little the Window_Selectable function. I just want the number pad to show up, but I am having a hard time trying to figure out how the library itself work.

I will post my example code and tell me what can I do for the sake of it. Thanks a lot.

(function(){

function Window_MiVentana() {
this.iniciar.apply(this,arguments);
}

Window_MiVentana.prototype = Object.create(Window_NumInput.prototype);
Window_MyVentana.prototype.constructor = Window_MiVentana;

Window_MiVentana.prototype.iniciar = function(messageWindow) {
Window_NumInput.prototype.initialize.call(this,messageWindow);
this.refrescarse();
}

Window_MiVentana.prototype.refrescarse = function() {
Game_Message.prototype.setNumberInput.call(this,0,1);
}

var _Scene_Map_createAllWindows2 = Scene_Map.prototype.createAllWindows;
Scene_Map.prototype.createAllWindows = function() {
_Scene_Map_createAllWindows2.call(this);
this.crearMiniMapa2();
};

Scene_Map.prototype.crearMiniMapa2 = function() {
this._entradaNum = new Window_MiVentana('mensaje');
this.addChild(this._entradaNum);
this.update();
};
})();

P.D.: I want it to show up as soon as the scene shows up. If it doesn't allow me to move on the map it is ok. Once I understand how to make it pop-up I can ... take a look at the library and see by myself. Thanks.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
824
Reaction score
323
First Language
Javascript
Primarily Uses
RMMV
Not entirely sure what you're really trying to do
...standard use of how to open the number input window is like this though...
$gameMessage.setNumberInput(var, digits);

...wrote a little plugin to show you how to open the number input window right away when the "Scene_Map" starts though if that helps...
NumInputOnMapStart: Click Here To Download
...note though in the demo it is called every single to the Scene_Map starts including when returning from the menu.

Edit:
...or after rereading the post perhaps you are trying to like clone the NumInput window?
 

Ozenky

Villager
Member
Joined
Sep 21, 2018
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
Ok, got the plugin to work, but I have a few questions, to see if I am understanding the behavior of what you sent me:
  1. I understand that the plugin that you sent me allows me to call the number input from outside of the plugin also, ¿correct?
  2. You aliased the Scene_Map.prototype.start function so that, when the map is shown, the number input show up
  3. I only need to place this $gameMessage.setNumberInput(varId, digitMax); on any code, and put numbers on varId and digitMax to call the numberInput pad
Please tell me if I am correct. What I wanted is to see the number input to start playing with it, so "summon it" so i can start dissecting the code by myself.

One last question ... ¿why you number input seems different in style than the one the game pops up by itself?

Thanks.
 

Ozenky

Villager
Member
Joined
Sep 21, 2018
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
Not entirely sure what you're really trying to do
...standard use of how to open the number input window is like this though...
$gameMessage.setNumberInput(var, digits);

...wrote a little plugin to show you how to open the number input window right away when the "Scene_Map" starts though if that helps...
NumInputOnMapStart: Click Here To Download
...note though in the demo it is called every single to the Scene_Map starts including when returning from the menu.

Edit:
...or after rereading the post perhaps you are trying to like clone the NumInput window?
Thanks to your pluging, got exactly what I needed to start my tinkering. I will be posting it below this and declare this matter closed. ¡Thanks!

Scene_Map.prototype.start = function(varId, digitMax) {
varId = varId || 1;
digitMax = digitMax || 3;
if (varId) {$gameMessage.setNumberInput(varId, digitMax);}
};

P.D.: because I need to get like deeper in the code to understand it, made a few mods:

Scene_Map.prototype.start = function(varId, digitMax) {
varId = varId || 1;
digitMax = digitMax || 3;
if (varId) {
Game_Interpreter.prototype.setupNumInput.call(this,[varId, digitMax]);
}
}
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
824
Reaction score
323
First Language
Javascript
Primarily Uses
RMMV
I understand that the plugin that you sent me allows me to call the number input from outside of the plugin also
Yep correct :)
1585547294569.png
You aliased the Scene_Map.prototype.start function so that, when the map is shown, the number input show up
yep you got it.
why you number input seems different in style than the one the game pops up by itself?
This was because no text message was being set first (oversight on my part).
Fixed in v1.2 ;)
Thanks to your plugin, got exactly what I needed to start my tinkering.
No problem. Happy to help.

Updated to v1.2. Fixed some things and optimized code more ;)
NumInputOnMapStart: Click Here To Download

Edit:
Updated to v1.4.

Fixed some more things and optimized code even more :)
NumInputOnMapStart: Click Here To Download

Now uses "onMapLoaded" instead of "start".
Which helped fix the biggest issue.
Fixed the issue with that the number input was being called every time the map loaded even when coming back a menu.

Edit:
v1.5 Wrapped it all in eval statements ;)
1585548863719.png
NumInputOnMapStart: Click Here To Download
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Please do not buy games from g2a.com. The sellers have total power over you. The website has many scam sellers. It looks cheap, but the key code didn't work.
A while back I was having fun making my own custom tiles, then I hit carpet... why is it so difficult!? Lol.
Weekend is finally here... what would you like to see (?):
1) Pokemon into zelda minish-cap style
or
2) Pokemon into zelda gbc style
or
3) Zelda into pokemon style

#= Choose ===============#
||__[ Full mockup ]_[ Charset ]__||
#=======================#
I know someday I'll start working on this...

I'm so happy that I got Steam achievements to work in my game, thanks in large part to the posts by other RPG Maker devs on this issue!

Forum statistics

Threads
97,942
Messages
948,056
Members
129,191
Latest member
Homerx_666
Top