Difference between revisions of "Scripting"

From Wolfire Games Wiki
Jump to: navigation, search
m (added category)
Line 1: Line 1:
Overgrowth is using AngelScript as its core scripting language. The best AngelScript reference is here
+
Overgrowth is using AngelScript as its core scripting language. The best AngelScript reference is here: [http://www.angelcode.com/angelscript/sdk/docs/manual/index.html]
http://www.angelcode.com/angelscript/sdk/docs/manual/index.html  
 
  
  
Line 147: Line 146:
 
|  z
 
|  z
 
|}
 
|}
 +
 +
 +
[[Category:Overgrowth]]

Revision as of 22:46, 18 February 2010

Overgrowth is using AngelScript as its core scripting language. The best AngelScript reference is here: [1]


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 left mouse button 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