forked from Torque3DResources/FPSGameplay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFPSGameplay.tscript
More file actions
132 lines (110 loc) · 5.08 KB
/
FPSGameplay.tscript
File metadata and controls
132 lines (110 loc) · 5.08 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// The general flow of a gane - server's creation, loading and hosting clients, and then destruction is as follows:
// First, a client will always create a server in the event that they want to host a single player
// game. Torque3D treats even single player connections as a soft multiplayer game, with some stuff
// in the networking short-circuited to sidestep around lag and packet transmission times.
// initServer() is called, loading the default server scripts.
// After that, if this is a dedicated server session, initDedicated() is called, otherwise initClient is called
// to prep a playable client session.
// When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
// connected to it via createAndConnectToLocalServer().
function FPSGameplay::onCreate( %this )
{
}
function FPSGameplay::onDestroy( %this )
{
}
function FPSGameplay::initServer(%this)
{
//server scripts
%this.queueExec("./scripts/server/aiPlayer");
%this.queueExec("./scripts/server/camera");
%this.queueExec("./scripts/server/chat");
%this.queueExec("./scripts/server/cheetah");
%this.queueExec("./scripts/server/commands");
%this.queueExec("./scripts/server/centerPrint");
%this.queueExec("./scripts/server/deathMatchGame");
%this.queueExec("./scripts/server/health");
%this.queueExec("./scripts/server/inventory");
%this.queueExec("./scripts/server/item");
%this.queueExec("./scripts/server/player");
%this.queueExec("./scripts/server/projectile");
%this.queueExec("./scripts/server/proximityMine");
%this.queueExec("./scripts/server/radiusDamage");
%this.queueExec("./scripts/server/shapeBase");
%this.queueExec("./scripts/server/spawn");
%this.queueExec("./scripts/server/teleporter");
%this.queueExec("./scripts/server/triggers");
%this.queueExec("./scripts/server/turret");
%this.queueExec("./scripts/server/vehicle");
%this.queueExec("./scripts/server/vehicleWheeled");
%this.queueExec("./scripts/server/VolumetricFog");
%this.queueExec("./scripts/server/weapon");
%this.queueExec("./scripts/server/physicsShape");
}
function FPSGameplay::onCreateGameServer(%this)
{
%this.registerDatablock("./datablocks/audioProfiles");
%this.registerDatablock("./datablocks/audioData");
%this.registerDatablock("./datablocks/sounds");
%this.registerDatablock("./datablocks/aiPlayer");
%this.registerDatablock("./datablocks/brushes");
%this.registerDatablock("./datablocks/environment");
%this.registerDatablock("./datablocks/health");
%this.registerDatablock("./datablocks/lights");
%this.registerDatablock("./datablocks/managedDatablocks");
%this.registerDatablock("./datablocks/managedDecalData");
%this.registerDatablock("./datablocks/managedForestItemData");
%this.registerDatablock("./datablocks/managedItemData");
%this.registerDatablock("./datablocks/managedParticleData");
%this.registerDatablock("./datablocks/managedParticleEmitterData");
%this.registerDatablock("./datablocks/markers");
%this.registerDatablock("./datablocks/particles");
%this.registerDatablock("./datablocks/physics");
%this.registerDatablock("./datablocks/player");
%this.registerDatablock("./datablocks/ribbons");
%this.registerDatablock("./datablocks/rigidShape");
%this.registerDatablock("./datablocks/teleporter");
%this.registerDatablock("./datablocks/triggers");
%this.registerDatablock("./datablocks/weapon");
%this.registerDatablock("./datablocks/vehicles/cheetahCar");
%this.registerDatablock("./datablocks/weapons/grenadefx");
%this.registerDatablock("./datablocks/weapons/Lurker");
%this.registerDatablock("./datablocks/weapons/ProxMine");
%this.registerDatablock("./datablocks/weapons/Ryder");
%this.registerDatablock("./datablocks/weapons/Turret");
}
function FPSGameplay::onDestroyGameServer(%this)
{
}
function FPSGameplay::initClient(%this)
{
%this.queueExec("./scripts/client/gameProfiles");
%this.queueExec("./scripts/client/inputCommands");
//guis
%this.queueExec("./guis/chatHud.gui");
%this.queueExec("./guis/playerList.gui");
%this.queueExec("./guis/playGui.gui");
%this.queueExec("./guis/hudlessGui.gui");
%this.queueExec("./scripts/client/playGui");
%this.queueExec("./scripts/client/hudlessGui");
%this.queueExec("./scripts/client/message");
%this.queueExec("./scripts/client/chatHud");
%this.queueExec("./scripts/client/clientCommands");
%this.queueExec("./scripts/client/messageHud");
%this.queueExec("./scripts/client/playerList");
%this.queueExec("./scripts/client/centerPrint");
%this.queueExec("./scripts/client/recordings");
%this.queueExec("./scripts/client/screenshot");
}
function FPSGameplay::onCreateClientConnection(%this)
{
//client scripts
$KeybindPath = "./scripts/client/default.keybinds." @ $TorqueScriptFileExtension;
exec($KeybindPath);
%prefPath = getPrefpath();
if(isFile(%prefPath @ "/keybinds." @ $TorqueScriptFileExtension))
exec(%prefPath @ "/keybinds." @ $TorqueScriptFileExtension);
}
function FPSGameplay::onDestroyClientConnection(%this)
{
}