Home > Tutorials > RPG Maker XP > An unwelcome NPC pest in the city
An unwelcome NPC pest in the city 
Hi all, this is my first TUT. So I'm going to keep it simple for beginners, like me.
An NPC Beggar pest in the city, that will follow you around and annoy you every time you bump into him.
Now this is set to random but could follow a set amount of movements, it’s up to you.
So first grab one of your maps or make one, in the event layer double click were you would like the Beggar to start.
In the top right box type in Beggar pest or what ever you wish to call the event.
[Double click] the [graphic box], and choice a graphic, I used [145-Prisoner01] as he looks like a down and out.
In the [Autonomous Movement box] select [Type:] [Approach].
[Speed:] [3 Slow]
[Freq:] [6: Highest] try messing around with these to suit your game the most.
In the [Trigger] box, select [Player Touch].
So ever time you walk in to him, he will ask for gold.
(Please Note! Don't use event touch, as this will loop, because your movement is set to approach and you will find it hard to get away from the little beggar (buggar).)
[Right click] on the List of Event Commands (which I'm going to now call LEC for short):
Select [Batch Text Entry] or [Ctrl+N]
I always use [Batch Text Entry] for text as it's faster and better for long speech.
Now type some thing like:
Beggar: Welcome to the city. Do you have any spare gold?\G
I have put the \G control character at the end of the text, so you know how much gold you have before you give it away, this will open the money reserves window.
Under the text, insert a [Conditional Branch] by [double clicking] and select this from the first [page tab 1].
In the [Conditional Branch] box, go to the [4 page tab].
Select [Gold], then [1] then [or more].
Make sure the [Set handling when conditions do not apply] is [checked], as we need this for the Else statement.
Click [OK].
Under the Conditional Branch: Gold 1 or more
Insert an Event Commands (IEC for short), [tab page 1] [Show Choices]
[Choice 1:] Give Beggar 1 Gold.
[Choice 2:] No way, keep you Gold.
Under [When Cancel] make sure you select [Choice 2].
Click [OK].
Under : When [Give Beggar 1 Gold.]
Insert [IEC] [Change Gold]
Under [Operation] select [Decrease], [Constant] [1]
Click [OK].
Under that, insert text using [Ctrl+N]
Beggar:
Thank you...It's down ye old tavern I go...for tankard
of beamish ale...what a fool you be, given me gold so
freely.\G
I added the \G control character again to the end text, so you can see the gold -1 on screen.
It makes for better interaction with the player, or more fun for me...if I'm the only one ever to play the game...ha ha ha.
Under : When [No way, Keep your Gold.]
Insert text [Ctrl+N]
Beggar: But I have five kids to feed! There will be some fool by soon who will not be so smart.\G
I added the \G again so I know there is no gold missing, which you can leave out if you wish.
Hay! He could be a pick-pocket or maybe a robber...who knows.
Under [Else] branch
Insert text [Ctrl+N]
I fear not Beggar; I have no gold to give you! Get a job!
Beggar: You won't last long without gold...ha ha ha.
Click [OK]...and test.
This above Else statement is for you having no gold to start with.
With the statement 'Get a job' you have just made to the beggar, you could start a fight with him or not. The scope is endless.
Now that’s about it, it should look a little like below in the [LEC]
@>Text: Beggar:
: :Welcome to the city.
: :Do you have any spare gold?\G
@>Conditional Branch: Gold 1 or more
@>Show Choices: Give Beggar 1 Gold., No way, keep you Gold.
: When [Give Beggar 1 Gold.]
@>Change Gold: - 1
@>Text:Beggar:
: :Thank you...It's down ye old tavern I go...for a tankard
: :of beamish ale...what a fool you be, given me gold so
: :freely.\G
@>
: When [No way, Keep your Gold.]
@>Text: Begger:
: :But I have five kids to feed!
: :There will be some fool by soon who will not be so
: :smart.\G
@>
: Branch End
@>
: Else
:Text: I fear not Beggar, I have no gold to give you!
: :Get a job!
:Text: Beggar:
: :You won't last long without gold...ha ha ha.
@>
: Branch End
@>
Thanks any comments welcome.
|
|
Details
|
|
Tutorial:
|
An unwelcome NPC pest in the city |
|
Date Listed:
|
Mon, 13 Jul 2009 12:41:11 -0400 |
|
Author:
|
underdog098
|
|
Total Hits:
|
3761 |
|
|