diff options
Diffstat (limited to 'Northstar.CustomServers')
4 files changed, 156 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index 674d08df..6a0fdbef 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -7,6 +7,14 @@ global function DisableTitanSelection global function DisableTitanSelectionForPlayer global function EnableTitanSelection global function EnableTitanSelectionForPlayer +global function FD_DropshipSetAnimationOverride + +enum eDropshipState{ + Idle, + InProgress, + Returning + _count_ +} struct player_struct_fd{ bool diedThisRound @@ -30,6 +38,8 @@ struct player_struct_fd{ global HarvesterStruct& fd_harvester global vector shopPosition global vector shopAngles = < 0, 0, 0 > +global vector FD_spawnPosition +global vector FD_spawnAngles = < 0, 0, 0 > global table< string, array<vector> > routes global array<entity> routeNodes global array<entity> spawnedNPCs @@ -47,8 +57,45 @@ struct { table<entity,player_struct_fd> players entity harvester_info bool playersHaveTitans = false + + string animationOverride = "" + int dropshipState + int playersInShip + entity dropship + array<entity> playersInDropship }file + +const array<string> DROPSHIP_IDLE_ANIMS_POV = [ + + "ptpov_ds_coop_side_intro_gen_idle_B", + "ptpov_ds_coop_side_intro_gen_idle_A", + "ptpov_ds_coop_side_intro_gen_idle_C", + "ptpov_ds_coop_side_intro_gen_idle_D" +] + +const array<string> DROPSHIP_IDLE_ANIMS = [ + + "pt_ds_coop_side_intro_gen_idle_B", + "pt_ds_coop_side_intro_gen_idle_A", + "pt_ds_coop_side_intro_gen_idle_C", + "pt_ds_coop_side_intro_gen_idle_D" +] + +const array<string> DROPSHIP_EXIT_ANIMS_POV = [ + "ptpov_ds_coop_side_intro_gen_exit_B", + "ptpov_ds_coop_side_intro_gen_exit_A", + "ptpov_ds_coop_side_intro_gen_exit_C", + "ptpov_ds_coop_side_intro_gen_exit_D" +] + +const array<string> DROPSHIP_EXIT_ANIMS = [ + "pt_ds_coop_side_intro_gen_exit_B", + "pt_ds_coop_side_intro_gen_exit_A", + "pt_ds_coop_side_intro_gen_exit_C", + "pt_ds_coop_side_intro_gen_exit_D" +] + void function GamemodeFD_Init() { PrecacheModel( MODEL_ATTRITION_BANK ) @@ -121,6 +168,30 @@ void function FD_PlayerRespawnCallback( entity player ) // why in the fuck do i need to WaitFrame() here, this sucks thread PlayerEarnMeter_SetMode_Threaded( player, 0 ) } + + if( file.dropshipState == eDropshipState.Returning ) + return + if( GetGameState() != eGameState.Playing) + return + + if( player.IsTitan() ) + return + + player.SetInvulnerable() + if( file.dropshipState == eDropshipState.Idle ) + { + thread FD_DropshipSpawnDropship() + } + //Attach player + FirstPersonSequenceStruct idleSequence + idleSequence.firstPersonAnim = DROPSHIP_IDLE_ANIMS_POV[ file.playersInShip ] + idleSequence.thirdPersonAnim = DROPSHIP_IDLE_ANIMS[ file.playersInShip++ ] + idleSequence.attachment = "ORIGIN" + idleSequence.teleport = true + idleSequence.viewConeFunction = ViewConeFree + idleSequence.hideProxy = true + thread FirstPersonSequence( idleSequence, player, file.dropship ) + file.playersInDropship.append( player ) } @@ -1345,3 +1416,81 @@ void function DisableTitanSelectionForPlayer( entity player ) player.SetPersistentVar( "titanClassLockState[" + enumName + "]", TITAN_CLASS_LOCK_STATE_LOCKED ) } } + + + + +void function FD_DropshipSpawnDropship() +{ + file.playersInShip = 0 + file.dropshipState = eDropshipState.InProgress + file.dropship = CreateDropship( TEAM_MILITIA, FD_spawnPosition , FD_spawnAngles ) + + + file.dropship.SetModel( $"models/vehicle/crow_dropship/crow_dropship_hero.mdl" ) + file.dropship.SetValueForModelKey( $"models/vehicle/crow_dropship/crow_dropship_hero.mdl" ) + + DispatchSpawn( file.dropship ) + file.dropship.SetModel( $"models/vehicle/crow_dropship/crow_dropship_hero.mdl" ) + + thread PlayAnim(file.dropship, FD_DropshipGetAnimation()) + + array<string> anims = GetRandomDropshipDropoffAnims() + + //thread WarpinEffect( $"models/vehicle/crow_dropship/crow_dropship.mdl", anims[0], file.dropship.GetOrigin(),f ile.dropship.GetAngles() ) //this does not work + file.dropship.WaitSignal( "deploy" ) + file.dropshipState = eDropshipState.Returning + foreach(int i,entity player in file.playersInDropship) + { + thread FD_DropshipDropPlayer( player, i ) + } + file.playersInDropship.clear() + + wait 8 + file.dropshipState = eDropshipState.Idle +} + +void function FD_DropshipDropPlayer(entity player,int playerDropshipIndex) +{ + player.EndSignal( "OnDestroy" ) + FirstPersonSequenceStruct jumpSequence + jumpSequence.firstPersonAnim = DROPSHIP_EXIT_ANIMS_POV[ playerDropshipIndex ] + jumpSequence.thirdPersonAnim = DROPSHIP_EXIT_ANIMS[ playerDropshipIndex ] + jumpSequence.attachment = "ORIGIN" + jumpSequence.blendTime = 0.0 + jumpSequence.viewConeFunction = ViewConeFree + + thread FirstPersonSequence( jumpSequence, player, file.dropship ) + WaittillAnimDone( player ) + player.ClearParent() + ClearPlayerAnimViewEntity( player ) + player.ClearInvulnerable() +} + +void function FD_DropshipSetAnimationOverride(string animation) +{ + file.animationOverride = animation +} + +string function FD_DropshipGetAnimation() +{ + if(file.animationOverride!="") + return file.animationOverride + + switch( GetMapName() ) + { + case "mp_homestead": + return "dropship_coop_respawn_homestead" + case "mp_lagoon": + return "dropship_coop_respawn_lagoon" + case "mp_overlook": + return "dropship_coop_respawn_overlook" + case "mp_outpost": + return "dropship_coop_respawn_outpost" + case "mp_wargames": + return "dropship_coop_respawn_wargames" + case "mp_digsite": + return "dropship_coop_respawn_digsite" + } + return "dropship_coop_respawn" +}
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai_fd.nut index e7a04294..65278f6d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_forwardbase_kodai_fd.nut @@ -4,6 +4,8 @@ global function initFrontierDefenseData void function initFrontierDefenseData() { shopPosition = < -3862.13, 1267.69, 1060.06 > + FD_spawnPosition = < -838.6, 2629.63, 1592 > + FD_spawnAngles = < 0, 180, 0 > int index = 1 diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead_fd.nut index cd7d7895..dce818cb 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead_fd.nut @@ -3,6 +3,8 @@ void function initFrontierDefenseData() { shopPosition = < -800.156, -4250, -63 > shopAngles = < 9, 60, 0 > + FD_spawnPosition = < 576.47, -3946.24, -174.07> + FD_spawnAngles = < 0, 60, 0 > int index = 1 array<WaveEvent> wave1 diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut index c3fe53db..fb0452db 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut @@ -3,8 +3,10 @@ global function initFrontierDefenseData void function initFrontierDefenseData() { - shopPosition = < -5165.42, -679.285, 384.031> //only aproximate position + shopPosition = < -5165.42, -679.285, 384.031 > //only aproximate position + FD_spawnPosition = < -5325.66, -1363.046, 384.031 > + FD_spawnAngles = < 0, 0, 0 > int index = 1 array<WaveEvent> wave1 |