YEP Gabwindow and random GabText

Hi!

I was wondering if it would be possible to make appear random GabText messages from a list, each time I use a skill in battle.
For example each time I use Taunt the actor insults the enemy randomly in a different way ("come get me d*ckhead", "you are not good enough", "a weakling like you can't defeat me", etc...).

Kind regards
You can fetch a plugin command by script.
Code:
var textArray = [
"text sample 1", "text sample 2",
"text sample 3", "text sample 4",
"text sample 5"
];
var index = Math.floor(Math.random() * textArray.length);
this.pluginCommand("GabText", [ textArray[index] ]);
replace the above text sample to your message, put it in a script command,
and this will do
GabText random-message-you-wrote-above
with random message picked.

if you want to change colors using \C[2], or use other Text Codes,
make sure to double the \
-> \\C[2]
First, how many different taunts are there? Let's say five, for this example. Make a variable. Call it "battle taunt num" or something like that. Then set it to a random number between 1 and 5. The second number is how many taunts there are, in this example, five. Then make a conditional branch. The conditional branch should first check if the variable is 1. If so, say thus and so. If not (in the else section), do another conditional branch that checks for the variable being 2. If it is, say this and that. Keep doing this until you reach the number of taunts, in this example, five. If I wasn't clear enough, just speak up and I will try to make it more simple 🙂
And here is a screenshot. Also, what @cji3bp62000 said would likely be better, but here is a different approach.
Capture001.PNG
if >>Yaruru aren't familiar to javascript, @Thomas Smith 's solution should be a better one to use,
since it is still easy to realize what you have done after lots of days have passed.
if >>Yaruru aren't familiar to javascript, @Thomas Smith 's solution should be a better one to use,
since it is still easy to realize what you have done after lots of days have passed.
Yeah, I am not a coder, so I don't actually understand how the thing that you did works xD
Wow you are both amazing! I'm going to try both ways since I'm starting to learn js and I like it.
Can't thank you enough!
Wow you are both amazing! I'm going to try both ways since I'm starting to learn js and I like it.
Can't thank you enough!
You're welcome 🙂 My way will work for anything you want to be random, not just this. And there's your first like!
You're welcome 🙂 My way will work for anything you want to be random, not just this. And there's your first like!

For now the conditional branch solution is doing great! I'll also try to make work the script solution for another (bigger) set of messages :hswt:.

Thanks!
For now the conditional branch solution is doing great! I'll also try to make work the script solution for another (bigger) set of messages :hswt:.

Thanks!
You are very welcome.

Original thread: https://forums.rpgmakerweb.com/threads/yep-gabwindow-and-random-gabtext.91953/