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
831
Reaction score
326
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
831
Reaction score
326
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 Profile Posts

A mousefolk sprite I made, I think I did good.
Discovering math. functions for damage formulas was one of the greatest things for me.
It's very useful for balancing skills to work in a variety of possible circumstances.
For example if you have a skill that is supposed to work for both mages and warriors:
Code:
Math.max(a.atk * 2 - b.def, a.mat * 2 - b.mdf)
SpaceX: First-ever successful (manned) commercial spaceflight!! In these terrible and self-sabotaging times for the world, that's a ray of excitement and hope I needed badly.
GameDevJohn wrote on whtdragon's profile.
Hey I used you bunny and cat spritesheet for a game jam game. Thanks so much! You have really beautiful stuff here. I'll credit you at https://gamedevjohn.itch.io/bunny-boy

Forum statistics

Threads
98,018
Messages
948,575
Members
129,276
Latest member
abhikhurana
Top