Item only used with a certain key.

matthewk1462

Villager
Member
Joined
Feb 4, 2014
Messages
13
Reaction score
0
First Language
English
Primarily Uses
Hello, I need some help with Item using. When I equip an item it uses it. I want it so only one key can use an item. For example all seeds for my farm are planted as soon as a I equip can I make it so Certain items can only be used with a certain key like "S" key for example and cannot be used with enter? 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
I think you confused several different things with each other.


"Items" are database objects that can only be used from the menu, they have nothing to do with map events or with equipable weapons or armors.


Items are used by opening the menu, then selecting them on the item list and then pressing enter - why would you want to use a different key at that moment in the menu?
 

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
Forgive me for butting in and bringing up a dead topic, but I THINK I get where OP is coming from... For example, there's X item that fires Y lasers or whatever when you press the S (or whatever custom) key.  I've seen it done before and some devs claim it can be done with eventing only...  (I'd sure like to see how myself!)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
It would be better to get further explanation from the OP on how this would work with is own example (seeds), than to throw other examples around that may need a different kind of implementation.


I am guessing they want to "equip" a bag/packet of seeds, return to the map, then walk around pressing S, and every time S is pressed, a seed will be planted (and maybe the number of seeds left is reduced).


You would need to have your item call a common event that would turn on a switch. Then you'd have a parallel process on the map (or a common event) conditioned by that switch, that would then monitor for that key being pressed. Every time it is, a seed would be planted. If you want the player to be able to plant an unlimited number of seeds, your common event attached to the item would actually toggle the switch (if it's on, turn it off, otherwise turn it on). If you want them to use seeds every time they press the button, and have it stop automatically once they run out, you'd have your event monitoring for the keypress reduce the number of seeds, then check if there are 0 in inventory. If there are 0, it would turn the switch back off again.


In either case, you would needs events all over the map (or wherever they can be planted) that would also have to be activated to show the correct graphic, or a spawning script that would add the event when needed and make sure it stays there when you leave the map and return.
 

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
It would be better to get further explanation from the OP on how this would work with is own example (seeds), than to throw other examples around that may need a different kind of implementation.

I am guessing they want to "equip" a bag/packet of seeds, return to the map, then walk around pressing S, and every time S is pressed, a seed will be planted (and maybe the number of seeds left is reduced).

You would need to have your item call a common event that would turn on a switch. Then you'd have a parallel process on the map (or a common event) conditioned by that switch, that would then monitor for that key being pressed. Every time it is, a seed would be planted. If you want the player to be able to plant an unlimited number of seeds, your common event attached to the item would actually toggle the switch (if it's on, turn it off, otherwise turn it on). If you want them to use seeds every time they press the button, and have it stop automatically once they run out, you'd have your event monitoring for the keypress reduce the number of seeds, then check if there are 0 in inventory. If there are 0, it would turn the switch back off again.

In either case, you would needs events all over the map (or wherever they can be planted) that would also have to be activated to show the correct graphic, or a spawning script that would add the event when needed and make sure it stays there when you leave the map and return.
Ah! I see.  I've been having a similar problem myself too recently. I'm glad I found this thread (rather than spam the forums and start my own), I think I'll follow this one.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,015
Members
137,563
Latest member
MinyakaAeon
Top