Charas-Project

Game Creation => Requests => RPG Maker Programming => Topic started by: evmaster on July 10, 2012, 02:27:28 AM

Title: Input Keys Question
Post by: evmaster on July 10, 2012, 02:27:28 AM
Wow. Haven't been here in years. :hi: I stopped coming here one day because a virus would pop up every time I came to the site. Anyone know about that? Anyways, I am back for the time being as I got RPG maker 2003 again as my last computer crashed a few years back. Don't think anyone remembers me, but say hi if you do.  ;D

Okay, now for my question. I want to be able to give gifts to NPCS by pressing a key other than the space bar. Space bar to talk and maybe shift key to bring up another message that says "Give Gift" or something. Is that even possible?
Title: Re: Input Keys Question
Post by: A Forgotten Legend on July 10, 2012, 02:45:13 AM
I vaguely remember that happening to someone, and I remember your name.

As for your question, yep! Totes possible.  I'll edit in a few your solution.

EDIT:

Alright, so I tested it out and it works.

First make your event, and set it to Collision with Hero, NOT Touched by Hero.  If you do the latter it won't end the event after everything is said and done with without some switch and multiple page bull.

Before you do anything, use the Label event command and create Label 1.

Next, Choose Key Input Process as the first event command. Make sure 1-5 and 7 are checked. At the top, you need to select a variable that the key input will go into.  So make one and call it gift or something.  Make sure that Wait Until Key is Pressed is checked.

