Difference between revisions of "Scripting"
From Wolfire Games Wiki
(better tables) |
|||
Line 7: | Line 7: | ||
You can check for keypresses by using the '''boolean''' check function '''GetInputDown()''': | You can check for keypresses by using the '''boolean''' check function '''GetInputDown()''': | ||
− | + | Syntax examples: | |
− | + | {| class="wikitable" border="1" | |
− | + | |- | |
− | + | |GetInputDown("a") | |
+ | |returns true if the 'a' key is being pressed, returns false if not | ||
+ | |- | ||
+ | |GetInputDown("attack") | ||
+ | |returns true if the mouse left key is being pressed, returns false if not | ||
+ | |- | ||
+ | |GetInputDown("move_left") | ||
+ | |returns true if the "left key" is being pressed, returns false if not (by default this key is defined in the config.txt to be the 'a' key) | ||
+ | |} | ||
Line 48: | Line 56: | ||
|} | |} | ||
− | + | '''Generic Key References''' | |
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- |
Revision as of 22:19, 10 February 2010
Overgrowth is using AngelScript as its core scripting language. Resources for learning AngelScript can be found here:
Checking for Keypresses:
You can check for keypresses by using the boolean check function GetInputDown():
Syntax examples:
GetInputDown("a") | returns true if the 'a' key is being pressed, returns false if not |
GetInputDown("attack") | returns true if the mouse left key is being pressed, returns false if not |
GetInputDown("move_left") | returns true if the "left key" is being pressed, returns false if not (by default this key is defined in the config.txt to be the 'a' key) |
The following controls are designed to be relative to the player's preferences and are given a binding in the config.txt file.
Config.txt Dependent References
Predefined Term | Default binding in Config.txt | Scripting Reference Name |
---|---|---|
Left Key | a | move_left |
Right Key | d | move_right |
Up Key | w | move_up |
Down Key | s | move_down |
Crouch Key | left shift | crouch |
Jump Key | space | jump |
Generic Key References
Desired Input Key | Scripting Representation |
---|---|
left mouse button | attack |
right mouse button | grab |
a | a |
b | b |
c | c |
d | d |
e | e |
f | f |
g | g |
h | h |
i | i |
j | j |
k | k |
l | l |
m | m |
n | n |
o | o |
p | p |
q | q |
r | r |
s | s |
t | t |
u | u |
v | v |
w | w |
x | x |
y | y |
z | z |