[Help] Dynamic Choice List....heh...=\

MORINGA

Veteran
Veteran
Joined
Apr 23, 2017
Messages
30
Reaction score
11
First Language
English
Primarily Uses
RMMV
Hi!
I've been looking for some tool, plugin or tutorial to help me with the implementation of a choice list. Which will vary in size and content, according to 2 or 3 things.

The main objective of it is to give players the option to spend more MP than required by a skill, boosting its effect.
So, for instance, if a skill requires 5 MP, players with a certain "LIB" value of, say, 20, will be able to choose among 5, 10, 15 or 20 MP for that skill, provided they have enough MP to do so.

At first, I was inclined to look for battle systems, related plugins and stuff, but then I realized skills can be used not only during battles, so I found it easier to add notetags with the YEP_SkillCore plugin.
With such notetags, I can customize skill execution, even before eval (lunatic mode, <Before Eval> notetags).

But still, I have to call something that brings a choice list.
Logic is simple:
->check MP vs MP requirements. If MP >= 2* requirements,
->then check "LIB" vs MP requirements. If "LIB" >= 2* requirements,
->then make choice list and call it.
---choice list has its number of items like: "Rounded down (Minimum("LIB", "MP") / "MP requirement")" (thanks JS for Math.floor, making things easy)
---each item is a multiple of "MP requirement", starting from 1

Say a character has 35 LIB and 28 MP (of, say, 55 Max MP)
And a skill costs 5 MP

That would result in:
Minimum(35, 28) = 28
28/5 = 5.6
Rounded down(5.6) = 5 choices available, being: 5, 10, 15, 20, 25

Player can then choose how much MP they want to spend with that character, on that skill, for that turn.

I'm sure it's there, within the "rpg_windows.js" script (Window_ChoiceList section?), begging to be copied, edited and implemented. I'm just a bit lost on how to make it work. And yeah, I already tried, no success, loads of errors, such as this one:
Code:
>Window_ChoiceList.prototype.addCommand(choices[0], 'choice')

VM100   rpg_windows.js:1336 Uncaught TypeError: Cannot read property 'push' of undefined   
VM100   rpg_windows.js:1336 Window_Command.addCommand   
VM1164:2   (anonymous function)
VM958:847   InjectedScript._evaluateOn
VM958:780   InjectedScript._evaluateAndWrap
VM958:646   InjectedScript.evaluate
Line 1336 of rpg_windows.js gives me this:
Code:
    this._list.push({ name: name, symbol: symbol, enabled: enabled, ext: ext});
If it can't 'push' name and/or symbol (the other 2 arguments are default), then how I'm supposed to use this method?

Anyway, usually, what works for me is testing on console. If it works on console, then it sure(?) works on scripts (not necessarily true the other way around, of course). I call functions and stuff on console, for debugging, checking and testing purposes and, if all goes well, I throw it inside scripts, when it's the case.
Idk if it's a good practice or what...

Any help? Thanks in advance...! :smile:
 

MORINGA

Veteran
Veteran
Joined
Apr 23, 2017
Messages
30
Reaction score
11
First Language
English
Primarily Uses
RMMV
Bump.
Using Window_Command. Still haven't found where to call this.
Using YEP_X_ActSeqPack1 will most probably make me add notetags for each skill (with MP cost).
 

MORINGA

Veteran
Veteran
Joined
Apr 23, 2017
Messages
30
Reaction score
11
First Language
English
Primarily Uses
RMMV
Bump.
With SRD_SkillExtend, I can show a popup, but can't make it behave as intended.
AFAIK, the only way I made this "work" is to make a list of n identical items (skills), so they'll all call the same skill. But MP cost will still be the same.
Tried working with mcr, but then I can't find a way to reference menu item id with selected item.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top