- 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
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:
Line 1336 of rpg_windows.js gives me this:
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...!
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.
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
Code:
this._list.push({ name: name, symbol: symbol, enabled: enabled, ext: ext});
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...!

