HELP calling random common events

I'm trying to get random dialogue out of my NPCs. The dialogue is scripted in separate common events and called through a move route.

This is the current contents of the event:


And this is one of the common events:


The event follows the move route except for the script call.

However, it works fine if I do it this way:


What am I missing??
I forgot how common event call works in default script. But the bottom solution works, why not just use script call outside move route?
Do you even need to use common events for this?

The way I do it is this.
On the event which is the NPC, set a variable switch to random. Select a range which reflects how many options you want to have. e.g. if you want 3 possible dialogues, set the switch at 0...2
Then have a conditional branch command which checks if that switch = 0. Uncheck the 'Set handling when....' box as you do not need it.
Put in the dialogue you want.
Have a new conditional, same setup, but this time checking if the switch = 1
Finally a third conditional, same setup, checking if the switch = 2
I forgot how common event call works in default script. But the bottom solution works, why not just use script call outside move route?

It doesnt work 🙁

Do you even need to use common events for this?

The way I do it is this.
On the event which is the NPC, set a variable switch to random. Select a range which reflects how many options you want to have. e.g. if you want 3 possible dialogues, set the switch at 0...2
Then have a conditional branch command which checks if that switch = 0. Uncheck the 'Set handling when....' box as you do not need it.
Put in the dialogue you want.
Have a new conditional, same setup, but this time checking if the switch = 1
Finally a third conditional, same setup, checking if the switch = 2

This works but complicates it. This dialogue is what the NPCs say to themselves as they walk around (it appears over their head). I'm looking for a simple way to have hundreds of different dialogues that all NPCs can then draw from, without needing hundreds of conditions/switches.

It looks like it's just the script call that isn't working... And I'm not sure why
Try this script call then
Code:
@params = []
@params[0] = rand(5) + 1 # <-- randomized common event ID
command_117
Try this script call then
Code:
@params = []
@params[0] = rand(5) + 1 # <-- randomized common event ID
command_117

IT WORKS! Thank you!!
Just realized a potential future problem... If I needed to scriptcall a common event from a move route (auto movement), what would I use considering $game_temp.reserve_common_event(id) doesn't work?
Code:
@params = []
@params[0] = X # <-- common event ID
command_117

Would this not work for you?
Code:
@params = []
@params[0] = X # <-- common event ID
command_117

Would this not work for you?

I'm limited to one sentence using the auto movement move route
Right, tested it and did not work with command_117 in the move route, but was fine with the @params which was
@params = []; @params[0] = 4; command_117

But then I tested $game_temp.reserve_common_event(id) and it worked for me.
My question would be why would you call a common event in a move route, especially in auto movement? What are you trying to accomplish? But regardless, auto movement should work with reserve_common_event script call. Because the movement is not inside a running event.

Original thread: https://forums.rpgmakerweb.com/threads/help-calling-random-common-events.91749/