Now make a condition branch.  If Variable "Gift" is 7 (That's the number that was beside the Shift key) and then check the else handler box.

Inside the conditional branch yes case, put everything you want to happen when you are giving the gift.  In the else case make another conditional branch.  This time make it If Variable "Gift" is 5 (The number beside the decision key).  Give this one an else case as well.  Inside here, put whatever the NPC is supposed to do when not giving a gift.

Inside the Gift is 5 else case make a "Jump to Label 2" command.  At the end of the event, put a Variable Operation: "Gift" Set equal to zero.  Then put a "Jump to Label 1" command.  This will make it so then the hero can choose to talk to the event again.  After the "Jump to Label 1" put a "Label 2" command in.  This will make it so the event will end.  What is happening is that the else case with a Jump to Label 2 command in it is only used when the hero uses a directional key.  So when the hero walks away, the event will end.  Finally, add an End Event Processing command and you should be good!
-------------

Wait minute--- fixing a few errors I made.
... And fixed them!  It should work perfectly now!

This is what it should look like in the editor.
Code: [Select]
<>Label: 1
<>Key Input Proc: [0001: Gift]
<>Branch if Var [0001: Gift] is 7
  <>GIFT CODE GOES HERE
  <>
: Else Handler
  <>Branch if Var [0001: Gift] is 5
    <> REGULAR NPC CHAT GOES HERE
    <>
   : Else Handler
     <>Jump to Label: 2
     <>
   : End
  <>
 : End
<>Variable Oper: [0001: Gift] Set, 0
<>Jump to Label: 1
<>Label: 2
<>End Event Processing
Title: Re: Input Keys Question
Post by: evmaster on July 10, 2012, 03:55:14 AM
I did not expect such a detailed reply so soon! Thank you!  ;D

As when I press Space Bar to talk, nothing happens and when I press Shift during that time it triggers the Gift event. I think I am doing something wrong.

Forgive me, but it has been quite a long time since I played Rpg maker. I think I am missing something
(http://img546.imageshack.us/img546/618/giftevent.png)

Title: Re: Input Keys Question
Post by: A Forgotten Legend on July 10, 2012, 05:06:50 AM
Do you have all the boxes that I said to have checked off checked in the Key Input Process command?  You should have the first 5 and then number 7.  It's working for me.

I did notice that because of the Collision with hero, the character will face you if you collide with them and then turn back to the original direction if you choose not to do anything and walk away.
Title: Re: Input Keys Question
Post by: evmaster on July 10, 2012, 11:53:34 AM
Thank you so much for helping me! I really appreciate it.  :happy:

Another question, how would I make the same character say more than one message with this option? Is that possible?
Title: Re: Input Keys Question
Post by: A Forgotten Legend on July 10, 2012, 04:16:25 PM
Well, depends on how you want to do it.  If you are talking about doing a different regular talking message it just involves randomizing a variable and then making a few conditional branches withing the REGULAR talk part of the event.
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 10, 2012, 04:40:21 PM
Yes we got rid of the virus when we updated the website, it was a bit unsettling but now charas looks bland instead.

Where did you find that neat scrolly thing AFL?

More than one message? As in more than one " message" command(1) or rather a "speaking again triggers a new response"(2) or are we really talking about "random dialogue"(3)?

1. Add another "Message" command with more text.

2. Add a conditional branch that checks the value a variable. Either a temprary variable that doesn't really matter or a variable set for this exact person. I would suggest against the later since that would mean a variable for every npc if you want all of them to do this.
Say you want the person to say "hello my good sire and madam" on the first click and then on the second he goes all "what delightful weather we are having, no?" where the third response is "I would kindly request you to stop interrupting my harping". For this we'll need 3 conditional branches.
First one is easily enough "VAR equal to 0" where you show the first message. Next up is a conditional branch that checks for the value 1 and a message. And not to surprisingly you add a third one that checks for the value 2(or greater) and the message.
Lastly we add a variable operations in the END. Make it add 1 to the variable.

This will make the first message pop up if you haven't talked to the person before, after that message is played and the other conditional checks fail - the add 1 to VAR will go off and increase that variable by 1 which in turn will make the second message appear next time you talk to him.

So in lines of code.(Kinda)

C Branch: VAR is 0
  Show message :
 C Branch: Var is 1
   Show Message:
  C Branch: Var is 2
    Show message:
END
Variable operations: VAR + 1



3. If you want a random message out of like 3 possible being: "I like swords", "Welcome to corneria" or "two by two hands of blue" you also gotta use a variable and conditional branches.
First we go with variable operations. Set the value of a chosen temprary variable and set it to a random value between 1 and 3.
Next throw in 3 conditional branches with messages in them just like the one before. Only difference is that we have no "variable +1" in the end. Since everytime you speak to the npcs the randomizing of the variable will occur once more.

Title: Re: Input Keys Question
Post by: evmaster on July 10, 2012, 05:42:34 PM
Now I am trying to make the same NPC event with the Key input have random messages and then more messages the more the NPC likes you. I think it can be done with Variables Operation Add?

Also, I want to show how much a NPC likes you after you give them gifts? I use to be able to know how to use the Variables where you do something like Add Variable Plus one and then I made a book where you could look at how much they like you and made heart symbols along with the the number variables it corresponded with. Anyone know what I am talking about?

You guys have been great!  :bend:
Title: Re: Input Keys Question
Post by: A Forgotten Legend on July 10, 2012, 06:58:53 PM
@Prpl, [ code ]
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 10, 2012, 08:59:12 PM
Well, basically you need a conditional branch before your conditional branch.
Made no sense? I know.

Right now the event checks if you talked or gifted them.
On the talk "tab" a random message is picked just randomly.
BUT if we want it so that some of those random messages can't get randomly chosen until later we gotta make sure that those can't be picked.
Imagine that before any reputation you can get 3 messages. Simple, pretty much what I explained. Now say that this person will love you dearly after 3 gifts.
So before the randomizer (variable operations set random 1-3) we add a conditional branch that checks the value of the affection. Let's call this "npc love".
So the branch checks if love is greater than or equal to 3 (which is max) and if so the randomizer is 1-6.
Next up in the else case is a check that sees if it's equal to 2. If it is, set random 1-5.
Another one that checks if it's equal to 1. 1-4.
And then the very last else case is what is normal now: 1-3.

Add your messages with random preconditions between 1 and 6 and it should be done.
If no affection is raised only 3 messages can be picked. Then each point in NPC love grants one extra message.

And then to raise this mystical NPC love you need to add one of those "variable operations: NPC love +1" at the end of the gift-giving "tab".
That way the value will increase by one each time you give a gift and after 3 all messages are available.

Note: Of course you could make each gift give 1 point but the "stages" of affection being something such as: 10, 20, 30. Or something.

__________________________________-
Next question about showing the value of a variable.

The code is:
 
Quote
/v[n]   Displays the value held in variable n, n being any numerical value.

So instead of "n" you add the numeric value the variable NPC love have in the index-list-thingy. Put that in a message and it will display the value of the variable.
If it's 256, it will be 256 when used in a message.
Title: Re: Input Keys Question
Post by: evmaster on July 10, 2012, 09:42:59 PM
Wow. You are really good at this. Too bad I am kinda lost. lol Would it be too much to ask for a Prnt screen of this part? The part where the NPC likes you more and says different things?

Maybe even with the Key Input process as I am having trouble... :(

I tried putting it before the random messages 1 to 3 and now the Key Input Process doesn't seem to work. I wonder if this whole thing is even possible. lol

 :happy:
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 11, 2012, 05:54:56 PM
Will get around actually coding it in a day or two. Just spoke out of theory. As in. How it would be done. Very much doable. Keep trying or wait till then.
Title: Re: Input Keys Question
Post by: evmaster on July 11, 2012, 07:54:39 PM
Okay thanks. You guys have been great. :D
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 13, 2012, 10:53:17 PM
Well this should do it. Note that I didn't use shift, I used the 1 button instead for gift-giving.
(Couldn't find where to activate shift, where do you do that anyway? There's like 1-4 for movement keys, 5 for decision key and 6 for cancel. Then there's 10-19 for numberkeys and 20-24 for the weird buttons.)

(http://i50.tinypic.com/1zusll.png)
So first it checks what button is pressed, then it checks your affection in the talk part. If the affection is higher than 10 it might give 2 additional messages, with 5 or more just 1 additional. Then in the end stuff is turned off.
Title: Re: Input Keys Question
Post by: A Forgotten Legend on July 14, 2012, 04:04:30 AM
@ prpl its 7
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 14, 2012, 06:34:57 AM
@ prpl its 7

But there's no way to make the the key input store 7 to 9 is there?
Could it be that it doesn't work on win7 'cuz I tried many times.
Title: Re: Input Keys Question
Post by: A Forgotten Legend on July 14, 2012, 06:41:04 PM
(http://img17.imageshack.us/img17/8730/shiftk.png)

I have windows 7.
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 14, 2012, 08:33:20 PM
Now that's mighty odd. Mine doesn't look like that... '

(http://i49.tinypic.com/33u96iw.png)


Also on a windows 7
Title: Re: Input Keys Question
Post by: A Forgotten Legend on July 15, 2012, 02:11:49 AM
Thats weird, maybe we have different translations?  Either that or one of the patches I have adds it in.
Title: Re: Input Keys Question
Post by: drenrin2120 on July 15, 2012, 06:02:34 PM
I'm pretty sure I have 1.8 and mine looks like AFLs. What version do you have purp?
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 15, 2012, 08:00:12 PM
"RPG maker 2003 version 1.04, translated by rpg advocate"

Been a long time since I got my hands on it. Name imput doesn't work in this version either.
Title: Re: Input Keys Question
Post by: drenrin2120 on July 15, 2012, 08:51:21 PM
Name input and shift (7) work in 1.08 and I believe there are some other bugs that were fixed in 1.08, but not all of them.
Title: Re: Input Keys Question
Post by: Prpl_Mage on July 15, 2012, 09:48:33 PM
Sounds like I should think about abandoning this version and find a new one then.
Title: Re: Input Keys Question
Post by: evmaster on August 03, 2012, 10:59:58 PM
Anyway to give a gift while choosing from your inventory?
Title: Re: Input Keys Question
Post by: A Forgotten Legend on August 04, 2012, 02:21:02 PM
I guess if the item activates a switch when used you could have the menu open up in the conversation and then if they use that item the switch continues the event.
Title: Re: Input Keys Question
Post by: Prpl_Mage on August 04, 2012, 10:09:42 PM
RPGM2k3 menu system is probably one of it's least customizable features I'm afraid. No events are able to play at the same time as the menu which makes it rather problematic.

It would be pretty hard but in theory: make items (that activates a switch when used, if used when this one event isn't running - they do nothing. In the event turn on a switch and then when both of these switches are on you remove one of the itmes depending on what item you picked.
But this would be troublesome if there is more than one NPC that can be given gifts.
It would be better to create a custom menu just for this. Create a map that looks like the menu interface and place icons of all the gifts. When clicked on you give the player the question "are you sure you want to give this." Throw in a conditional branch that checks if you actually own one of these items. If yes, then remove one of them and proceed with the event which is giving gifts to the person.
Title: Re: Input Keys Question
Post by: evmaster on August 04, 2012, 11:12:41 PM
Sorry to be noobish, but how I do I begin to create a custom map? Also, you have been a great help and I really appreciate it.
Title: Re: Input Keys Question
Post by: evmaster on August 05, 2012, 12:35:01 AM
prplemage
"It would be better to create a custom menu just for this. Create a map that looks like the menu interface and place icons of all the gifts. When clicked on you give the player the question "are you sure you want to give this." Throw in a conditional branch that checks if you actually own one of these items. If yes, then remove one of them and proceed with the event which is giving gifts to the person."

lucas
"Go to the CR, look for a template under "Chipsets", and just draw in the boxes. (or copy paste things from elsewhere)."


I am not sure if I am on the same page as you guys. It sounds like I can create a map and then open it like a menu? But I don't see how that can be done with a map? A map is what you walk around on? Sorry for the confusion.
Edit: I am trying to fit this is with the gifts with the shift key.
Title: Re: Input Keys Question
Post by: evmaster on August 05, 2012, 01:53:13 AM
Ah. Now I understand. Thank you for explaining.
Title: Re: Input Keys Question
Post by: Prpl_Mage on August 05, 2012, 07:26:14 AM
Ah yes, sorry 'bout that.

Creating a map as a menu is just as lucas said making a map look like it's actually a menu. There is a way to create a menu using pictures and variables and a whole lot of X and Y's. I'm still nopt very confident in explaining that without making a whole lot of rambling though and it's kinda overkill.

What you do is pretty much that you get a chipset that looks like your System file. As in, the current look n layout of your game's interface/ menu- stuff.
I prefer to just open paint and throw in a grid of 16x16 squares (that's one chipset tile) in a picture of 320x240(the size of a map of that's 20x15 in the maker. As in. It doesn't scroll when you move.) And then copy paste from my current system to make a neat looking layout. SAve at 255 colours and then import it to the maker as a panorama 8background image) enter the map properties and pick that one as background. If all is done right you should see the picture as the background of the map right away even in the maker.

Like this:
(http://i49.tinypic.com/e0fkzn.png)

Next up!

When deciding to give gifts you memorize the hero position. One variable for the map ID, one for the X coordinates and then Y coordinates. 3 variables in total. This is so that you can return to where you first opened the menu. Then you teleport to your map.
Change the hero graphic of your hero to a cursor. Or anything, but a cursor makes more sense than a dog. Trust me. Using a dog as a menu cursor did not make sense. There are a few in the CR I think. Or make one that looks good.
Next up we place all of these event to click on in this map. I prefer to use icons for things to click on rather than text. Making strings of text is easier when using pictures than making the words and cramming them into a charset or chipset. But Icons I think works great.
So say you have 9 types of gifts. Place them in a neat 3x3 patter with some space. Give them each a graphic corresponding with their look.
To make it more fancy create some pages for these icons so that if Item held(as precondition) you can see the graphic but if that returns as false the item is transparent (looks greyed out). And also when clicking give them them some info on the item and ask if you're sure you want to give it. And to make it even more fancy. Create soem more high res pictures of the items and put them in a face set and use the face set when the information and question pops up.

Now on each of these items you make it so that clicking on them either turns on a switch (simple solution) or set a variable to a certain value (1-9, since there are 9 different items to choose from). Then return to your previous position(your other map that's a town or such) then choose "change event position" or the person you talked to will be reseted to his original position which might not be next to you(if the npc actually move around town). Use the variables you stored the heros X and Y variables for the previous position and then add 1 to the Y variable. The npc should appear one tile above you then. Also use "move event" and pick the hero and make him face the right direction.
Next up in the "change event position" you pick "reference by variable" and make the X coordinate equal to the variable you stored the X variable in and the Y coordinate with the Y variable.
And now this npc will appear next to you. Oh yeah. You could also use a "move event" pick the hero and make him face the right direction as well.

This is getting pretty rambled though. Sorry 'bout that.


You could also make it so that everything that's giving-gifts happen in this custom menu. As in, the thing that raises affection and such happens in this map instead of teleporting you back to the previous map.
In this custom menu you could throw in the NPC's face somewhere or his charset or anything and make it so that picking these items goes through with the removal of item and increase of affection variable. Maybe even make a neat affection bar in the custom menu under the faceset or charset of the npc and a cursor on it that swaps position depending on your current affection.
That way you could give many fancy gifts without playing yoyo with your custom menu.

I'm feeling that I'm not making much sense. PLay around with it and see how it feels. Just return and give me a shout when you need something better explained.
And good luck.
Title: Re: Input Keys Question
Post by: evmaster on August 05, 2012, 03:14:11 PM
*brain explode*

Thank you so much for taking the time to explain. I will make sure to give a shout if I don't understand something.

Edit: I  am having trouble with the panorama part. I have never worked with panorama before. I noticed your image is the size of 20x15 for the rpg maker. I am trying to use your image for practice. I imported it as a panorama and went to Map properties and set it as Parallax background. But that doesn't work when I go into the game. You wouldn't happen to have an example for the chipset part would you?
Title: Re: Input Keys Question
Post by: A Forgotten Legend on August 05, 2012, 04:08:50 PM
Are the tiles overtop of it transparent?
Title: Re: Input Keys Question
Post by: evmaster on August 05, 2012, 04:25:16 PM
You mean the chipset? I am just using a map that is 20x15 and I put some grass tile down. I guess that is not how it is done?
Title: Re: Input Keys Question
Post by: A Forgotten Legend on August 05, 2012, 06:45:58 PM
For the panorama to work, you need to have transparent tiles on the map. :)
Title: Re: Input Keys Question
Post by: evmaster on August 05, 2012, 08:14:10 PM
So I am creating a menu on a chipset?
Title: Re: Input Keys Question
Post by: Prpl_Mage on August 05, 2012, 10:00:58 PM
Oh right. Not sure if Lucas understood what we were discussing.

One of the tiles of a chipset(like the bottom right) is usually some horrible pinkish colour. It's the same colour as the background of the "upper layer". most of the RTP uses the same ugly pink. When importing a chipset you picked this colour to be the transparent background colour. This means that using the chipsettile with that horrible pink makes the ground transparent. Original background colour is black but picking a panorama goes above that black.

So make the whole map this horrible pink that's actually gonna be transparent.

I find using panoramas smoother than chipsets but that might just be me. Not as limited that way. If you want to use a chipset that's fine as well. You don't really need a fancy chipset for it. You could just use dogs and bushes to see if you can get it to work.

Title: Re: Input Keys Question
Post by: Prpl_Mage on August 05, 2012, 10:46:49 PM
But that would just show the maker interface and then that exact picture in the middle since it shows as the panorama when all the tiles are transparent.  Well that and a whole bunch of event icons.
Title: Re: Input Keys Question
Post by: evmaster on August 05, 2012, 10:57:32 PM
Okay. I got the pink color form the ship tileset, made the whole chipset pink, and imported it. I know see the panaroma. :D
Title: Re: Input Keys Question
Post by: Meiscool on August 05, 2012, 11:16:30 PM
Just FYI, if you make a map menu, you have to watch out for map event issues. Whenever you move to a new map and back to the current map, all events reset.

This isn't a big deal in most games, but in some games it can cause major problems (ABS games, games with a lot of movement of NPCs, etc.).
Title: Re: Input Keys Question
Post by: Prpl_Mage on August 05, 2012, 11:34:36 PM
Yeah especially ABS. Games that have enemies as events on the screen that needs killing. nothing worse than entering a complex menu and returning only to find yourself stuck in an enemy that hurts you right away
Picture based menus works better with those. Turn on a switch for menu to stop all activity and then show tons of pictures and key imput commands. Certainly not an easy task

Good work ev btw, let me know if you need any clearer instructions on this whole thing.