Okay I've googled around, and I have not found an answer at ALL. I'm not really sure WHAT to call it but, I'm trying to make a horror game of sorts and I can't figure out for the life of me how to do this.
What I want to do is have it so, you can open your inventory and use an item, but if you use the item say, for example, you use the item "Key" while standing in front of a cave, it says "You cannot use the item this way" or something like that, but if you use the "Key" while standing in front of the correct door, it says like "Door unlocked" And it lets you through, and the key disappears. I already know you can use conditional branches to just let you through, but I don't want that...I plan on using it for future puzzles that actually involve the player to think. Like say, using a shovel on the ground, or using the hammer on a wall.
Please please please someone help me..
Need help with using items at specific times
● ARCHIVED · READ-ONLY
-
-
Normally, you'd just make your event check if the required item is in inventory, and if it is, remove it (optional) and take the appropriate action.
If you want the player to actually CHOOSE the item from their inventory, what you're after is the Select Key Item command, under the Message group on the first tab of event commands.
You use that command, and tell it what variable the selected item's id should go into. Then you can use a conditional branch to see if that variable is set to the item id that's necessary to open the door (or whatever) and perform the action, otherwise show the text.
So it'll be something like this (an event on the wall where the hammer is meant to be used):
Code:Select Key Item: [0001: Item Selected]Conditional Branch: Variable [0001: Item Selected] == 53 (53 is the id of the hammer) .. do what needs to be done when they use the hammer on the wallElse Show Text: Something else might work better here.Branch End -
A little bit additional info:
You're trying to make an item that can be used anywhere, but the result will only happen in specific situations or positions.
Usually the games with RM work the other way around, that' what Shaz explained: you place an event in the specific position or situation, and when the player starts the interaction with the event it will check or ask for existing items.
Both approaches can be done, but which one to choose depends on what you want to do.
If that is a key only usable on specific doors or something like that, you should make the door an event checking for the item.
If the item is something that can be used almost everywhere (like a showel to dig in the ground), then you make that item call a common event, and have that event check the position of the player to decide what to do. That check should be done using region-ID or terrain-tag, if it should have results in many places (planting a seed) and specific coordinate checks if you're looking for a rare result (digging up a treasure) -
Oh my gosh, thank you so much!Normally, you'd just make your event check if the required item is in inventory, and if it is, remove it (optional) and take the appropriate action.
If you want the player to actually CHOOSE the item from their inventory, what you're after is the Select Key Item command, under the Message group on the first tab of event commands.
You use that command, and tell it what variable the selected item's id should go into. Then you can use a conditional branch to see if that variable is set to the item id that's necessary to open the door (or whatever) and perform the action, otherwise show the text.
So it'll be something like this (an event on the wall where the hammer is meant to be used):
Select Key Item: [0001: Item Selected]Conditional Branch: Variable [0001: Item Selected] == 53 (53 is the id of the hammer) .. do what needs to be done when they use the hammer on the wallElse Show Text: Something else might work better here.Branch End -
How do I make the item call a common event? (Sorry, bit of a newbie here) Because, that would be very very helpful to know, and might be exactly what I'm working for.A little bit additional info:
You're trying to make an item that can be used anywhere, but the result will only happen in specific situations or positions.
Usually the games with RM work the other way around, that' what Shaz explained: you place an event in the specific position or situation, and when the player starts the interaction with the event it will check or ask for existing items.
Both approaches can be done, but which one to choose depends on what you want to do.
If that is a key only usable on specific doors or something like that, you should make the door an event checking for the item.
If the item is something that can be used almost everywhere (like a showel to dig in the ground), then you make that item call a common event, and have that event check the position of the player to decide what to do. That check should be done using region-ID or terrain-tag, if it should have results in many places (planting a seed) and specific coordinate checks if you're looking for a rare result (digging up a treasure) -
Hana, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
Just edit your last post instead. To reply to several people at once and quote them, use the MultiQuote button (though you don't have to quote everyone you reply to, and if you do, you should remove any unnecessary information from the quote, so it doesn't take up a heap of room).
On the Item, add a new Feature. On the Other tab, there's a Common Event option. -
OH, I'm so sorry! I'll remember that thank you, and uhm, I get how to add it now, but I'm not sure what to add to make it do what Andar said..
-
It depends on the item, and how and where it will be used. Give us details about exactly what you want to achieve with this item, and we'll tell you how to do it. Note, Andar said a common event was best for an item that can be used almost anywhere. This would NOT apply to using a key to unlock a door, or a hammer to break something.
-
Er, well, I just need an example and I'll be able to base other things off of it. I'd just like to know how you make it check your location, and if it's the correct location, a reaction happens. For example, what he said about the thing with the shovel. Sorry if I'm asking too many questions or not being clear enough..
-
If you want to be able to use an item anywhere and see if something happens, go to the region layer on the map, choose a region number that will ONLY be used for that purpose (I add a 'documentation' script right at the top, where I list region ids, terrain tags, etc, that I've used, and for what purpose, so I don't accidentally use the same one for different things, which would cause problems). Then paint using that region ID on any tile where you want the player to be able to use that item.
Then in your common event for that item, use Control Variables to get the player's X and Y positions into two variables, and then use the Get Location Info command (third tab of event commands) to get the region id into yet another variable, using the previous two variables as location designators.
You don't have to use regions. If you want to say a particular tile is the 'target' (let's say you have a mound of dirt in your tileset) and the player can dig there, you could get the tile ID into the variable instead of the region id. Or you could set your tileset to give that tile a specific terrain tag, then the Get Location Info command will return the terrain tag of the tile under the player. -
I'm horribly sorry but what?..could you maybe write out the contents like you did earlier with the select key item thing? I feel so noobish right now, because I am soo lost..I really hate to be a bother, but I suppose if I don't ask I'll never learn. I don't understand how I'm supposed to get the positions into variables or how to get the reigon ID into a variable, or what, or how to trigger the reaction.Then in your common event for that item, use Control Variables to get the player's X and Y positions into two variables, and then use the Get Location Info command (third tab of event commands) to get the region id into yet another variable, using the previous two variables as location designators.
-
lol - alright. Let's assume you're giving the player a shovel and they can dig anywhere on the map, but only if they dig in certain places will they get a treasure. On the region layer, choose a region id that you haven't used ANYWHERE else in the game, and paint with that region id over the special places that will give them a treasure (let's say it'll be 10 gold coins).
Now in your common event, you'll do this (you probably won't use the same variable ids that I'm using):
Code:Hope that's a bit more helpful.Control Variables [0001: Player's X] = Game Data > Character > Player's > Map XControl Variables [0002: Player's Y] = Game Data > Character > Player's > Map YGet Location Info: Variable [0003: Region ID] = Region ID ([0001: Player's X], [0002: Player's Y])Conditional Branch: Variable [0003: Region ID] == 63 (or whatever region id you're using) Show Text: You dig with your shovel and find 10 gold coins! Change Gold: +10Else Show Text: You dig with your shovel but find nothing.Branch End -
Oh my gosh, that's perfect, thank you soo much! One last question, what do I do if I want it to have multiple reactions, like she finds 10 gold in some areas, but in like two or three areas she finds 100 gold. I toyed with it, but I can't seem to figure it out.
-
Sure ... how do you want to determine where she finds 100 gold? Do you want to fix the locations, or do you want to make it random - say every 1 out of 5 times, she gets 100 gold? I'll give you both methods.
If you want to have fixed locations where she'll get 100 gold, then use two region IDs. One will be for the low amount of gold (10), and one will be for the high amount (100). Here's how to do that:
Code:If you don't want to fix the position of the big gold amounts, but give, say a 1 in 5 chance of getting 100 gold instead of 10, you'll just use the one region id as in the original example, but you'll use a random number to determine how much gold to give. Here's how to do that:Control Variables [0001: Player's X] = Game Data > Character > Player's > Map XControl Variables [0002: Player's Y] = Game Data > Character > Player's > Map YGet Location Info: Variable [0003: Region ID] = Region ID ([0001: Player's X], [0002: Player's Y])Conditional Branch: Variable [0003: Region ID] == 63 (or whatever region id you're using for 10 gold) Show Text: You dig with your shovel and find 10 gold coins! Change Gold: +10Else Conditional Branch: Variable [0003: Region ID] == 62 (or whatever region id you're using for 100 gold) Show Text: You dig with your shovel and find 100 gold coins! Change Gold: +100 Else Show Text: You dig with your shovel but find nothing. Branch EndBranch End
Code:Of course, since it's random, you can't really control how many of those locations EXACTLY will give 100 gold coins. It will be ABOUT 1 in 5.Control Variables [0001: Player's X] = Game Data > Character > Player's > Map XControl Variables [0002: Player's Y] = Game Data > Character > Player's > Map YGet Location Info: Variable [0003: Region ID] = Region ID ([0001: Player's X], [0002: Player's Y])Conditional Branch: Variable [0003: Region ID] == 63 (or whatever region id you're using) Control Variables [0004: Random Number] = Random Number (1 - 5) Conditional Branch: Variable [0004: Random Number] == 1 Show Text: You dig with your shovel and find 100 gold coins! Change Gold: +100 Else Show Text: You dig with your shovel and find 10 gold coins! Change Gold: +10 Branch EndElse Show Text: You dig with your shovel but find nothing.Branch End -
Ahh, thank you soooo much! You've been sooo helpful, I thank you endlessly!
-
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.