CheckInput(str alias)

Moderator: GZDoom Developers

Post Reply
User avatar
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:

CheckInput(str alias)

Post by Matt »

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.
User avatar
Enjay
 
 
Posts: 27072
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: CheckInput(str alias)

Post by Enjay »

Vaecrius wrote:like checking if someone is crouching.
Not if the player uses crouch toggle (like me) rather than just crouch.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

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.
User avatar
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:

Post by Matt »

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.
Err, yeah, that's what I meant but didn't know what the word was. ^^;

(Out of curiosity, though... could ACS directly check if someone's hitting a key?)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Doubtful.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

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.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Yeah, all that sounds like WFDS to me. :P
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”