aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_fw_custom.nut
blob: ca238d5d97cff5cecedf6188a43fcd6577dbf34a (plain)
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
// this script only exists to create the fw gamemode
// all client/shared gamelogic is still done in the gamemode's respective client and shared scripts
// these scripts are shipped with the game's official build so no need to recreate these
// their paths are gamemodes/cl_gamemode_fw.nut and gamemodes/sh_gamemode_fw.nut, respectively

global function SHCreateGamemodeFW_Init

void function SHCreateGamemodeFW_Init()
{
	AddCallback_OnCustomGamemodesInit( CreateGamemodeFW )
	AddCallback_OnRegisteringCustomNetworkVars( FWOnRegisteringNetworkVars )
}

void function CreateGamemodeFW()
{
	// we have to manually add the client/shared scripts to scripts.rson atm so we need to prevent compile errors when they aren't included
	// best way to do this is to just ignore this whole block for now and wait until we don't have to add them manually
	
	GameMode_Create( FORT_WAR )
	GameMode_SetName( FORT_WAR, "#GAMEMODE_fw" )
	GameMode_SetDesc( FORT_WAR, "#PL_fw_desc" )
	GameMode_SetGameModeAnnouncement( FORT_WAR, "ffa_modeDesc" ) // fw lines are unfortunately not registered to faction dialogue
	
		#if SERVER
			//GameMode_AddServerInit( FORT_WAR, GamemodeFW_Init ) // doesn't exist yet lol
		#elseif CLIENT
			GameMode_AddClientInit( FORT_WAR, CLGamemodeFW_Init )
		#endif
		#if !UI
			GameMode_AddSharedInit( FORT_WAR, SHGamemodeFW_Init )
		#endif
}

void function FWOnRegisteringNetworkVars()
{
	if ( GAMETYPE != FORT_WAR )
		return
	
	RegisterNetworkedVariable( "turretSite1", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite2", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite3", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite4", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite5", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite6", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite7", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite8", SNDC_GLOBAL, SNVT_ENTITY )
	RegisterNetworkedVariable( "turretSite9", SNDC_GLOBAL, SNVT_ENTITY )
	
	RegisterNetworkedVariable( "turretStateFlags1", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags2", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags3", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags4", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags5", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags6", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags7", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags8", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "turretStateFlags9", SNDC_GLOBAL, SNVT_INT )
	
	RegisterNetworkedVariable( "imcTowerThreatLevel", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "milTowerThreatLevel", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "fwCampAlertA", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "fwCampStressA", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "fwCampAlertB", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "fwCampStressB", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "fwCampAlertC", SNDC_GLOBAL, SNVT_INT )
	RegisterNetworkedVariable( "fwCampStressC", SNDC_GLOBAL, SNVT_INT )
	
	#if CLIENT                  
		CLFortWar_RegisterNetworkFunctions()
	#endif
}