Page 1 of 1

Player input reading with ScriptAPI

Posted: Fri Dec 08, 2017 3:16 pm
by Hyrin
Hello, I'm from Russia, so sorry for my English, if something goes wrong. I would like to create a map with controllable robots, for this I need to make a zone and when a player enters this zone and presses certain buttons on the keyboard, then certain triggers are activated. And can I still make it so that the design will be displayed horizontally when I click the button? In this topic, I would like to see a script template that reads the data from the keyboard in a certain area. If it can be done without a script, only triggers then how to do it?
 ! Message from: KliPeH
This user has been issued a warning for breaking the following forum rule:
Rule #9 - Use descriptive topic titles.

Re: Need help

Posted: Fri Dec 08, 2017 6:42 pm
by Gurt
You can not read input from the keyboard using the ScriptAPI.

Re: Need help

Posted: Fri Dec 08, 2017 6:58 pm
by Hyrin
Gurt wrote:
Fri Dec 08, 2017 6:42 pm
You can not read input from the keyboard using the ScriptAPI.
How in the tutorial is the count of jumping and movement?

Re: Need help

Posted: Wed Dec 13, 2017 5:44 am
by Hoang Marcel
Hyrin wrote:
Fri Dec 08, 2017 6:58 pm
Gurt wrote:
Fri Dec 08, 2017 6:42 pm
You can not read input from the keyboard using the ScriptAPI.
How in the tutorial is the count of jumping and movement?
The script in the tutorial checks the player's movement and action ingame. It doesn't read keyboard input.

Re: Need help

Posted: Mon Feb 11, 2019 1:56 pm
by hyper copter
It can read what keys a specific action is binded to though. For instance if set my key bindings so that the "J" key punches, The tutorial reads that and inputs "Press " J" to punch". I ain't no coder though. Is that what you meant, @Hyrin?

Re: Need help

Posted: Tue Feb 12, 2019 1:46 am
by JakSparro98
hyper copter wrote:
Mon Feb 11, 2019 1:56 pm
It can read what keys a specific action is binded to though. For instance if set my key bindings so that the "J" key punches, The tutorial reads that and inputs "Press " J" to punch". I ain't no coder though. [..]
The tutorial is catching player input ingeniously as the ScriptAPI can record most of the player actions (running, sprinting, diving, punching, etc...) but without a native input reading it's only that; text displaying the key you need to press is handled with a special string parsing, so you can write "press [attack_key] to attack" for example and the text within square brackets will be turned into your current punch key, in a few words, keystrokes reading is currently still far from being made.