Difference between revisions of "Scripting"

From Wolfire Games Wiki
Jump to: navigation, search
(Links to AngelScript Wikipedia article & labeled manual link. Link to config.txt)
Line 1: Line 1:
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]
+
Overgrowth uses [http://en.wikipedia.org/wiki/AngelScript AngelScript] as its core '''scripting''' language. The [http://www.angelcode.com/angelscript/sdk/docs/manual/index.html AngelScript Manual] is the best place to start learning.
 
 
 
 
 
 
Checking for User Input:
 
  
 +
= Checking for User Input: =
 
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:
 
Syntax examples:
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 22: Line 18:
  
  
The following controls are designed to be relative to the player's preferences and are given a binding in the config.txt file.
+
The following controls are designed to be relative to the player's preferences and are given a binding in the [[config.txt|config.txt]] file.
  
 
'''Config.txt Dependent References'''
 
'''Config.txt Dependent References'''
Line 210: Line 206:
 
power
 
power
 
euro</pre>
 
euro</pre>
 
 
  
 
[[Category:Overgrowth]]
 
[[Category:Overgrowth]]

Revision as of 04:09, 12 February 2011

Overgrowth uses AngelScript as its core scripting language. The AngelScript Manual is the best place to start learning.

Checking for User Input:

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


Mouse Input

Mouse Button Scripting Reference Name
Left Mouse Button attack
Right Mouse Button grab


Generic Key References

Here is a complete list of scripting tags for key presses:

backspace
tab
clear
return
pause
esc
space
!
"
#
$
&
'
(
)
*
+
,
-
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
[
\
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
delete
keypad0
keypad1
keypad2
keypad3
keypad4
keypad5
keypad6
keypad7
keypad8
keypad9
keypad.
keypad/
keypad*
keypad-
keypad+
keypadenter
keypad=
up
down
right
left
insert
home
end
pageup
pagedown
f1
f2
f3
f4
f5
f6
f7
f8
f9
f10
f11
f12
f13
f14
f15
numlock
capslock
scrollock
rshift
lshift
rctrl
lctrl
ralt
lalt
rmeta
lmeta
lsuper
rsuper
mode
compose
help
print
sysreq
break
menu
power
euro