The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: mattyrose2 on February 09, 2010, 06:47:33 AM

Title: Getting money from an NPC.
Post by: mattyrose2 on February 09, 2010, 06:47:33 AM
I am making my first game so I'm not very good yet so plz be patient with me!

Anyway, in the game i am making at the start there is an old man in the village and he gives you 10 gold. i figured out how to do that, but
so far i cant figure out how to stop him giving you ten gold. you could stand there all day an by the end be a millionaire!
so could someone plz tell me how to make him stop giving money away!

thanks!
Title: Re: Getting money from an NPC.
Post by: bulmabriefs144 on February 10, 2010, 02:53:54 AM
Barring a switch (which is lame, just for that), and making a Condition- If Old Guy Gave you 10 gold, you can also do it by variable.  Set the variable to 1 after a single time, then make a condition - OldManGift = 1 at the top of the page, with an else.  put the gift inside the else, and add the variable Set Equal to 1 at the end of the else, and voila! You have a single page event. You can even string several conversations on a single page, like so.

Condition - OldMan is 2
-(Whatever you want)
Else
  Condition - OldMan is 1
  -(Etc)
  -Variable OldMan, Set 2
  Else
     Condition - OldMan is 0
     -(More crap)
     -Variable OldMan, Set 1 

Title: Re: Getting money from an NPC.
Post by: DarkGamer on February 11, 2010, 12:04:21 AM
Event
add money 10G
Message:Take this 10 gold
set variable oldman=1

Condition - OldMan is 1
-(Whatever you want)
set variable oldman=2
Else
  Condition - OldMan is 2
  -(Etc)
  -Variable OldMan, Set 3
  Else
     Condition - OldMan is 3
     -(More crap)
     -Variable OldMan, Set 4

And so on.That's how it's done...
Everytime you talk to him, it will raise the value of the variable oldman, and you can add as many as you want. but in your case, only one would be needed!

Event
add money 10G
Message:Take this 10 gold
set variable oldman=1

Condition branch - if var. OldMan is =1
-show message: Use it well!!!!

Title: Re: Getting money from an NPC.
Post by: mattyrose2 on February 11, 2010, 07:03:19 AM
thanks guys! :D I'll try it next time i can use rpg maker! if it doesn't work ill come back crying with lots of questions! lol thanks!

;8 ;8 ;8 ;8
Title: Re: Getting money from an NPC.
Post by: mattyrose2 on February 13, 2010, 12:47:19 AM
It works thanks!