Where name is any command with a + in it, e.g., +forward, +use, +[some custom alias]. Returns true if held (e.g., the player is pressing the forward button), false otherwise.
Would streamline a lot of stuff people are doing already, plus open up a few things like checking if someone is crouching.
CheckInput(str alias)
Moderator: GZDoom Developers
Re: CheckInput(str alias)
Not if the player uses crouch toggle (like me) rather than just crouch.Vaecrius wrote:like checking if someone is crouching.
This would work better if, instead of checking for a held key, it checks for an active alias.
In other words, don't check to see if they're holding down a key bound to crouch, but check if +movedown is currently active. That would solve Enjay's togglecrouch problem, and should work for what you're wanting as well.
In other words, don't check to see if they're holding down a key bound to crouch, but check if +movedown is currently active. That would solve Enjay's togglecrouch problem, and should work for what you're wanting as well.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Err, yeah, that's what I meant but didn't know what the word was. ^^;HotWax wrote:In other words, don't check to see if they're holding down a key bound to crouch, but check if +movedown is currently active. That would solve Enjay's togglecrouch problem, and should work for what you're wanting as well.
(Out of curiosity, though... could ACS directly check if someone's hitting a key?)
I would do it as a simple event system. Hardcoded actions (+attack, -use) would push predefined events to the event qeue (EVENT_AttackDown, EVENT_UseUp; each player has his own event qeue). For custom actions there would be a console command "pushevent", which the actions can alias. Executing "pushevent n" would push the event EVENT_UserEvent+n to the event qeue. In ACS there would be 2 new built-in functions, "bool CheckForEvents()" which returns true if there are any pending events in the activator's event qeue and "int PollEvent()" which gets event from the qeue.