Difference between revisions of "Scripting"

From Wolfire Games Wiki
Jump to: navigation, search
(creating table for list of inputs)
 
(better tables)
Line 1: Line 1:
Overgrowth is using AngelScript as its core scripting language.
+
Overgrowth is using AngelScript as its core scripting language. Resources for learning AngelScript can be found here:
 +
 
 +
 
  
 
Checking for Keypresses:
 
Checking for Keypresses:
Line 7: Line 9:
 
example:
 
example:
  
GetInputDown("a")
+
''GetInputDown("a")''
 +
 
 +
This GetInputDown will return true if the 'a' key is being held down and false if it is not.
 +
 
  
This code will return true if 'a' key is being held down and false if it is not.
+
The following controls are designed to be relative to the player's preferences and are given a binding in the config.txt file.
  
:end example
+
'''Config.txt Dependent References'''
 +
{| class="wikitable" border="1"
 +
|-
 +
!  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
 +
|}
  
 
List of key references
 
List of key references
Line 19: Line 54:
 
!  Desired Input Key
 
!  Desired Input Key
 
!  Scripting Representation
 
!  Scripting Representation
 +
|-
 +
|  left mouse button
 +
|  attack
 +
|-
 +
|  right mouse button
 +
|  grab
 
|-
 
|-
 
|  a
 
|  a
Line 97: Line 138:
 
|  z
 
|  z
 
|  z
 
|  z
|-
 
|  Left Mouse Button
 
|  attack
 
|-
 
|  x
 
|  x
 
|-
 
|  x
 
|  x
 
|-
 
|  x
 
|  x
 
|-
 
|  x
 
|  x
 
 
|}
 
|}

Revision as of 22:10, 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():

example:

GetInputDown("a")

This GetInputDown will return true if the 'a' key is being held down and false if it is not.


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

List of 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