HELP calling random common events

Boombaloomba

Villager
Member
Joined
Feb 19, 2018
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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??
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,600
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
I forgot how common event call works in default script. But the bottom solution works, why not just use script call outside move route?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
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
 

Boombaloomba

Villager
Member
Joined
Feb 19, 2018
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,600
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Try this script call then
Code:
@params = []
@params[0] = rand(5) + 1 # <-- randomized common event ID
command_117
 

Boombaloomba

Villager
Member
Joined
Feb 19, 2018
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,675
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Code:
@params = []
@params[0] = X # <-- common event ID
command_117
Would this not work for you?
 

Boombaloomba

Villager
Member
Joined
Feb 19, 2018
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,675
Reaction score
566
First Language
English
Primarily Uses
RMVXA
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,600
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top