How to make an NPC talk in exchange for gold?

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
Let's say that my hero needs some information and the only one who can provide it asks for some gold in exchange of the info: is it possible to set this through events and conditions only or do I need a script?

If the former, please give me the most precise instructions possible: I always have strong difficulties with everything related to switches, variables, and other "magical" features...

Thanks in advance for any help  :)
 

Tornado Samurai

A Samurai of the Storms
Veteran
Joined
Jan 11, 2015
Messages
577
Reaction score
57
First Language
English
Primarily Uses
Yes, it is very possible to use this through eventing. Here are some photos provided. :)

========================

After you create the "Peasant with Information" and supply him with dialogue...

This is the part where you set up choices of "Yes" or "No" on whether to pay him or not...



And then, click under the "Yes" branch to edit "X amount of gold" taken from the player for saying "Yes" for the info.



Feel free to add more dialogue as well after this step. :)

And it should look like this once finished...

Feel free to ask if you need any more information regarding this. :D
 
Last edited by a moderator:
  • Like
Reactions: Gui

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
All you need is a simple event, 

Let's assume the NPC is asking for 200 gold pieces.

Show Choice Pay/Not Pay

When Pay

Conditional branch : Gold is 200 or more

When yes:  Dialogue - here you are take the money, blah

Change Gold: minus 200

When no: Hero: Sorry, we don't have that much.

                 NPC: then go do a side quest, kill a few monsters.  No money, no information.

When Not Pay

Dialogue or whatever.

Ninja'd
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
If you're having problems with switches and variables, then I suggest you go back to the tutorials and work through them until you know how to use them - switches and variables are the most important part of the engine and you NEED to know how to use them if you ever want to make a game with anything moderately complex.

Follow the link in my signature and look for the "Variables Guide" there, that game should give you the basics.
 

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
Wow, Tornado Summoner, you deserve your name  ;)

However, I realize I've been unclear with my request because I already found what you just explained and successfully implemented such event in my game; the problem which bothers me right now is that, when I test the game, the player can reply "Yes" even without any money, the NPC will provide the info regardless of the quantity of cash in the PC's wallet (which, at the very beginning of the game, is equal to zero; he'll find some later).

What I need is a way to check the amount of gold the PC possesses and, if he hasn't enough, how I could display a message telling to him he should find a job first... That's why I spoke of conditions in my first post, because I believe such a thing is required for this.

If you're having problems with switches and variables, then I suggest you go back to the tutorials and work through them until you know how to use them - switches and variables are the most important part of the engine and you NEED to know how to use them if you ever want to make a game with anything moderately complex.

Follow the link in my signature and look for the "Variables Guide" there, that game should give you the basics.
I know that too, and I already downloaded this guide quite some time ago now but I couldn't understand a thing to it...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I know that too, and I already downloaded this guide quite some time ago now but I couldn't understand a thing to it...
It's a game that you need to play (and solve it's quests) before you can check (and understand) how those quests were made.
 

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
Maybe I should give another try to it, yes...
 

Tornado Samurai

A Samurai of the Storms
Veteran
Joined
Jan 11, 2015
Messages
577
Reaction score
57
First Language
English
Primarily Uses
Wow, Tornado Summoner, you deserve your name  ;)

However, I realize I've been unclear with my request because I already found what you just explained and successfully implemented such event in my game; the problem which bothers me right now is that, when I test the game, the player can reply "Yes" even without any money, the NPC will provide the info regardless of the quantity of cash in the PC's wallet (which, at the very beginning of the game, is equal to zero; he'll find some later).
Ohh.. Oops! Sorry about the mistake. :\ I should have noticed it though, while I hurriedly posted it. I had forgot to use the conditional branches, otherwise, the player would have been in debt... XD. Ksjp17's solution is the correct answer. :D

And thanks for the compliment! :D
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
To give more detail the conditional I was referring to is:

Select Conditional Branch - tab one of the Event Command Menu

Select Tab 4

The first item is 'Gold'  Select it and the boxes to the right allow you to specify how much gold there should be.

Do that and the engine will automatically determine if the player has enough.  Everything then runs as I described.  You do not need switches or variables.
 
  • Like
Reactions: Gui

Gui

Veteran
Veteran
Joined
Jul 19, 2014
Messages
177
Reaction score
64
First Language
French
Primarily Uses
Yes, that's what I did after having posted my very first reply and it worked, but I forgot to edit my post to say my problem was solved: sorry for the confusion, guys, it has been a complicated day for me...

I believe this topic can now be closed: thanks again to everyone for the help, much appreciated  :)
 

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

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