I'm looking to have a mechanic where keywords are collected in some kind of word bank and then are able to be used in conversations with different characters. I can kind of jury rig it to work using switches and conditions, but I'm wondering if there's a more effective method.
Adding a word bank
RPG Maker MV SupportArray perhaps?
$gameVariables.setValue(id, ["array", "of", "words"]);
$gameVariables.setValue(id, ["array", "of", "words"]);
One option is to have a hidden inventory category, make each keyword an 'item', and use the item selection event for them.
I'll need to do some Googling for that one. I'm pretty new to RPG Maker MV.
I toyed with using items as keywords but the problem is the numerical value assigned to items. It would be weird to open up your notebook and see "Jonas Murdered? 1"
I'm a real stickler for polish lol.
Well I'll be, I may just make this work... thanks friendo.
Here is something that I have been tinkering with in the last few minutes :
When slapped into a Script Command in an event, a choice window will pop up and present option 'A' through 'I'. Once an item has been selected, a function will search through the event and find a Label named 'gotoTest' and the letter which was selected where you can place a custom response to the word.
I need to tinker a bit more with the scriptlet to add a 'catch-all' for when the person does not know anything about the word.
If you want to try out the code so far, copy and paste the following into a Script Command within an event. Then put a label for each letter (gotoTestA, gotoTestB, etc). Beneath each label, you can use the Show Text event command to respond ... remember to place an Exit Event Processing command after each response, as shown above.
EDIT: Hmm, the hidden key item suggestion above might be a better route, actually. I over-thought this a bit.
Code:
this._index++; var choices = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'];
$gameMessage.setChoices(choices, 0, -2);
$gameMessage.setChoiceBackground(0);
$gameMessage.setChoicePositionType(2);
var tmpFunc = function (id) {
for (var i = 0; i < this._list.length; i++) {
var command = this._list[i];
if (command.code === 118 && command.parameters[0] === 'gotoTest' + choices[id]) {
this.jumpTo(i);
return;
}
}
}.bind($gameMap._interpreter);
$gameMessage.setChoiceCallback(tmpFunc);
this.setWaitMode('message');
When slapped into a Script Command in an event, a choice window will pop up and present option 'A' through 'I'. Once an item has been selected, a function will search through the event and find a Label named 'gotoTest' and the letter which was selected where you can place a custom response to the word.
Code:
◆Label:gotoTestA
◆Text:None, Window, Bottom
: :TestA!
◆Exit Event Processing
◆Label:gotoTestB
◆Text:None, Window, Bottom
: :TestB!
◆Exit Event Processing
I need to tinker a bit more with the scriptlet to add a 'catch-all' for when the person does not know anything about the word.
If you want to try out the code so far, copy and paste the following into a Script Command within an event. Then put a label for each letter (gotoTestA, gotoTestB, etc). Beneath each label, you can use the Show Text event command to respond ... remember to place an Exit Event Processing command after each response, as shown above.
Code:
this._index++;var choices=["A","B","C","D","E","F","G","H","I"];$gameMessage.setChoices(choices,0,-2),$gameMessage.setChoiceBackground(0),$gameMessage.setChoicePositionType(2);var tmpFunc=function(e){for(var s=0;s<this._list.length;s++){var t=this._list[s];if(118===t.code&&t.parameters[0]==="gotoTest"+choices[e])return void this.jumpTo(s)}}.bind($gameMap._interpreter);$gameMessage.setChoiceCallback(tmpFunc),this.setWaitMode("message");
EDIT: Hmm, the hidden key item suggestion above might be a better route, actually. I over-thought this a bit.
That's a lot of hard work Ossra lol. Actually, using restart's suggestion I have managed to create a rudimentary word bank system. I use hidden item and variables. However the one issue I'm having now is that the 'Show Item' window doesn't seem to conform to the custom windowskin that I have now, nor do I seem able to adjust it's size, so it's basically a long window with only one word in it. I haven't been able to use Yanfly's menu plugin with any sucess either.
Original thread: https://forums.rpgmakerweb.com/threads/adding-a-word-bank.112816/