Random text event vx ace

In my game I want a kid running around the town saying random things to you when you speak to him.

It seemed pretty straight forward, but of course it wasn't!

I just made an normal NPC event and when you select him, the event generates a variable randomly between, say 1 and 5.

then there are 5 conditional branches. when variable =1 then he says one thing, if its 2, then he says something else etc.

So each time you click on him he says one of the 5 things at random, because the variable generates a different number each time.

BUT, what actually happens is the random number just generates the number of lines shown in the text box! So if its 5, ALL chat boxes from that

point onwards are 1 line bigger, and if a character says something else after, the game puts the first line of that text into the 5th line!

I thought it was a bug so i went back and found that only when i talk to the child does this happen.

I really don't understand why the random variable is changing the number of lines in the text boxes. There's no reason why it should do that.

So to get round it, i tried to make 5 tabs within the event, one for each random number, but you can only set conditions based on variable being

a specific number OR HIGHER, you can't just put variable = 3 for example. This is really annoying.

Any ideas on why my random variable event is doing this to my text boxes? Or how I can easily make a random conversation event like this.

Thanks!
Give us a screenshot of your event.

Also, the pages are done in the order that the highest numbered page that has all conditions true will be run, so you have to make the event pages in order.
Your first approach was correct - you've probably just done something wrong in the execution.

Code:
Control Variables [0001: Random Number] = random number beween 1 and 5Condition Branch: Variable [0001: Random Number] == 1  say line 1Else  Conditional Branch [0001: Random Number] == 2    say line 2  Else    Conditional Branch [0001: Random Number] == 3      say line 3    Else      Conditional Branch [0001: Random Number] == 4        say line 4      Else        say line 5      Branch End    Branch End  Branch EndBranch End
how do you attach? There was an option when i posted, but not here... doesn't let me add an image.
basically, that's what i have. except i had the conditional branches under each other, with the else branch empty in each. but that has the same effect.

What i have works, but i dont understand why its changed my text boxes
I have a yanfly text script that has an option to adjust the size of the text box. Turning this option off solves it, but I still don't know why this particular

random variable affects that.... odd.
gsuk, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Edit your last post to add extra information


The script SHOULD NOT make this happen - if it does, then it's buggy. But I'd still like to see your event commands, just in case the problem is with them.


You don't attach images. You load them to an image sharing site, then you add links to them via the image button or img tags. You need to be in the wysywyg editor to use the image button.
double post was accidental, sorry. a reply appeared just as i finished my first.

I've figured out what the problem was. In the yanfly script there's a 'VARIABLE ROWS' custom setting. The number here refers to an in-game variable (default is 21). The random number generator happened

to be variable 21 in my game which meant that whatever number it was set to was the number of rows in the yanfly script. So by talking to the child, it changed that setting.

I've now changed the setting in the yanfly script and it works fine.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/random-text-event-vx-ace.15521/