diff options
Diffstat (limited to 'Northstar.CustomServers/mod')
3 files changed, 61 insertions, 25 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut index db1b7edd..dddad821 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut @@ -15,6 +15,8 @@ struct HardpointStruct array<entity> imcCappers array<entity> militiaCappers + + } struct CP_PlayerStruct @@ -146,7 +148,7 @@ void function RateSpawnpoints_CP( int checkClass, array<entity> spawnpoints, int entity friendlyHardpoint // determine our furthest out hardpoint foreach ( entity hardpoint in HARDPOINTS ) { - if ( hardpoint.GetTeam() == player.GetTeam() && GetGlobalNetFloat( "objective" + hardpoint.kv.hardpointGroup + "Progress" ) >= 0.95 ) + if ( hardpoint.GetTeam() == player.GetTeam() && GetGlobalNetFloat( "objective" + GetHardpointGroup(hardpoint) + "Progress" ) >= 0.95 ) { if ( IsValid( friendlyHardpoint ) ) { @@ -182,10 +184,14 @@ void function SpawnHardpoints() // spawnpoints are CHardPoint entities // init the hardpoint ent int hardpointID = 0 - if ( spawnpoint.kv.hardpointGroup == "B" ) - hardpointID = 1 - else if ( spawnpoint.kv.hardpointGroup == "C" ) - hardpointID = 2 + string group = GetHardpointGroup(spawnpoint) + if ( group == "B" ) + hardpointID = 1 + else if ( group == "C" ) + hardpointID = 2 + + + spawnpoint.SetHardpointID( hardpointID ) SpawnHardpointMinimapIcon( spawnpoint ) @@ -193,6 +199,8 @@ void function SpawnHardpoints() HardpointStruct hardpointStruct hardpointStruct.hardpoint = spawnpoint hardpointStruct.prop = CreatePropDynamic( spawnpoint.GetModelName(), spawnpoint.GetOrigin(), spawnpoint.GetAngles(), 6 ) + + entity trigger = GetEnt( expect string( spawnpoint.kv.triggerTarget ) ) hardpointStruct.trigger = trigger @@ -200,9 +208,9 @@ void function SpawnHardpoints() file.hardpoints.append( hardpointStruct ) HARDPOINTS.append( spawnpoint ) // for vo script spawnpoint.s.trigger <- trigger // also for vo script - - SetGlobalNetEnt( "objective" + spawnpoint.kv.hardpointGroup + "Ent", spawnpoint ) - + + SetGlobalNetEnt( "objective" + group + "Ent", spawnpoint ) + // set up trigger functions trigger.SetEnterCallback( OnHardpointEntered ) trigger.SetLeaveCallback( OnHardpointLeft ) @@ -225,33 +233,33 @@ void function SpawnHardpointMinimapIcon( entity spawnpoint ) // functions for handling hardpoint netvars void function SetHardpointState( HardpointStruct hardpoint, int state ) { - SetGlobalNetInt( "objective" + hardpoint.hardpoint.kv.hardpointGroup + "State", state ) + SetGlobalNetInt( "objective" + GetHardpointGroup(hardpoint.hardpoint) + "State", state ) hardpoint.hardpoint.SetHardpointState( state ) } int function GetHardpointState( HardpointStruct hardpoint ) { - return GetGlobalNetInt( "objective" + hardpoint.hardpoint.kv.hardpointGroup + "State" ) + return GetGlobalNetInt( "objective" + GetHardpointGroup(hardpoint.hardpoint) + "State" ) } void function SetHardpointCappingTeam( HardpointStruct hardpoint, int team ) { - SetGlobalNetInt( "objective" + hardpoint.hardpoint.kv.hardpointGroup + "CappingTeam", team ) + SetGlobalNetInt( "objective" + GetHardpointGroup(hardpoint.hardpoint) + "CappingTeam", team ) } int function GetHardpointCappingTeam( HardpointStruct hardpoint ) { - return GetGlobalNetInt( "objective" + hardpoint.hardpoint.kv.hardpointGroup + "CappingTeam" ) + return GetGlobalNetInt( "objective" + GetHardpointGroup(hardpoint.hardpoint) + "CappingTeam" ) } void function SetHardpointCaptureProgress( HardpointStruct hardpoint, float progress ) { - SetGlobalNetFloat( "objective" + hardpoint.hardpoint.kv.hardpointGroup + "Progress", progress ) + SetGlobalNetFloat( "objective" + GetHardpointGroup(hardpoint.hardpoint) + "Progress", progress ) } float function GetHardpointCaptureProgress( HardpointStruct hardpoint ) { - return GetGlobalNetFloat( "objective" + hardpoint.hardpoint.kv.hardpointGroup + "Progress" ) + return GetGlobalNetFloat( "objective" + GetHardpointGroup(hardpoint.hardpoint) + "Progress" ) } @@ -543,8 +551,8 @@ void function HardpointThink( HardpointStruct hardpoint ) { SetHardpointState( hardpoint, CAPTURE_POINT_STATE_AMPED ) // can't use the dialogue functions here because for some reason GamemodeCP_VO_Amped isn't global? - PlayFactionDialogueToTeam( "amphp_youAmped" + hardpointEnt.kv.hardpointGroup, cappingTeam ) - PlayFactionDialogueToTeam( "amphp_enemyAmped" + hardpointEnt.kv.hardpointGroup, GetOtherTeam( cappingTeam ) ) + PlayFactionDialogueToTeam( "amphp_youAmped" + GetHardpointGroup(hardpoint.hardpoint), cappingTeam ) + PlayFactionDialogueToTeam( "amphp_enemyAmped" + GetHardpointGroup(hardpoint.hardpoint), GetOtherTeam( cappingTeam ) ) if(!hasBeenAmped){ hasBeenAmped=true @@ -671,12 +679,23 @@ string function CaptureStateToString( int state ) void function DEV_PrintHardpointsInfo() { foreach (entity hardpoint in HARDPOINTS) - { + { + printt( - "Hardpoint:", hardpoint.kv.hardpointGroup, + "Hardpoint:", GetHardpointGroup(hardpoint), "|Team:", Dev_TeamIDToString(hardpoint.GetTeam()), "|State:", CaptureStateToString(hardpoint.GetHardpointState()), - "|Progress:", GetGlobalNetFloat("objective" + hardpoint.kv.hardpointGroup + "Progress") + "|Progress:", GetGlobalNetFloat("objective" + GetHardpointGroup(hardpoint) + "Progress") ) + + } } + +string function GetHardpointGroup(entity hardpoint) //Hardpoint Entity B on Homestead is missing the Hardpoint Group KeyValue +{ + if((GetMapName()=="mp_homestead")&&(!hardpoint.HasKey("hardpointGroup"))) + return "B" + + return string(hardpoint.kv.hardpointGroup) +}
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut index 9446a8c2..cb277b00 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut @@ -129,7 +129,7 @@ void function CreateFlagIfNoFlagSpawnpoint() foreach ( entity hardpoint in GetEntArrayByClass_Expensive( "info_hardpoint" ) ) { - if ( hardpoint.kv.hardpointGroup == "B" ) + if ( GetHardpointGroup(hardpoint) == "B" ) { CreateFlag( hardpoint ) return @@ -160,4 +160,12 @@ void function GamemodeSpeedball_OnWinnerDetermined() { if(IsValid(file.flagCarrier)) file.flagCarrier.AddToPlayerGameStat( PGS_ASSAULT_SCORE, 1 ) +} + +string function GetHardpointGroup(entity hardpoint) //Hardpoint Entity B on Homestead is missing the Hardpoint Group KeyValue +{ + if((GetMapName()=="mp_homestead")&&(!hardpoint.HasKey("hardpointGroup"))) + return "B" + + return string(hardpoint.kv.hardpointGroup) }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut index 8331a81a..260168d0 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_hardpoints.gnut @@ -15,13 +15,13 @@ void function Hardpoints_Init() } float function CapturePoint_GetStartProgress( entity hardpoint ) -{ - return GetGlobalNetFloat( "objective" + hardpoint.kv.hardpointGroup + "Progress" ) +{ + return GetGlobalNetFloat( "objective" + GetHardpointGroup(hardpoint) + "Progress" ) } int function CapturePoint_GetCappingTeam( entity hardpoint ) -{ - return GetGlobalNetInt( "objective" + hardpoint.kv.hardpointGroup + "CappingTeam" ) +{ + return GetGlobalNetInt( "objective" + GetHardpointGroup(hardpoint) + "CappingTeam" ) } int function CapturePoint_GetOwningTeam( entity hardpoint ) @@ -30,6 +30,15 @@ int function CapturePoint_GetOwningTeam( entity hardpoint ) } float function CapturePoint_GetGoalProgress( entity hardpoint ) +{ + + return GetGlobalNetFloat( "objective" + GetHardpointGroup(hardpoint) + "Progress" ) +} + +string function GetHardpointGroup(entity hardpoint) //Hardpoint Entity B on Homestead is missing the Hardpoint Group KeyValue { - return GetGlobalNetFloat( "objective" + hardpoint.kv.hardpointGroup + "Progress" ) + if((GetMapName()=="mp_homestead")&&(!hardpoint.HasKey("hardpointGroup"))) + return "B" + + return string(hardpoint.kv.hardpointGroup) }
\ No newline at end of file |