aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut16
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut13
2 files changed, 23 insertions, 6 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut
index 3bc11c3ad..974481c18 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut
@@ -21,6 +21,7 @@ void function GamemodeSpeedball_Init()
AddSpawnCallbackEditorClass( "script_ref", "info_speedball_flag", CreateFlag )
+ AddCallback_GameStateEnter( eGameState.Prematch, CreateFlagIfNoFlagSpawnpoint )
AddCallback_GameStateEnter( eGameState.Playing, ResetFlag )
AddCallback_OnTouchHealthKit( "item_flag", OnFlagCollected )
AddCallback_OnPlayerKilled( OnPlayerKilled )
@@ -114,6 +115,21 @@ void function DropFlag()
file.flagCarrier = null
}
+void function CreateFlagIfNoFlagSpawnpoint()
+{
+ if ( IsValid( file.flag ) )
+ return
+
+ foreach ( entity hardpoint in GetEntArrayByClass_Expensive( "info_hardpoint" ) )
+ {
+ if ( hardpoint.kv.hardpointGroup == "B" )
+ {
+ CreateFlag( hardpoint )
+ return
+ }
+ }
+}
+
void function ResetFlag()
{
file.flag.ClearParent()
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
index d0d625b43..11587947f 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
@@ -104,7 +104,8 @@ void function OnPrematchStart()
entity militiaIon = CreatePropDynamic( $"models/titans/medium/titan_medium_ajax.mdl", < -1809.98, 2790.39, -1409 >, < 0, 80, 0 > )
thread PlayAnim( militiaIon, "at_titan_activation_wargames_intro" )
-
+ militiaIon.Anim_SetInitialTime( 4.5 )
+
entity militiaPilot = CreateElitePilot( TEAM_UNASSIGNED, < 0, 0, 0 >, < 0, 0, 0 > )
DispatchSpawn( militiaPilot )
militiaPilot.SetParent( militiaIon, "HIJACK" )
@@ -228,12 +229,12 @@ void function PlayerWatchesWargamesIntro( entity player )
player.MovementDisable()
player.SetInvulnerable()
- // spawn faction leader
- // no clue why client subtracts 4.5 from the time we give this, so just add it here instead
- if ( factionTeam == TEAM_IMC )
- Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnIMCFactionLeaderForIntro", file.introStartTime + 4.5, playerPod.GetEncodedEHandle() )
+ if ( factionTeam == TEAM_MILITIA && GetFactionChoice( player ) == "faction_marvin" )
+ Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnMilitiaFactionLeaderForIntro", file.introStartTime, playerPod.GetEncodedEHandle() )
+ else if ( factionTeam == TEAM_MILITIA )
+ Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnMilitiaFactionLeaderForIntro", file.introStartTime + 1.75, playerPod.GetEncodedEHandle() )
else
- Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnMilitiaFactionLeaderForIntro", file.introStartTime + 4.5, playerPod.GetEncodedEHandle() )
+ Remote_CallFunction_NonReplay( player, "ServerCallback_SpawnIMCFactionLeaderForIntro", file.introStartTime + 4.5, playerPod.GetEncodedEHandle() )
// idle pod sequence
FirstPersonSequenceStruct podIdleSequence