-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinventorySystem.tscript
More file actions
51 lines (44 loc) · 1.6 KB
/
inventorySystem.tscript
File metadata and controls
51 lines (44 loc) · 1.6 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
function inventorySystem::onCreate(%this)
{
}
function inventorySystem::onDestroy(%this)
{
}
//This is called when the server is initially set up by the game application
function inventorySystem::initServer(%this)
{
%this.queueExec("./scripts/server/fileCommands");
%this.queueExec("./scripts/server/inventory.tscript");
%this.queueExec("./scripts/server/item.tscript");
%this.queueExec("./scripts/server/pickupItem.tscript");
}
//This is called when the server is created for an actual game/map to be played
function inventorySystem::onCreateGameServer(%this)
{
%this.registerDatablock("./datablocks/audioProfiles");
%this.registerDatablock("./datablocks/keyItem.tscript");
%this.registerDatablock("./datablocks/consumableItem.tscript");
%this.registerDatablock("./datablocks/moneyItem.tscript");
}
//This is called when the server is shut down due to the game/map being exited
function inventorySystem::onDestroyGameServer(%this)
{
}
//This is called when the client is initially set up by the game application
function inventorySystem::initClient(%this)
{
//client scripts
//Here, we exec out keybind scripts so the player is able to move when they get into a game
%this.queueExec("./scripts/client/default.keybinds.tscript");
%this.queueExec("./scripts/client/inputCommands.tscript");
}
//This is called when a client connects to a server
function inventorySystem::onCreateClientConnection(%this)
{
inventoryKeybindMap.push();
}
//This is called when a client disconnects from a server
function inventorySystem::onDestroyClientConnection(%this)
{
inventoryKeybindMap.pop();
}