First Encounter Dialogue

Randommerade

All those years, outside looking in...
Veteran
Joined
Mar 30, 2013
Messages
561
Reaction score
81
First Language
English
Primarily Uses
So here's my dilemma.

Through a common event, I want my NPC to say something when he's first talked to. Then every time after that he says something different. (But never the first thing after that).

For example, you would talk to the NPC and he'd say something like "Hi! Nice to meet you!" And then after that, he'd say different sentences, but never "Hi! Nice to meet you!" ever again.

I know how to do the second part (making an NPC saying something different with variables) but I'm stumped on how to put the whole process together.

I should mention that he also has a routine, and I made a common event for him to show up at a certain place at a certain time, so it may interfere with the first common event. I'm using Vlue's Advanced Game Time script to do this, but for now I need the first question answered, I just listed that I used the script in case it would interfere with the first question and if it does or if I need further questions asked, I'll ask through the script's thread.

Thanks in advance.
 
Last edited by a moderator:

kiedisticelixer

Sexy Member
Veteran
Joined
Oct 23, 2013
Messages
97
Reaction score
14
First Language
Spanish
Primarily Uses
There's something I didn't get. 

Through a common event, I want my NPC to say something when he's first talked to. Then every time after that he says something different.
I assume you don't mean something you can do through a local switch in the event, right?

It took me a while, but I found this: (quoting anyways) http://www.rpgmakervx.net/index.php?showtopic=22153

Paste in scripts

Code:
class Game_Interpreter    def random(dest_id, min, max)    min = min.zero? ? 0 : $game_variables[min]    num = [rand($game_variables[max] + 1), min].max    $game_variables[dest_id] = num  end  end
You can use it like this in a "Script..." event command.

 

Code:
random(result_variable_id, min_variable_id, max_variable_id)
result_variable_id is the id number of the variable that will hold the random number.
min_variable_id is the variable id which holds the minimum number. So, if you wanted a range where the lowest value is 5, you would set a variable to 5 and then pass in its id number. If you pass in 0 the min value will be zero.
max_variable_id is the variable id which holds the upper bound. Set a variable to your max value and pass in its id number.

So, if we wanted a value in the range of 0-10 to be stored in variable 1, we would use...

 

Code:
@> Control Variables: [003:max] = 10@> Script: random(1, 0, 3)
...and if we wanted to use a lower bound...

 

Code:
@> Control Variables: [002:min] = 5@> Control Variables: [003:max] = 10@> Script: random(1, 2, 3)
...and that will return any number in the range of 5-10.
 
Last edited by a moderator:

Randommerade

All those years, outside looking in...
Veteran
Joined
Mar 30, 2013
Messages
561
Reaction score
81
First Language
English
Primarily Uses
There's something I didn't get. 

I assume you don't mean something you can do through a local switch in the event, right?
Sorry. I edited the first post so it was a little clearer. I'm not entirely sure how to do it at all... I mean I'm sure switches would be involved but I'm not sure on how to go about it.
 

dinhbat3

Veteran
Veteran
Joined
Feb 5, 2014
Messages
184
Reaction score
31
First Language
English
Primarily Uses
Hey Random

If I understand the issue correctly, you should be able to use a simple self switch solution.

When you first talk to the player have him say "Hi, Nice to meet you!" then turn on self switch A

On the second page, with Self Switch A active, have the exact same event made, but when he is spoken to use a conditional branch that has however many unique lines you want.

The basic Idea is outlined line this:

Page 1: No condition

Show text: "Hi, Nice to meet you."

Turn Self Switch A ON

Page 2: Condition: Self Switch A ON

Control Variable: Random 0-2

if Control Variable = 0

  Show text: How are you?

end

if Control Variable = 1

  Show text: Haven't seen you around lately.

end

if Control Variable = 2

  Show text: I think you get the idea here.

end

Maybe I am interpreting the issue incorrectly and oversimplifying, but that should accomplish what you want. If there is more to the event like a move route or whatever, you can include them in both, just make sure the only difference is the text options.

~ Dinhbat
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top