-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAAK.tscript
More file actions
104 lines (88 loc) · 3.17 KB
/
AAK.tscript
File metadata and controls
104 lines (88 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
function AAK::onCreate(%this)
{
}
function AAK::onDestroy(%this)
{
}
//This is called when the server is initially set up by the game application
function AAK::initServer(%this)
{
//Sample content
if(IsDirectory(%this.getModulePath() @ "/Samples/"))
{
%this.queueExec("./Samples/scripts/server/shapeBase");
//%this.queueExec("./scripts/server/aiPlayer");
%this.queueExec("./Samples/scripts/server/camera");
%this.queueExec("./Samples/scripts/server/commands");
%this.queueExec("./Samples/scripts/server/player");
%this.queueExec("./Samples/scripts/server/spawn");
}
%this.queueExec("./scripts/shared/ActionAdventureGame");
%this.queueExec("./scripts/server/triggerCallbacks");
if(isToolBuild())
{
%this.queueExec("./tools/debugging");
}
}
//This is called when the server is created for an actual game/map to be played
function AAK::onCreateGameServer(%this)
{
//Sample content
if(IsDirectory(%this.getModulePath() @ "/Samples/"))
{
$MaxSkinBones = 72;
%this.registerDatablock("./Samples/scripts/datablocks/sounds");
%this.registerDatablock("./Samples/scripts/datablocks/player");
%this.registerDatablock("./Samples/scripts/datablocks/aiPlayer");
%this.registerDatablock("./Samples/scripts/datablocks/dust");
%this.registerDatablock("./Samples/scripts/datablocks/triggers");
}
%this.registerDatablock("./scripts/datablocks/camera");
%this.registerDatablock("./scripts/datablocks/triggers");
}
//This is called when the server is shut down due to the game/map being exited
function AAK::onDestroyGameServer(%this)
{
}
//This is called when the client is initially set up by the game application
function AAK::initClient(%this)
{
if(IsDirectory(%this.getModulePath() @ "/Samples/"))
{
$MaxSkinBones = 72;
if (!$Server::Dedicated)
{
//client scripts
$KeybindPath = "./Samples/scripts/client/defaultkeybinds." @ $TorqueScriptFileExtension;
exec($KeybindPath);
//gui
//
exec("./Samples/scripts/client/inputCommands");
%this.queueExec("./Samples/scripts/client/playGUI");
//client only sounds
%this.queueExec("./Samples/art/clientMusic");
%this.queueExec("./scripts/shared/ActionAdventureGame");
}
}
}
//This is called when a client connects to a server
function AAK::onCreateClientConnection(%this)
{
}
//This is called when a client disconnects from a server
function AAK::onDestroyClientConnection(%this)
{
}
function aakPlayerMetricsCallback()
{
return " | AAKPlayer |\n" @
" is jumping: " @ $AAKPlayer::jumping @ "\n" @
" jump height: " @ $AAKPlayer::jumpHeight @ "\n" @
" num of jumps: " @ $AAKPlayer::numberOfJumps @ "\n" @
" jumping accel: " @ $AAKPlayer::jumpingAccel @ "\n" @
" max jump accel: " @ $AAKPlayer::maxJumpAccel @ "\n" @
" acceleration z: " @ $AAKPlayer::acceleration_z @ "\n" @
" max jump speed: " @ $AAKPlayer::maxJumpSpeed @ "\n" @
" velocity z: " @ $AAKPlayer::velocity_z @ "\n" @
" horiz velocity: " @ $AAKPlayer::hor_vel;
}