Just wanted to know if there is a script or snippet on using items...

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
533
Reaction score
321
First Language
English
Primarily Uses
RMVXA
in your inventory to solve puzzles. Like Resident Evil style.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,450
Reaction score
11,927
First Language
English
Primarily Uses
RMVXA
@Tanarex As not everyone will have played Resident Evil, you need to give at least some details of what that means if you want people to give accurate suggestions.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,811
Reaction score
14,977
First Language
English
Primarily Uses
RMMV
Haven't played it. You might need to explain the mechanic.

There is the Select Item command which will let you put an item id into a variable that you can then use for conditional branches.
There is also the Player has X in inventory conditional branch.

If you want something else, you'll need to give more info.
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
533
Reaction score
321
First Language
English
Primarily Uses
RMVXA
While in front of a puzzle box I want the player to have to go into their inventory and find the puzzle pieces (that they found earlier) and select it and it will fit into the box.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,811
Reaction score
14,977
First Language
English
Primarily Uses
RMMV
So you want them to open the menu and choose the item? Is there any special kind of UI, or is the puzzle box just an object in the scene that they interact with?

If no special UI, create a common event and add it to the puzzle pieces item. Make sure the item is NOT consumable, because you'll remove it manually ONLY if the player is in the correct spot. In the common event, you can do one of the following:

Option 1:
Paint the tile where the player needs to be standing with a region that will not be used anywhere else in the game (Let's assume region 52 and we want the player to be facing up).
In the common event, add the following commands:
Code:
Conditional Branch: Script: $gamePlayer.regionId() === 52 && $gamePlayer.direction() === 8
  ... do whatever commands you want if the player is standing in the right spot
  ... remove puzzle pieces from inventory
  ... display whatever message you want
  ... turn on whatever switch you want or any other actions necessary
Else
  Show Text: Nothing happened
End

Option 2:
No region - we'll just check the exact map id, player location, and direction. Let's assume we want them to use it on map 12, at x = 9 and y = 15 (this is where the player needs to stand, not where the box is), and they need to be facing up.
In the common event, add the following commands:
Code:
Conditional Branch: Script: $gameMap.mapId() === 12 && $gamePlayer.x === 9 && $gamePlayer.y === 15 && $gamePlayer.direction() === 8
  ... do whatever commands you want if the player is standing in the right spot
  ... remove puzzle pieces from inventory
  ... display whatever message you want
  ... turn on whatever switch you want or any other actions necessary
Else
  Show Text: Nothing happened
End
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
533
Reaction score
321
First Language
English
Primarily Uses
RMVXA
Well, this already sounds way too complicated for me. I guess I'll just hire a scripter again.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,811
Reaction score
14,977
First Language
English
Primarily Uses
RMMV
It's a conditional branch where you do one thing if it's true and another if it's not. Nothing complicated about that.

If you prefer, I can ditch the script calls and give it to you purely using event commands, but it will be quite a bit longer.

Hiring a scripter for this will be a waste of money. Of course you didn't answer any of my questions, so I don't even know if that's what you want.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,187
Reaction score
720
First Language
English
Primarily Uses
RMVXA
this already sounds way too complicated for me
Maybe, but I think Tsukihime's script Event Trigger Labels will do what you want.
Unless you want something fancy. this is just a basic window showing key items.
If you pick the correct item, it uses it.
You have to do the eventing, but the script just gives you an interface to select items.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,811
Reaction score
14,977
First Language
English
Primarily Uses
RMMV
Couldn't you do that with the Select Item event command and a conditional branch to see if item X was chosen?
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
533
Reaction score
321
First Language
English
Primarily Uses
RMVXA
Yes, I want them to enter their menu and use the items from the inventory. Right now I have it so the puzzle box checks for all the items and then uses it automatically if the character has them all. Which is way too easy. I didn't even consider a UI. But it would be cool if a picture pops up when they completed the puzzle of the end result. The puzzle box is in the middle of the room. Maybe only triggered when in front of it. Otherwise, a message says 'You need to be in front of it.' Victor's moving platform is also causing issues that affect events. I have control branches and stuff. It's all the things you glossed over that i'm unclear on.
@Roninator2 It might be what I want. But it's 4 puzzle pieces, not one. And Hime wants to be contacted for commercial games. And I want the player to figure out that they need to go into their inventory to use the items. Not that the inventory screen just pops up when they click on the puzzle box.
 

Latest Threads

Latest Posts

Latest Profile Posts

Feeling cute, might make an essay on the presence of Malaise in the gaming industry. idk
Just went to Metrocon here in Tampa Florida. My first anime convention. They had an anime chess battle and some funny impromtu comedy. The comedy was my favorite part. How is everyone?
I'm thinking about opening a "game in development" thread, though i'm not entirely sure yet. It's still really early in development, and most i have to show are assets or really chaotic map WIPs. There is a lot of story +the world itself though, and i struggle with converting all of my notes into readable text, and a thread might help...?
I see a button in a game, I press it. Cannot resist the temptation even if I know it's a trap.

Forum statistics

Threads
113,591
Messages
1,076,067
Members
147,588
Latest member
daldantas
Top