NPC say you name

Started by danesopeezy89, December 26, 2008, 01:49:04 pm

Previous topic - Next topic

danesopeezy89

I want to make a game when you can put in your own name so the NPC's can say it but I just want to know how do I  make the NPC's say the name that you put?

Starrodkirby86

In a message box, write in \n[ID of actor]. So if you want the NPC to say Actor 1's name, you put:

Hello \n[1], how are you doing?

If Actor 1's name is...Johnathan, then it'll change to:

Hello Johnathan, how are you doing?


To see if it works, do a message preview. For further help, use the RMXP Help file and view Messages.

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




danesopeezy89

December 26, 2008, 03:05:04 pm #2 Last Edit: December 26, 2008, 03:43:10 pm by Starrodkirby86
alright. thanks  :)
I got another question. Can a NPC say how much EXP you need? just curious  :uhm:

No double-posting within 24 hours. :d ~Love, Starrodkirby86

Starrodkirby86

For that you would need to do some Variable Work.

Make a command like this, preferably before the Message Box with the Variable:
Control Variables: [0000: Name] = [Actor]'s EXP

Then make a Message Box like this:

Hello, \n[1]. You have \v[0] EXP.

Pretend \v[0] = ^^^.

So if \n[1], named Johnathan, has 40 EXP, then it'll look like this:

Hello, Johnathan. You have 40 EXP.

Hope that helps.

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Hellfire Dragon

QuoteCan a NPC say how much EXP you need?

So you mean how much exp you need until you get to next level?

Starrodkirby86

Ahh, didn't notice that. :P Thanks HD...

There's probably a more simple to do this, but this is a way I thought of.

If the hero has only one experience curve (Which he should unless you're using multiple actors that can possibly be the hero), then you'll have set values that'll be the maximum amount of experience needed to get to the next level.

You can either do some variable work by having this "EXP at level up" value subtract by the "EXP hero has" value, or you can just have a message box saying:

You have \v[00] experience out of 30000.

Here's where I'm doing a probably obsolete not optimal method, so bear with me here. -_-;
Now to set different levels you need to do a lot of Conditional Branches and you need to record the level of the hero. Recording the level of the hero is just a simple variable operation. Let's say that variable is \v[05].

So it'll be...
Control Variables: [0005: Level] = [Actor]'s Level
Conditional Branch: Variable [0005] == 1
Message Box: \n[01], you have \v[0] experience out of a total 16 experience.
Else
Conditional Branch: Variable [0005] == 2
  Message Box: \n[01], you have \v[0] experience out of a total 50 experience.
Else
etc.

etc.

etc.

So yeah...But there must be an optimal way.  :^_^':

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Aqua

Orrrr... you could do this :P

Script code:
$game_variables[NUM] = ACTOR.next_rest_exp_s


Of course, you'd have to define which actor you wish to show by using
$game_actors[ID]     or
$game_party[ID]

So if you want the 1st actor in the DB, it'd be.
$game_variables[NUM] = $game_actors[1].next_rest_exp_s



Then just use the \v[NUM] to call the number.

Blizzard

Just keep in mind that you should assign a number to the variable after you are done with it using Aqua's code.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.