Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Player input reading with ScriptAPI

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
Hyrin
Meatbag
Posts: 5
Joined: Fri Dec 08, 2017 3:05 pm

Player input reading with ScriptAPI

Post by Hyrin » Fri Dec 08, 2017 3:16 pm

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.
Last edited by JakSparro98 on Mon Apr 01, 2019 1:49 pm, edited 1 time in total.
Reason: changed topic title in a more proper one
0 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Fri Dec 08, 2017 6:42 pm

You can not read input from the keyboard using the ScriptAPI.
0 x
Gurt

Hyrin
Meatbag
Posts: 5
Joined: Fri Dec 08, 2017 3:05 pm

Post by Hyrin » 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?
0 x

Hoang Marcel
Superfighter
Superfighter
Posts: 62
Joined: Sun Mar 20, 2016 3:40 am
Title: Custom map lover
Started SFD: PreAlpha 1.6.4
Location: Vietnam
Gender:

Post by Hoang Marcel » Wed Dec 13, 2017 5:44 am

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.
0 x

User avatar
hyper copter
Superfighter
Superfighter
Posts: 117
Joined: Thu Aug 31, 2017 11:38 am
Title: Leave my profile alone.
SFD Account: Hyper
SFD Alias: Hyper
Gender:
Age: 18

Post by hyper copter » 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. Is that what you meant, @Hyrin?
0 x
''The great thing about multitasking is that several things can go wrong at once."
- Andrew B. Sweger.

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Tue Feb 12, 2019 1:46 am

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.
0 x

Post Reply