CheckInput(str alias)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: CheckInput(str alias)

by HotWax » Fri Jun 22, 2007 9:03 am

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

by Grubber » Fri Jun 22, 2007 3:16 am

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.

by HotWax » Thu Jun 21, 2007 1:03 pm

Doubtful.

by Matt » Thu Jun 21, 2007 12:47 pm

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?)

by HotWax » Thu Jun 21, 2007 12:45 pm

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.

Re: CheckInput(str alias)

by Enjay » Thu Jun 21, 2007 12:37 pm

Vaecrius wrote:like checking if someone is crouching.
Not if the player uses crouch toggle (like me) rather than just crouch.

CheckInput(str alias)

by Matt » Thu Jun 21, 2007 12:27 pm

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.

Top