RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] Keys, repeating keys, FRUSTRATION

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 46
Overlord in Training
So I'm doing a CBS that requires heavy custom key use.  8)

I want to be able to register the input of a key one time, and not register it again until released and then pushed again. As of now, I have to use the wait command, but that just generates lag, and doesn't stop the repeating.

If you want a specific example, here it is:

I use the key A to bring up the menu,
I use the key A to select a command: Move,
then I use the key A to choose a destination.

As of right now, the button will bring up the menu and immediately jump to the first command on the list, because it repeats. Using wait x amount of frames only creates lag and doesn't prevent the repeat.  :mad:

Believe me, I did a search for this, and did not find what I was looking for...with some exception. Do I need to go out and get a custom keys script? Or is there a simpler way I'm not catching? I've experimented a little, but it just hasn't clicked yet.

This is essential to improving gameplay experience, if you help me, I will appreciate it very much, and you'll end up in the credits in my game  :blizj: (for whatever that's worth haha.)

Thanks. :D
« Last Edit: May 26, 2015, 12:58:16 AM by yuyu! »

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
A screenshot of your code/event would help.

Code: [Select]
Input.trigger?(:A) # Only registers once
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

**
Rep:
Level 46
Overlord in Training
Ok, but it's gonna be ugly...Its a tactical battle system. I can give a more primitive example that would equal essentially the same thing. BRB

In an ideal world, pic1 would not flicker when a is held. But rather, I would have to release and then push again to change anything.

This is an oversimplification, but a sufficient example.

Btw, can I really copy and paste that code.? Will it work?

« Last Edit: January 30, 2013, 01:34:24 PM by Razma »

**
Rep:
Level 46
Overlord in Training
So I pasted that code in the event, and the only thing that happened was that a did not seem to register at all :p

*
Rep:
Level 82
You'll have to use:

Code: [Select]
Input.trigger?(Input::A)

with RMXP.

Put it as a script entry in a conditional branch. So instead of having 'Conditional Branch: Key A Pushed' it will say 'Conditional Branch: Script: Input.trigger?(Input::A)'

I tried this with a parallel processed event that showed a picture for 60 frames then erased it only if the 'A' key was pressed (which is 'Z' or 'Shift' by default). The picture only showed for that ~1 second then disappeared once no matter how long I held the A key for.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

**
Rep:
Level 46
Overlord in Training
Thanks Logan! You are always so damn helpful. It did the same exact thing for me just now! (I guess you did know the answer after all, haha.)

Thankyou also D&P3, I just realized I did not specify that I was using RMXP, I appreciate your help as well.