From c4a807ce87c9be6f6a453d1e8deb4876630531bf Mon Sep 17 00:00:00 2001 From: RoyalBlue1 Date: Mon, 30 May 2022 05:01:33 +0200 Subject: Split FD into multiple files -added dummy wave creation function for all "vanilla" FD maps -reworked event handling to support multiple event threads -tracking more variables for end medals -added debugging function to stationary firing positions --- .../mod/scripts/vscripts/ai/_ai_mortar_titans.gnut | 8 +- .../ai/_ai_stationary_firing_positions.gnut | 38 +- .../scripts/vscripts/gamemodes/_gamemode_fd.nut | 845 +++------------------ .../vscripts/gamemodes/_gamemode_fd_events.nut | 736 ++++++++++++++++++ .../vscripts/gamemodes/_gamemode_fd_nav.nut | 97 +++ .../scripts/vscripts/mp/levels/mp_angel_city.nut | 6 + .../vscripts/mp/levels/mp_angel_city_fd.nut | 24 +- .../vscripts/mp/levels/mp_black_water_canal.nut | 5 + .../vscripts/mp/levels/mp_black_water_canal_fd.nut | 24 +- .../mod/scripts/vscripts/mp/levels/mp_colony02.nut | 6 + .../scripts/vscripts/mp/levels/mp_colony02_fd.nut | 24 +- .../mod/scripts/vscripts/mp/levels/mp_drydock.nut | 7 +- .../scripts/vscripts/mp/levels/mp_drydock_fd.nut | 24 +- .../vscripts/mp/levels/mp_forwardbase_kodai_fd.nut | 119 +-- .../mod/scripts/vscripts/mp/levels/mp_glitch.nut | 7 +- .../scripts/vscripts/mp/levels/mp_glitch_fd.nut | 24 +- .../mod/scripts/vscripts/mp/levels/mp_grave.nut | 5 + .../mod/scripts/vscripts/mp/levels/mp_grave_fd.nut | 24 +- .../scripts/vscripts/mp/levels/mp_homestead.nut | 7 +- .../scripts/vscripts/mp/levels/mp_homestead_fd.nut | 24 +- .../mod/scripts/vscripts/mp/levels/mp_relic02.nut | 7 +- .../scripts/vscripts/mp/levels/mp_relic02_fd.nut | 24 +- .../mod/scripts/vscripts/mp/levels/mp_thaw.nut | 7 +- .../mod/scripts/vscripts/mp/levels/mp_thaw_fd.nut | 24 +- .../mod/scripts/vscripts/mp/levels/mp_wargames.nut | 5 + .../scripts/vscripts/mp/levels/mp_wargames_fd.nut | 24 +- 26 files changed, 1327 insertions(+), 818 deletions(-) create mode 100644 Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut create mode 100644 Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut (limited to 'Northstar.CustomServers/mod') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_titans.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_titans.gnut index 08598808..fe46aac5 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_titans.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_titans.gnut @@ -100,14 +100,14 @@ void function MortarMissileThink( entity missile, entity weaponOwner ) { float frac = min( 1, pow( ( Time() - startTime ) / estTravelTime, 2.0 ) ) - if ( frac > 1.0 ) - break + if ( frac > 1.0 ) + break float homingSpeed = GraphCapped( frac, 0, 1, homingSpeedMin, homingSpeedMax ) - missile.SetHomingSpeeds( homingSpeed, 0 ) + missile.SetHomingSpeeds( homingSpeed, 0 ) - wait 0.25 + wait 0.25 } missile.ClearMissileTargetPosition() diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut index 50b6cc75..2e7c938e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_stationary_firing_positions.gnut @@ -5,6 +5,7 @@ global function GetRandomStationaryPosition global function GetClosestAvailableStationaryPosition global function ClaimStationaryAIPosition global function ReleaseStationaryAIPosition +global function DebugDrawStationaryAiPositions global enum eStationaryAIPositionTypes { @@ -258,4 +259,39 @@ int function DistanceCompareClosestForStationaryAIPosition( ArrayDistanceEntryFo return -1 return 0; -} \ No newline at end of file +} + + +void function DebugDrawStationaryAiPositions(int typeMask){ + thread DebugDrawStationaryAiPositions_thread(typeMask) +} + + +void function DebugDrawStationaryAiPositions_thread(int typeMask) +{ while(true) + { + for(int i = 0;i<4;i++){ + if((1< > waveEvents global table > routes - +global array routeNodes +global array spawnedNPCs @@ -81,12 +36,10 @@ global table > routes struct { array aiSpawnpoints array smokePoints - array routeNodes array harvesterDamageSource bool havesterWasDamaged bool harvesterShieldDown float harvesterDamageTaken - array spawnedNPCs table players entity harvester_info }file @@ -105,26 +58,28 @@ void function GamemodeFD_Init() PlayerEarnMeter_SetEnabled(false) SetShouldUsePickLoadoutScreen( true ) - + //general Callbacks AddCallback_EntitiesDidLoad(LoadEntities) AddCallback_GameStateEnter(eGameState.Prematch,FD_createHarvester) AddCallback_GameStateEnter( eGameState.Playing,startMainGameLoop) - AddCallback_OnClientConnected(GamemodeFD_InitPlayer) - AddCallback_OnPlayerKilled(GamemodeFD_OnPlayerKilled) AddCallback_OnRoundEndCleanup(FD_NPCCleanup) - AddDamageByCallback("player",FD_DamageByPlayerCallback) + AddCallback_OnClientConnected(GamemodeFD_InitPlayer) + //Damage Callbacks + AddDamageByCallback("player",FD_DamageByPlayerCallback) AddDamageCallback( "player", DamageScaleByDifficulty ) AddDamageCallback( "npc_titan", DamageScaleByDifficulty ) AddDamageCallback( "npc_turret_sentry", DamageScaleByDifficulty ) + //Spawn Callbacks AddSpawnCallback( "npc_titan", HealthScaleByDifficulty ) AddSpawnCallback( "npc_super_spectre", HealthScaleByDifficulty ) - - - AddCallback_OnNPCKilled(OnNpcDeath) + AddSpawnCallback( "player", FD_PlayerRespawnCallback ) AddSpawnCallback("npc_turret_sentry", AddTurretSentry ) - SetUsedCoreCallback(FD_UsedCoreCallback) - + //death Callbacks + AddCallback_OnNPCKilled(OnNpcDeath) + AddCallback_OnPlayerKilled(GamemodeFD_OnPlayerKilled) + + //Command Callbacks AddClientCommandCallback("FD_ToggleReady",ClientCommandCallbackToggleReady) AddClientCommandCallback("FD_UseHarvesterShieldBoost",useShieldBoost) @@ -138,6 +93,11 @@ void function FD_BoostPurchaseCallback(entity player,BoostStoreData data) file.players[player].moneySpend += data.cost } +void function FD_PlayerRespawnCallback(entity player) +{ + if(player in file.players) + file.players[player].lastRespawn = Time() +} void function FD_TeamReserveDepositOrWithdrawCallback(entity player, string action,int amount) { @@ -153,6 +113,7 @@ void function FD_TeamReserveDepositOrWithdrawCallback(entity player, string acti } void function GamemodeFD_OnPlayerKilled(entity victim, entity attacker, var damageInfo) { + file.players[victim].longestLife = Time() - file.players[victim].lastRespawn file.players[victim].diedThisRound = true array militiaplayers = GetPlayerArrayOfTeam( TEAM_MILITIA ) int deaths = 0 @@ -193,12 +154,18 @@ void function GamemodeFD_InitPlayer(entity player) } void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) -{ - int findIndex = file.spawnedNPCs.find( victim ) +{ + if(victim.IsTitan()&&attacker in file.players) + file.players[attacker].titanKills++ + int victimTypeID = FD_GetAITypeID_ByString(victim.GetTargetName()) + if(victimTypeID == eFD_AITypeIDs.TITAN_MORTAR||victimTypeID == eFD_AITypeIDs.SPECTRE_MORTAR) + if(attacker in file.players) + file.players[attacker].mortarUnitsKilled++ + int findIndex = spawnedNPCs.find( victim ) if ( findIndex != -1 ) { - file.spawnedNPCs.remove( findIndex ) - switch(FD_GetAITypeID_ByString(victim.GetTargetName())) //FD_GetAINetIndex_byAITypeID does not support all titan ids + spawnedNPCs.remove( findIndex ) + switch(victimTypeID) //FD_GetAINetIndex_byAITypeID does not support all titan ids { case(eFD_AITypeIDs.TITAN): case(eFD_AITypeIDs.RONIN): @@ -212,7 +179,7 @@ void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) SetGlobalNetInt("FD_AICount_Titan",GetGlobalNetInt("FD_AICount_Titan")-1) break default: - string netIndex = FD_GetAINetIndex_byAITypeID(FD_GetAITypeID_ByString(victim.GetTargetName())) + string netIndex = GetAiNetIdFromTargetName(victim.GetTargetName()) if(netIndex != "") SetGlobalNetInt(netIndex,GetGlobalNetInt(netIndex)-1) } @@ -252,7 +219,7 @@ void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) AddMoneyToPlayer( attacker , money ) attacker.AddToPlayerGameStat( PGS_ASSAULT_SCORE, playerScore ) // seems to be how combat score is counted - + file.players[attacker].scoreThisRound += playerScore table alreadyAssisted foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory ) { @@ -315,33 +282,7 @@ void function mainGameLoop() } -array function getRoute(string routeName) -{ - array ret - array currentNode = [] - foreach(entity node in file.routeNodes) - { - if(!node.HasKey("route_name")) - continue - if(node.kv.route_name==routeName) - { - currentNode = [node] - break - } - } - if(currentNode.len()==0) - { - printt("Route not found") - return [] - } - while(currentNode.len()!=0) - { - ret.append(currentNode[0]) - currentNode = currentNode[0].GetLinkEntArray() - } - return ret -} array function getHighestEnemyAmountsForWave(int waveIndex) { @@ -537,18 +478,7 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) //main wave loop thread SetWaveStateReady() - foreach(WaveEvent event in waveEvents[waveIndex]) - { - - if(event.shouldThread) - thread event.eventFunction(event.smokeEvent,event.spawnEvent,event.waitEvent,event.soundEvent) - else - event.eventFunction(event.smokeEvent,event.spawnEvent,event.waitEvent,event.soundEvent) - if(!IsAlive(fd_harvester.harvester)) - break - - } - waitUntilLessThanAmountAlive_expensive(0) + executeWave() SetGlobalNetInt("FD_waveState",WAVE_STATE_COMPLETE) if(!IsAlive(fd_harvester.harvester)) { @@ -591,7 +521,7 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) else SetRoundBased(false) SetWinner(TEAM_IMC)//restart round - file.spawnedNPCs = [] // reset npcs count + spawnedNPCs = [] // reset npcs count return false } @@ -611,7 +541,7 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) AddPlayerScore(player,"FDTeamWave") } wait 1 - float highestScore = 0; + int highestScore = 0; entity highestScore_player = GetPlayerArray()[0] foreach(entity player in GetPlayerArray()) { @@ -631,6 +561,10 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) foreach(entity player in GetPlayerArray()) if(!file.havesterWasDamaged) AddPlayerScore(player,"FDTeamFlawlessWave") + + + + SetRoundBased(false) SetWinner(TEAM_MILITIA) PlayFactionDialogueToTeam( "fd_matchVictory", TEAM_MILITIA ) @@ -675,7 +609,7 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) EmitSoundOnEntityOnlyToPlayer(player,player,"HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P") } wait 1 - float highestScore = 0; + int highestScore = 0; entity highestScore_player = GetPlayerArray()[0] foreach(entity player in GetPlayerArray()) { @@ -730,6 +664,11 @@ void function SetWaveStateReady(){ SetGlobalNetInt("FD_waveState",WAVE_STATE_IN_PROGRESS) } +void function gameWonMedals(){ + table medals + //most mvps +} + void function OnHarvesterDamaged(entity harvester, var damageInfo) { @@ -971,7 +910,7 @@ void function FD_DamageByPlayerCallback(entity victim,var damageInfo) return float damage = DamageInfo_GetDamage(damageInfo) file.players[player].damageDealt += damage - file.players[player].scoreThisRound += damage //TODO NOT HOW SCORE WORKS + file.players[player].scoreThisRound += damage.tointeger() //TODO NOT HOW SCORE WORKS if(victim.IsTitan()) { //TODO Money and score for titan damage @@ -1133,7 +1072,7 @@ void function LoadEntities() AddStationaryAIPosition(info_target.GetOrigin(),int(info_target.kv.aiType)) break case"info_fd_route_node": - file.routeNodes.append(info_target) + routeNodes.append(info_target) break case"info_fd_smoke_screen": file.smokePoints.append(info_target) @@ -1146,67 +1085,7 @@ void function LoadEntities() initNetVars() } -void function singleNav_thread(entity npc, string routeName,int nodesToScip= 0,float nextDistance = 500.0) -{ - npc.EndSignal( "OnDeath" ) - npc.EndSignal( "OnDestroy" ) - - - - if(!npc.IsNPC()) - return - - - array routeArray = getRoute(routeName) - WaitFrame()//so other code setting up what happens on signals is run before this - if(routeArray.len()==0) - { - - npc.Signal("OnFailedToPath") - return - } - int scippedNodes = 0 - foreach(entity node in routeArray) - { - if(!IsAlive(fd_harvester.harvester)) - return - if(scippedNodes < nodesToScip) - { - scippedNodes++ - continue - } - npc.AssaultPoint(node.GetOrigin()) - npc.AssaultSetGoalRadius( 100 ) - int i = 0 - table result = npc.WaitSignal("OnFinishedAssault","OnFailedToPath") - if(result.signal == "OnFailedToPath") - break - } - npc.Signal("FD_ReachedHarvester") -} - -void function SquadNav_Thread( array npcs ,string routeName,int nodesToScip = 0,float nextDistance = 200.0) -{ - //TODO this function wont stop when noone alive anymore also it only works half of the time - - array routeArray = getRoute(routeName) - WaitFrame()//so other code setting up what happens on signals is run before this - if(routeArray.len()==0) - return - - int nodeIndex = 0 - foreach(entity node in routeArray) - { - if(!IsAlive(fd_harvester.harvester)) - return - if(nodeIndex++ < nodesToScip) - continue - - SquadAssaultOrigin(npcs,node.GetOrigin(),nextDistance) - - } -} bool function allPlayersReady() { @@ -1326,576 +1205,64 @@ string function GetTargetNameForID(int typeId) unreachable } -/****************************************************************************************************************\ -####### # # ####### # # ####### ##### ####### # # ####### ###### # ####### ####### ###### -# # # # ## # # # # # ## # # # # # # # # # # # -# # # # # # # # # # # # # # # # # # # # # # # -##### # # ##### # # # # # #### ##### # # # ##### ###### # # # # # ###### -# # # # # # # # # # # # # # # # # ####### # # # # # -# # # # # ## # # # # # ## # # # # # # # # # # -####### # ####### # # # ##### ####### # # ####### # # # # # ####### # # -\*****************************************************************************************************************/ - -WaveEvent function createSmokeEvent(vector position,float lifetime) -{ - WaveEvent event - event.eventFunction = spawnSmoke - event.shouldThread = true - event.smokeEvent.position = position - event.smokeEvent.lifetime = lifetime - return event -} - -WaveEvent function createArcTitanEvent(vector origin,vector angles,string route) -{ - WaveEvent event - event.eventFunction = spawnArcTitan - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_ARC - event.spawnEvent.spawnAmount = 1 - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - event.spawnEvent.route = route - return event -} - -WaveEvent function createSuperSpectreEvent(vector origin,vector angles,string route) -{ - WaveEvent event - event.eventFunction = spawnSuperSpectre - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.REAPER - event.spawnEvent.spawnAmount = 1 - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - event.spawnEvent.route = route - return event -} - -WaveEvent function createDroppodGruntEvent(vector origin,string route) -{ - WaveEvent event - event.eventFunction = spawnDroppodGrunts - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.GRUNT - event.spawnEvent.spawnAmount = 4 - event.spawnEvent.origin = origin - event.spawnEvent.route = route - return event -} - -WaveEvent function createDroppodStalkerEvent(vector origin,string route) -{ - WaveEvent event - event.eventFunction = spawnDroppodStalker - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.STALKER - event.spawnEvent.spawnAmount = 4 - event.spawnEvent.origin = origin - event.spawnEvent.route = route - return event -} - -WaveEvent function createDroppodSpectreMortarEvent(vector origin,string route) -{ - WaveEvent event - event.eventFunction = spawnDroppodSpectreMortar - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.SPECTRE_MORTAR - event.spawnEvent.spawnAmount = 4 - event.spawnEvent.origin = origin - event.spawnEvent.route = route - return event -} - -WaveEvent function createWaitForTimeEvent(float amount) -{ - WaveEvent event - event.shouldThread = false - event.eventFunction = waitForTime - event.waitEvent.amount = amount - return event -} - -WaveEvent function createWaitUntilAliveEvent(int amount) -{ - WaveEvent event - event.eventFunction = waitUntilLessThanAmountAliveEvent - event.shouldThread = false - event.waitEvent.amount = amount.tofloat() - return event -} - -WaveEvent function createGenericSpawnEvent(string npcClassName,vector origin,vector angles,string route,int spawnType,int spawnAmount) -{ - WaveEvent event - event.eventFunction = spawnGenericNPC - event.shouldThread = true - event.spawnEvent.npcClassName = npcClassName - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - event.spawnEvent.route = route - event.spawnEvent.spawnType = spawnType - event.spawnEvent.spawnAmount = spawnAmount - return event -} - -WaveEvent function createGenericTitanSpawnWithAiSettingsEvent(string npcClassName,string aiSettings,vector origin,vector angles,string route,int spawnType,int spawnAmount) -{ - WaveEvent event - event.eventFunction = spawnGenericNPCTitanwithSettings - event.shouldThread = true - event.spawnEvent.npcClassName = npcClassName - event.spawnEvent.aiSettings = aiSettings - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - event.spawnEvent.route = route - event.spawnEvent.spawnType = spawnType - event.spawnEvent.spawnAmount = spawnAmount - return event -} - -WaveEvent function createNukeTitanEvent(vector origin,vector angles,string route) -{ - WaveEvent event - event.eventFunction = spawnNukeTitan - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_NUKE - event.spawnEvent.spawnAmount = 1 - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - event.spawnEvent.route = route - return event -} - -WaveEvent function createMortarTitanEvent(vector origin,vector angles) -{ - WaveEvent event - event.eventFunction = spawnMortarTitan - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_MORTAR - event.spawnEvent.spawnAmount = 1 - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - return event -} - -WaveEvent function createCloakDroneEvent(vector origin,vector angles){ - WaveEvent event - event.eventFunction = fd_spawnCloakDrone - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.DRONE_CLOAK - event.spawnEvent.spawnAmount = 1 - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - return event -} - -WaveEvent function CreateTickEvent( vector origin, vector angles, int amount = 4, string route = "" ) -{ - WaveEvent event - event.eventFunction = SpawnTick - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.TICK - event.spawnEvent.spawnAmount = amount - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - return event -} - -WaveEvent function CreateNorthstarSniperTitanEvent(vector origin,vector angles) -{ - WaveEvent event - event.eventFunction = spawnSniperTitan - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_SNIPER - event.spawnEvent.spawnAmount = 1 - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - return event -} - -WaveEvent function CreateToneSniperTitanEvent(vector origin,vector angles) -{ - WaveEvent event - event.eventFunction = SpawnToneSniperTitan - event.shouldThread = true - event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_SNIPER - event.spawnEvent.spawnAmount = 1 - event.spawnEvent.origin = origin - event.spawnEvent.angles = angles - return event -} - -/************************************************************************************************************\ -####### # # ####### # # ####### ####### # # # # ##### ####### ### ####### # # ##### -# # # # ## # # # # # ## # # # # # # # ## # # # -# # # # # # # # # # # # # # # # # # # # # # # -##### # # ##### # # # # ##### # # # # # # # # # # # # # ##### -# # # # # # # # # # # # # # # # # # # # # # # -# # # # # ## # # # # # ## # # # # # # # ## # # -####### # ####### # # # # ##### # # ##### # ### ####### # # ##### -\************************************************************************************************************/ - -void function spawnSmoke(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - printt("smoke") - SmokescreenStruct smokescreen - smokescreen.smokescreenFX = $"P_smokescreen_FD" - smokescreen.isElectric = false - smokescreen.origin = smokeEvent.position + < 0 , 0, 150> - smokescreen.angles = <0,0,0> - smokescreen.lifetime = smokeEvent.lifetime - smokescreen.fxXYRadius = 150 - smokescreen.fxZRadius = 120 - smokescreen.fxOffsets = [ <120.0, 0.0, 0.0>,<0.0, 120.0, 0.0>, <0.0, 0.0, 0.0>,<0.0, -120.0, 0.0>,< -120.0, 0.0, 0.0>, <0.0, 100.0, 0.0>] - Smokescreen(smokescreen) - -} - -void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateArcTitan(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) - npc.DisableNPCFlag(NPC_ALLOW_INVESTIGATE | NPC_USE_SHOOTING_COVER|NPC_ALLOW_PATROL) - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - SetSpawnOption_AISettings(npc,"npc_titan_stryder_leadwall_arc") - file.spawnedNPCs.append(npc) - DispatchSpawn(npc) - AddMinimapForTitans(npc) - npc.WaitSignal( "TitanHotDropComplete" ) - npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc,spawnEvent.route) - thread EMPTitanThinkConstant(npc) -} - -void function waitForTime(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - float waitUntil = Time() + waitEvent.amount - while(Time() ) - SetTeam( pod, TEAM_IMC ) - InitFireteamDropPod( pod ) - waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) - - string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) - array guys - bool adychecked = false - - for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) - { - entity guy = CreateSoldier( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - - SetTeam( guy, TEAM_IMC ) - guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) - guy.DisableNPCFlag( NPC_ALLOW_PATROL) - DispatchSpawn( guy ) - - guy.SetParent( pod, "ATTACH", true ) - SetSquad( guy, squadName ) - - SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.GRUNT)) - AddMinimapForHumans(guy) - file.spawnedNPCs.append(guy) - guys.append( guy ) - } - - ActivateFireteamDropPod( pod, guys ) - SquadNav_Thread(guys,spawnEvent.route) -} - -void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) - SetTeam( pod, TEAM_IMC ) - InitFireteamDropPod( pod ) - waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) - - string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) - array guys - - for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) - { - entity guy = CreateStalker( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - - SetTeam( guy, TEAM_IMC ) - guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) - guy.DisableNPCFlag( NPC_ALLOW_PATROL) - DispatchSpawn( guy ) - - SetSquad( guy, squadName ) - AddMinimapForHumans(guy) - SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.STALKER)) - guys.append( guy ) - } - - ActivateFireteamDropPod( pod, guys ) - SquadNav_Thread(guys,spawnEvent.route) - -} - -void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) - SetTeam( pod, TEAM_IMC ) - InitFireteamDropPod( pod ) - waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) - - string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) - array guys - - for ( int i = 0; i < 4; i++ ) - { - entity guy = CreateSpectre( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - - SetTeam( guy, TEAM_IMC ) - DispatchSpawn( guy ) - - SetSquad( guy, squadName ) - SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.SPECTRE_MORTAR)) - AddMinimapForHumans(guy) - guys.append( guy ) - } - - ActivateFireteamDropPod( pod, guys ) -} - -void function spawnGenericNPC(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPC( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) - DispatchSpawn(npc) -} - -void function spawnGenericNPCTitanwithSettings(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) - if( spawnEvent.aiSettings == "npc_titan_atlas_tracker_fd_sniper" ) - SetTargetName( npc, "npc_titan_atlas_tracker" ) // required for client to create icons - SetSpawnOption_AISettings( npc, spawnEvent.aiSettings) - SetSpawnOption_Titanfall(npc) - DispatchSpawn(npc) - file.spawnedNPCs.append(npc) - AddMinimapForTitans(npc) - npc.WaitSignal( "TitanHotDropComplete" ) - npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) -} - -void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_ogre_minigun_nuke") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - npc.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS) - DispatchSpawn(npc) - file.spawnedNPCs.append(npc) - AddMinimapForTitans(npc) - npc.WaitSignal( "TitanHotDropComplete" ) - npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread singleNav_thread(npc,spawnEvent.route) - thread NukeTitanThink(npc,fd_harvester.harvester) - -} - -void function spawnMortarTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_atlas_tracker_mortar") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - DispatchSpawn(npc) - file.spawnedNPCs.append(npc) - AddMinimapForTitans(npc) - npc.WaitSignal( "TitanHotDropComplete" ) - npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread MortarTitanThink(npc,fd_harvester.harvester) -} - -void function spawnSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_stryder",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_stryder_sniper_fd") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - DispatchSpawn(npc) - file.spawnedNPCs.append(npc) - AddMinimapForTitans(npc) - npc.WaitSignal( "TitanHotDropComplete" ) - npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread SniperTitanThink(npc,fd_harvester.harvester) - -} - -void function SpawnToneSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) - SetSpawnOption_AISettings(npc,"npc_titan_atlas_tracker_fd_sniper") - SetSpawnOption_Titanfall(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons - DispatchSpawn( npc ) - file.spawnedNPCs.append(npc) - AddMinimapForTitans(npc) - npc.WaitSignal( "TitanHotDropComplete" ) - npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread SniperTitanThink(npc,fd_harvester.harvester) - -} - -void function fd_spawnCloakDrone(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - entity npc = SpawnCloakDrone( TEAM_IMC, spawnEvent.origin, spawnEvent.angles, file.harvester_info.GetOrigin() ) - file.spawnedNPCs.append(npc) - SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) - AddMinimapForHumans(npc) -} - -void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) -{ - PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) - entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) - SetTeam( pod, TEAM_IMC ) - InitFireteamDropPod( pod ) - waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) - - string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) - array guys - - for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) - { - entity guy = CreateFragDrone( TEAM_IMC, spawnEvent.origin, <0,0,0> ) - - SetSpawnOption_AISettings(guy, "npc_frag_drone_fd") - SetTeam( guy, TEAM_IMC ) - guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE ) - guy.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS | NPCMF_PREFER_SPRINT) - DispatchSpawn( guy ) - AddMinimapForHumans(guy) - SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.TICK)) - SetSquad( guy, squadName ) - - guys.append( guy ) - } - - ActivateFireteamDropPod( pod, guys ) - SquadNav_Thread(guys,spawnEvent.route) -} - -/****************************************************************************************\ -####### # # ####### # # ####### # # ####### # ###### ####### ###### -# # # # ## # # # # # # # # # # # -# # # # # # # # # # # # # # # # # -##### # # ##### # # # # ####### ##### # ###### ##### ###### -# # # # # # # # # # # # # # # # -# # # # # ## # # # # # # # # # -####### # ####### # # # # # ####### ####### # ####### # # -\****************************************************************************************/ - - -void function PingMinimap(float x, float y, float duration, float spreadRadius, float ringRadius, int colorIndex) -{ - foreach(entity player in GetPlayerArray()) - { - Remote_CallFunction_NonReplay(player, "ServerCallback_FD_PingMinimap", x, y, duration, spreadRadius, ringRadius, colorIndex) - } -} - -void function waitUntilLessThanAmountAlive(int amount) -{ - - int aliveTitans = file.spawnedNPCs.len() - while(aliveTitans>amount) - { - WaitFrame() - aliveTitans = file.spawnedNPCs.len() - if(!IsAlive(fd_harvester.harvester)) - break - } -} - -void function waitUntilLessThanAmountAlive_expensive(int amount) -{ - - array npcs = GetNPCArray() - int deduct = 0 - foreach (entity npc in npcs) - if (IsValid(GetPetTitanOwner( npc ))) - deduct++ - int aliveTitans = npcs.len() - deduct - while(aliveTitans>amount) - { - WaitFrame() - npcs = GetNPCArray() - deduct = 0 - foreach(entity npc in npcs) - if (IsValid(GetPetTitanOwner( npc ))) - deduct++ - aliveTitans = GetNPCArray().len() - deduct - if(!IsAlive(fd_harvester.harvester)) - break - } -} - -void function AddMinimapForTitans(entity titan) -{ - titan.Minimap_SetAlignUpright( true ) - titan.Minimap_AlwaysShow( TEAM_IMC, null ) - titan.Minimap_AlwaysShow( TEAM_MILITIA, null ) - titan.Minimap_SetHeightTracking( true ) - titan.Minimap_SetCustomState( eMinimapObject_npc_titan.AT_BOUNTY_BOSS ) -} - -// including drones -void function AddMinimapForHumans(entity human) -{ - human.Minimap_SetAlignUpright( true ) - human.Minimap_AlwaysShow( TEAM_IMC, null ) - human.Minimap_AlwaysShow( TEAM_MILITIA, null ) - human.Minimap_SetHeightTracking( true ) - human.Minimap_SetCustomState( eMinimapObject_npc.AI_TDM_AI ) -} void function AddTurretSentry(entity turret) { diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut new file mode 100644 index 00000000..5a8996ec --- /dev/null +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut @@ -0,0 +1,736 @@ +global function createSmokeEvent +global function createArcTitanEvent +global function createWaitForTimeEvent +global function createSuperSpectreEvent +global function createDroppodGruntEvent +global function createNukeTitanEvent +global function createMortarTitanEvent +global function createGenericSpawnEvent +global function createGenericTitanSpawnWithAiSettingsEvent +global function createDroppodStalkerEvent +global function createDroppodSpectreMortarEvent +global function createWaitUntilAliveEvent +global function createCloakDroneEvent +global function CreateTickEvent +global function CreateToneSniperTitanEvent +global function CreateNorthstarSniperTitanEvent +global function executeWave + + +global struct SmokeEvent{ + vector position + float lifetime +} + +global struct SpawnEvent{ + vector origin + vector angles + string route //defines route taken by the ai + int skippedRouteNodes //defines how many route nodes will be skipped + int spawnType //Just used for Wave Info but can be used for spawn too should contain aid of spawned enemys + int spawnAmount //Just used for Wave Info but can be used for spawn too should contain amound of spawned enemys + string npcClassName + string aiSettings +} + +global struct WaitEvent{ + float amount +} + +global struct SoundEvent{ + string soundEventName +} + +global struct WaveEvent{ + void functionref(SmokeEvent,SpawnEvent,WaitEvent,SoundEvent) eventFunction + bool shouldThread + int executeOnThisCall //will actually be executed when called this many times + int timesExecuted + int nextEventIndex + SmokeEvent smokeEvent + SpawnEvent spawnEvent + WaitEvent waitEvent + SoundEvent soundEvent +} + + + + +global array > waveEvents + + + +void function executeWave() +{ + print("executeWave Start") + thread runEvents(0) + while(IsAlive(fd_harvester.harvester)&&(!allEventsExecuted(GetGlobalNetInt("FD_currentWave")))) + WaitFrame() + waitUntilLessThanAmountAlive(0) + waitUntilLessThanAmountAlive_expensive(0) +} + +bool function allEventsExecuted(int waveIndex) +{ + foreach(WaveEvent e in waveEvents[waveIndex]) + { + if(e.executeOnThisCall>e.timesExecuted) + return false + } + return true +} + +void function runEvents(int firstExecuteIndex) +{ + print("runEvents Start") + WaveEvent currentEvent = waveEvents[GetGlobalNetInt("FD_currentWave")][firstExecuteIndex] + + while(true) + { + currentEvent.timesExecuted++ + if(currentEvent.timesExecuted!=currentEvent.executeOnThisCall) + { + print("not on this call") + return + } + if(!IsAlive(fd_harvester.harvester)) + { + print("harvesterDead") + return + } + if(currentEvent.shouldThread) + { + print("execute with thread") + thread currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.waitEvent,currentEvent.soundEvent) + } + else + { + print("execute without thread") + currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.waitEvent,currentEvent.soundEvent) + } + if(currentEvent.nextEventIndex==0) + { + print("zero index") + return + } + currentEvent = waveEvents[GetGlobalNetInt("FD_currentWave")][currentEvent.nextEventIndex] + } + print("runEvents End") +} + + + + + + + + + + +/****************************************************************************************************************\ +####### # # ####### # # ####### ##### ####### # # ####### ###### # ####### ####### ###### +# # # # ## # # # # # ## # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # +##### # # ##### # # # # # #### ##### # # # ##### ###### # # # # # ###### +# # # # # # # # # # # # # # # # # ####### # # # # # +# # # # # ## # # # # # ## # # # # # # # # # # +####### # ####### # # # ##### ####### # # ####### # # # # # ####### # # +\*****************************************************************************************************************/ + +WaveEvent function createSmokeEvent(vector position,float lifetime,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnSmoke + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.smokeEvent.position = position + event.smokeEvent.lifetime = lifetime + return event +} + +WaveEvent function createArcTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnArcTitan + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_ARC + event.spawnEvent.spawnAmount = 1 + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + event.spawnEvent.route = route + return event +} + +WaveEvent function createSuperSpectreEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnSuperSpectre + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.REAPER + event.spawnEvent.spawnAmount = 1 + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + event.spawnEvent.route = route + return event +} + +WaveEvent function createDroppodGruntEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnDroppodGrunts + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.GRUNT + event.spawnEvent.spawnAmount = 4 + event.spawnEvent.origin = origin + event.spawnEvent.route = route + return event +} + +WaveEvent function createDroppodStalkerEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnDroppodStalker + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.STALKER + event.spawnEvent.spawnAmount = 4 + event.spawnEvent.origin = origin + event.spawnEvent.route = route + return event +} + +WaveEvent function createDroppodSpectreMortarEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnDroppodSpectreMortar + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.SPECTRE_MORTAR + event.spawnEvent.spawnAmount = 4 + event.spawnEvent.origin = origin + event.spawnEvent.route = route + return event +} + +WaveEvent function createWaitForTimeEvent(float amount,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.shouldThread = false + event.eventFunction = waitForTime + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.waitEvent.amount = amount + return event +} + +WaveEvent function createWaitUntilAliveEvent(int amount,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = waitUntilLessThanAmountAliveEvent + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = false + event.waitEvent.amount = amount.tofloat() + return event +} + +WaveEvent function createGenericSpawnEvent(string npcClassName,vector origin,vector angles,string route,int spawnType,int spawnAmount,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnGenericNPC + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.npcClassName = npcClassName + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + event.spawnEvent.route = route + event.spawnEvent.spawnType = spawnType + event.spawnEvent.spawnAmount = spawnAmount + return event +} + +WaveEvent function createGenericTitanSpawnWithAiSettingsEvent(string npcClassName,string aiSettings,vector origin,vector angles,string route,int spawnType,int spawnAmount,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnGenericNPCTitanwithSettings + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.npcClassName = npcClassName + event.spawnEvent.aiSettings = aiSettings + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + event.spawnEvent.route = route + event.spawnEvent.spawnType = spawnType + event.spawnEvent.spawnAmount = spawnAmount + return event +} + +WaveEvent function createNukeTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnNukeTitan + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_NUKE + event.spawnEvent.spawnAmount = 1 + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + event.spawnEvent.route = route + return event +} + +WaveEvent function createMortarTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnMortarTitan + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_MORTAR + event.spawnEvent.spawnAmount = 1 + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + return event +} + +WaveEvent function createCloakDroneEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = fd_spawnCloakDrone + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.DRONE_CLOAK + event.spawnEvent.spawnAmount = 1 + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + return event +} + +WaveEvent function CreateTickEvent( vector origin, vector angles, int amount, string route,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = SpawnTick + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.TICK + event.spawnEvent.spawnAmount = amount + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + return event +} + +WaveEvent function CreateNorthstarSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = spawnSniperTitan + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_SNIPER + event.spawnEvent.spawnAmount = 1 + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + return event +} + +WaveEvent function CreateToneSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = SpawnToneSniperTitan + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event.shouldThread = true + event.spawnEvent.spawnType= eFD_AITypeIDs.TITAN_SNIPER + event.spawnEvent.spawnAmount = 1 + event.spawnEvent.origin = origin + event.spawnEvent.angles = angles + return event +} + +/************************************************************************************************************\ +####### # # ####### # # ####### ####### # # # # ##### ####### ### ####### # # ##### +# # # # ## # # # # # ## # # # # # # # ## # # # +# # # # # # # # # # # # # # # # # # # # # # # +##### # # ##### # # # # ##### # # # # # # # # # # # # # ##### +# # # # # # # # # # # # # # # # # # # # # # # +# # # # # ## # # # # # ## # # # # # # # ## # # +####### # ####### # # # # ##### # # ##### # ### ####### # # ##### +\************************************************************************************************************/ + +void function spawnSmoke(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + printt("smoke") + SmokescreenStruct smokescreen + smokescreen.smokescreenFX = $"P_smokescreen_FD" + smokescreen.isElectric = false + smokescreen.origin = smokeEvent.position + < 0 , 0, 150> + smokescreen.angles = <0,0,0> + smokescreen.lifetime = smokeEvent.lifetime + smokescreen.fxXYRadius = 150 + smokescreen.fxZRadius = 120 + smokescreen.fxOffsets = [ <120.0, 0.0, 0.0>,<0.0, 120.0, 0.0>, <0.0, 0.0, 0.0>,<0.0, -120.0, 0.0>,< -120.0, 0.0, 0.0>, <0.0, 100.0, 0.0>] + + +} + +void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity npc = CreateArcTitan(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) + npc.DisableNPCFlag(NPC_ALLOW_INVESTIGATE | NPC_USE_SHOOTING_COVER|NPC_ALLOW_PATROL) + SetSpawnOption_Titanfall(npc) + SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + SetSpawnOption_AISettings(npc,"npc_titan_stryder_leadwall_arc") + spawnedNPCs.append(npc) + DispatchSpawn(npc) + AddMinimapForTitans(npc) + npc.WaitSignal( "TitanHotDropComplete" ) + npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) + npc.AssaultSetFightRadius(0) + thread singleNav_thread(npc,spawnEvent.route) + thread EMPTitanThinkConstant(npc) + +} + +void function waitForTime(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + float waitUntil = Time() + waitEvent.amount + while(Time() ) + SetTeam( pod, TEAM_IMC ) + InitFireteamDropPod( pod ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) + + string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) + array guys + bool adychecked = false + + for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) + { + entity guy = CreateSoldier( TEAM_IMC, spawnEvent.origin,<0,0,0> ) + + SetTeam( guy, TEAM_IMC ) + guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) + guy.DisableNPCFlag( NPC_ALLOW_PATROL) + DispatchSpawn( guy ) + + guy.SetParent( pod, "ATTACH", true ) + SetSquad( guy, squadName ) + + SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.GRUNT)) + AddMinimapForHumans(guy) + spawnedNPCs.append(guy) + guys.append( guy ) + } + + ActivateFireteamDropPod( pod, guys ) + thread SquadNav_Thread(guys,spawnEvent.route) +} + +void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) + SetTeam( pod, TEAM_IMC ) + InitFireteamDropPod( pod ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) + + string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) + array guys + + for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) + { + entity guy = CreateStalker( TEAM_IMC, spawnEvent.origin,<0,0,0> ) + + SetTeam( guy, TEAM_IMC ) + guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) + guy.DisableNPCFlag( NPC_ALLOW_PATROL) + DispatchSpawn( guy ) + + SetSquad( guy, squadName ) + AddMinimapForHumans(guy) + SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.STALKER)) + guys.append( guy ) + } + + ActivateFireteamDropPod( pod, guys ) + thread SquadNav_Thread(guys,spawnEvent.route) + +} + +void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) + SetTeam( pod, TEAM_IMC ) + InitFireteamDropPod( pod ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) + + string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) + array guys + + for ( int i = 0; i < 4; i++ ) + { + entity guy = CreateSpectre( TEAM_IMC, spawnEvent.origin,<0,0,0> ) + + SetTeam( guy, TEAM_IMC ) + DispatchSpawn( guy ) + + SetSquad( guy, squadName ) + SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.SPECTRE_MORTAR)) + AddMinimapForHumans(guy) + guys.append( guy ) + } + + ActivateFireteamDropPod( pod, guys ) +} + +void function spawnGenericNPC(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity npc = CreateNPC( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + DispatchSpawn(npc) +} + +void function spawnGenericNPCTitanwithSettings(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity npc = CreateNPCTitan( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + if( spawnEvent.aiSettings == "npc_titan_atlas_tracker_fd_sniper" ) + SetTargetName( npc, "npc_titan_atlas_tracker" ) // required for client to create icons + SetSpawnOption_AISettings( npc, spawnEvent.aiSettings) + SetSpawnOption_Titanfall(npc) + DispatchSpawn(npc) + spawnedNPCs.append(npc) + AddMinimapForTitans(npc) + npc.WaitSignal( "TitanHotDropComplete" ) + npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) +} + +void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings(npc,"npc_titan_ogre_minigun_nuke") + SetSpawnOption_Titanfall(npc) + SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + npc.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS) + npc.AssaultSetFightRadius(0) + DispatchSpawn(npc) + spawnedNPCs.append(npc) + AddMinimapForTitans(npc) + npc.WaitSignal( "TitanHotDropComplete" ) + npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) + thread singleNav_thread(npc,spawnEvent.route) + thread NukeTitanThink(npc,fd_harvester.harvester) + +} + +void function spawnMortarTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings(npc,"npc_titan_atlas_tracker_mortar") + SetSpawnOption_Titanfall(npc) + SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + DispatchSpawn(npc) + spawnedNPCs.append(npc) + AddMinimapForTitans(npc) + npc.WaitSignal( "TitanHotDropComplete" ) + npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) + thread MortarTitanThink(npc,fd_harvester.harvester) +} + +void function spawnSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity npc = CreateNPCTitan("titan_stryder",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings(npc,"npc_titan_stryder_sniper_fd") + SetSpawnOption_Titanfall(npc) + SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + DispatchSpawn(npc) + spawnedNPCs.append(npc) + AddMinimapForTitans(npc) + npc.WaitSignal( "TitanHotDropComplete" ) + npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) + thread SniperTitanThink(npc,fd_harvester.harvester) + +} + +void function SpawnToneSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) + SetSpawnOption_AISettings(npc,"npc_titan_atlas_tracker_fd_sniper") + SetSpawnOption_Titanfall(npc) + SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons + DispatchSpawn( npc ) + npc.AssaultSetFightRadius(0) + spawnedNPCs.append(npc) + AddMinimapForTitans(npc) + npc.WaitSignal( "TitanHotDropComplete" ) + npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) + thread SniperTitanThink(npc,fd_harvester.harvester) +} + +void function fd_spawnCloakDrone(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + entity npc = SpawnCloakDrone( TEAM_IMC, spawnEvent.origin, spawnEvent.angles, fd_harvester.harvester.GetOrigin() ) + spawnedNPCs.append(npc) + SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) + AddMinimapForHumans(npc) +} + +void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) + SetTeam( pod, TEAM_IMC ) + InitFireteamDropPod( pod ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", spawnEvent.origin, <0,0,0> ) + + string squadName = MakeSquadName( TEAM_IMC, UniqueString( "ZiplineTable" ) ) + array guys + + for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) + { + entity guy = CreateFragDrone( TEAM_IMC, spawnEvent.origin, <0,0,0> ) + + SetSpawnOption_AISettings(guy, "npc_frag_drone_fd") + SetTeam( guy, TEAM_IMC ) + guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE ) + guy.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS | NPCMF_PREFER_SPRINT) + DispatchSpawn( guy ) + AddMinimapForHumans(guy) + SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.TICK)) + SetSquad( guy, squadName ) + + guys.append( guy ) + } + + ActivateFireteamDropPod( pod, guys ) + thread SquadNav_Thread(guys,spawnEvent.route) +} + + + +/****************************************************************************************\ +####### # # ####### # # ####### # # ####### # ###### ####### ###### +# # # # ## # # # # # # # # # # # +# # # # # # # # # # # # # # # # # +##### # # ##### # # # # ####### ##### # ###### ##### ###### +# # # # # # # # # # # # # # # # +# # # # # ## # # # # # # # # # +####### # ####### # # # # # ####### ####### # ####### # # +\****************************************************************************************/ + + +void function PingMinimap(float x, float y, float duration, float spreadRadius, float ringRadius, int colorIndex) +{ + foreach(entity player in GetPlayerArray()) + { + Remote_CallFunction_NonReplay(player, "ServerCallback_FD_PingMinimap", x, y, duration, spreadRadius, ringRadius, colorIndex) + } +} + +void function waitUntilLessThanAmountAlive(int amount) +{ + + int aliveTitans = spawnedNPCs.len() + while(aliveTitans>amount) + { + WaitFrame() + aliveTitans = spawnedNPCs.len() + if(!IsAlive(fd_harvester.harvester)) + return + } +} + +void function waitUntilLessThanAmountAlive_expensive(int amount) +{ + + array npcs = GetNPCArray() + int deduct = 0 + foreach (entity npc in npcs) + if (IsValid(GetPetTitanOwner( npc ))) + deduct++ + int aliveTitans = npcs.len() - deduct + while(aliveTitans>amount) + { + WaitFrame() + npcs = GetNPCArray() + deduct = 0 + foreach(entity npc in npcs) + if (IsValid(GetPetTitanOwner( npc ))) + deduct++ + aliveTitans = GetNPCArray().len() - deduct + if(!IsAlive(fd_harvester.harvester)) + return + } +} + +void function AddMinimapForTitans(entity titan) +{ + titan.Minimap_SetAlignUpright( true ) + titan.Minimap_AlwaysShow( TEAM_IMC, null ) + titan.Minimap_AlwaysShow( TEAM_MILITIA, null ) + titan.Minimap_SetHeightTracking( true ) + titan.Minimap_SetCustomState( eMinimapObject_npc_titan.AT_BOUNTY_BOSS ) +} + +// including drones +void function AddMinimapForHumans(entity human) +{ + human.Minimap_SetAlignUpright( true ) + human.Minimap_AlwaysShow( TEAM_IMC, null ) + human.Minimap_AlwaysShow( TEAM_MILITIA, null ) + human.Minimap_SetHeightTracking( true ) + human.Minimap_SetCustomState( eMinimapObject_npc.AI_TDM_AI ) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut new file mode 100644 index 00000000..1ca2bc16 --- /dev/null +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_nav.nut @@ -0,0 +1,97 @@ +global function singleNav_thread +global function SquadNav_Thread +global function getRoute + + + +void function singleNav_thread(entity npc, string routeName,int nodesToScip= 0,float nextDistance = 500.0) +{ + npc.EndSignal( "OnDeath" ) + npc.EndSignal( "OnDestroy" ) + + + + if(!npc.IsNPC()){ + return + } + + + + array routeArray = getRoute(routeName) + WaitFrame()//so other code setting up what happens on signals is run before this + if(routeArray.len()==0) + { + + npc.Signal("OnFailedToPath") + return + } + int scippedNodes = 0 + foreach(entity node in routeArray) + { + if(!IsAlive(fd_harvester.harvester)) + return + if(scippedNodes < nodesToScip) + { + scippedNodes++ + continue + } + npc.AssaultPoint(node.GetOrigin()) + npc.AssaultSetGoalRadius( 50 ) + int i = 0 + table result = npc.WaitSignal("OnFinishedAssault","OnFailedToPath") + if(result.signal == "OnFailedToPath") + break + } + npc.Signal("FD_ReachedHarvester") +} + +void function SquadNav_Thread( array npcs ,string routeName,int nodesToScip = 0,float nextDistance = 200.0) +{ + //TODO this function wont stop when noone alive anymore also it only works half of the time + + array routeArray = getRoute(routeName) + WaitFrame()//so other code setting up what happens on signals is run before this + if(routeArray.len()==0) + return + + int nodeIndex = 0 + foreach(entity node in routeArray) + { + if(!IsAlive(fd_harvester.harvester)) + return + if(nodeIndex++ < nodesToScip) + continue + + SquadAssaultOrigin(npcs,node.GetOrigin(),nextDistance) + + } + +} + +array function getRoute(string routeName) +{ + array ret + array currentNode = [] + foreach(entity node in routeNodes) + { + if(!node.HasKey("route_name")) + continue + if(node.kv.route_name==routeName) + { + currentNode = [node] + break + } + + } + if(currentNode.len()==0) + { + printt("Route not found") + return [] + } + while(currentNode.len()!=0) + { + ret.append(currentNode[0]) + currentNode = currentNode[0].GetLinkEntArray() + } + return ret +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut index 8b2a4060..4ff36dbf 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut @@ -25,6 +25,12 @@ void function CodeCallback_MapInit() // there are some really busted titan startspawns that are on the fucking other side of the map from where they should be, so we remove them AddSpawnCallback( "info_spawnpoint_titan_start", TrimBadTitanStartSpawns ) AddSpawnCallback( "sky_camera", FixSkycamFog ) + + + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() + } void function FixBatterySpawns( entity spawn ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut index 2e35417f..0c12ad18 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal.nut @@ -4,6 +4,11 @@ void function CodeCallback_MapInit() { // there are some really busted titan startspawns that are on the fucking other side of the map from where they should be, so we remove them AddSpawnCallback( "info_spawnpoint_titan_start", TrimBadTitanStartSpawns ) + + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() + } void function TrimBadTitanStartSpawns( entity spawn ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_black_water_canal_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut index 40cf942e..83338c8e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut @@ -11,4 +11,10 @@ void function CodeCallback_MapInit() AddEvacNode( CreateScriptRef( < -1035.991211, -671.114380, 824.180908 >, < 16.220453, -24.511070, 0 > ) ) SetEvacSpaceNode( GetEnt( "intro_spacenode" ) ) + + + + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() } \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut index 37b89169..5c6a18ed 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock.nut @@ -1 +1,6 @@ -//fuck \ No newline at end of file +void function CodeCallback_MapInit() +{ + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_drydock_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ 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 19f7c0e6..b8c0740d 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 @@ -12,68 +12,69 @@ void function initFrontierDefenseData() array wave4 //wave0.append(createSuperSpectreEvent(< -64, 964, 1456>, <0,0,0 >, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 865, 694, 1380>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 885, 1722, 1377>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1226, 1391, 1355>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1258, 922, 1331>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1117, 330, 1372>, "hillRouteClose")) - - wave0.append(createSmokeEvent(< -12, 1720, 1456>,30)) - wave0.append(createSmokeEvent(< -64, 964, 1456>,30)) - - wave0.append(createWaitForTimeEvent(7)) - wave0.append(createWaitUntilAliveEvent(1)) - - wave0.append(createDroppodGruntEvent( < 1309, 2122, 1324>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 985, -110, 1369>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 264, 2840, 968>, "hillRouteClose")) - wave0.append(createDroppodStalkerEvent( < 2193, 434, 955>, "hillRouteClose")) - wave0.append(createDroppodStalkerEvent( < 909, 3094, 968>, "hillRouteClose")) - - wave0.append(createWaitForTimeEvent(7)) - wave0.append(createWaitUntilAliveEvent(1)) - - wave0.append(createDroppodGruntEvent( < 865, 694, 1380>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 885, 1722, 1377>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1226, 1391, 1355>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1258, 922, 1331>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1117, 330, 1372>, "hillRouteClose")) - - wave0.append(createWaitForTimeEvent(7)) - wave0.append(createWaitUntilAliveEvent(1)) - - wave0.append(createDroppodGruntEvent( < 1309, 2122, 1324>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 985, -110, 1369>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 264, 2840, 968>, "hillRouteClose")) - wave0.append(createDroppodStalkerEvent( < 2193, 434, 955>, "hillRouteClose")) - wave0.append(createDroppodStalkerEvent( < 909, 3094, 968>, "hillRouteClose")) - - wave0.append(createWaitForTimeEvent(7)) - wave0.append(createWaitUntilAliveEvent(1)) - - wave0.append(createDroppodGruntEvent( < 865, 694, 1380>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 885, 1722, 1377>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1226, 1391, 1355>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1258, 922, 1331>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 1117, 330, 1372>, "hillRouteClose")) - - wave0.append(createWaitForTimeEvent(7)) - wave0.append(createWaitUntilAliveEvent(1)) - - wave0.append(createDroppodGruntEvent( < 1309, 2122, 1324>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 985, -110, 1369>, "hillRouteClose")) - wave0.append(createDroppodGruntEvent( < 264, 2840, 968>, "hillRouteClose")) - wave0.append(CreateToneSniperTitanEvent( < 1373, 1219, 1314>, <0,0,0>)) + + wave0.append(createDroppodGruntEvent( < 865, 694, 1380>, "hillRouteClose",1)) + wave0.append(createDroppodGruntEvent( < 885, 1722, 1377>, "hillRouteClose",2)) + wave0.append(createDroppodGruntEvent( < 1226, 1391, 1355>, "hillRouteClose",3)) + wave0.append(createDroppodGruntEvent( < 1258, 922, 1331>, "hillRouteClose",4)) + wave0.append(createDroppodGruntEvent( < 1117, 330, 1372>, "hillRouteClose",5)) + + wave0.append(createSmokeEvent(< -12, 1720, 1456>,30,6)) + wave0.append(createSmokeEvent(< -64, 964, 1456>,30,7)) + + wave0.append(createWaitForTimeEvent(7,8)) + wave0.append(createWaitUntilAliveEvent(1,9)) + + wave0.append(createDroppodGruntEvent( < 1309, 2122, 1324>, "hillRouteClose",10)) + wave0.append(createDroppodGruntEvent( < 985, -110, 1369>, "hillRouteClose",11)) + wave0.append(createDroppodGruntEvent( < 264, 2840, 968>, "hillRouteClose",12)) + wave0.append(createDroppodStalkerEvent( < 2193, 434, 955>, "hillRouteClose",13)) + wave0.append(createDroppodStalkerEvent( < 909, 3094, 968>, "hillRouteClose",14)) + + wave0.append(createWaitForTimeEvent(7,15)) + wave0.append(createWaitUntilAliveEvent(1,16)) + + wave0.append(createDroppodGruntEvent( < 865, 694, 1380>, "hillRouteClose",17)) + wave0.append(createDroppodGruntEvent( < 885, 1722, 1377>, "hillRouteClose",18)) + wave0.append(createDroppodGruntEvent( < 1226, 1391, 1355>, "hillRouteClose",19)) + wave0.append(createDroppodGruntEvent( < 1258, 922, 1331>, "hillRouteClose",20)) + wave0.append(createDroppodGruntEvent( < 1117, 330, 1372>, "hillRouteClose",21)) + + wave0.append(createWaitForTimeEvent(7,22)) + wave0.append(createWaitUntilAliveEvent(1,23)) + + wave0.append(createDroppodGruntEvent( < 1309, 2122, 1324>, "hillRouteClose",24)) + wave0.append(createDroppodGruntEvent( < 985, -110, 1369>, "hillRouteClose",25)) + wave0.append(createDroppodGruntEvent( < 264, 2840, 968>, "hillRouteClose",26)) + wave0.append(createDroppodStalkerEvent( < 2193, 434, 955>, "hillRouteClose",27)) + wave0.append(createDroppodStalkerEvent( < 909, 3094, 968>, "hillRouteClose",28)) + + wave0.append(createWaitForTimeEvent(7,29)) + wave0.append(createWaitUntilAliveEvent(1,30)) + + wave0.append(createDroppodGruntEvent( < 865, 694, 1380>, "hillRouteClose",31)) + wave0.append(createDroppodGruntEvent( < 885, 1722, 1377>, "hillRouteClose",32)) + wave0.append(createDroppodGruntEvent( < 1226, 1391, 1355>, "hillRouteClose",33)) + wave0.append(createDroppodGruntEvent( < 1258, 922, 1331>, "hillRouteClose",34)) + wave0.append(createDroppodGruntEvent( < 1117, 330, 1372>, "hillRouteClose",35)) + + wave0.append(createWaitForTimeEvent(7,36)) + wave0.append(createWaitUntilAliveEvent(1,37)) + + //wave0.append(createDroppodGruntEvent( < 1309, 2122, 1324>, "hillRouteClose")) + //wave0.append(createDroppodGruntEvent( < 985, -110, 1369>, "hillRouteClose")) + //wave0.append(createDroppodGruntEvent( < 264, 2840, 968>, "hillRouteClose")) + wave0.append(CreateToneSniperTitanEvent( < 1373, 1219, 1314>, <0,0,0>,0)) // wave0.append(CreateTickEvent( < -64, 964, 1458>, <0,0,0>, 4, "hillRouteClose" )) - wave0.append(createWaitForTimeEvent(10)) + // wave0.append(CreateTickEvent( < -64, 964, 1458>, <0,0,0>, 56, "hillRouteClose" )) //wave0.append(createMortarTitanEvent(< 1632, 4720, 944>,<0,0,0>)) - wave0.append(createWaitUntilAliveEvent(0)) - wave1.append(createArcTitanEvent(< -12, 1720, 1456>,<0,0,0>, "hillRouteClose")) - wave1.append(createNukeTitanEvent( < -64, 964, 1456>,<0,0,0>, "hillRouteClose")) - wave1.append(createCloakDroneEvent(< 1632, 4720, 1200>,<0,0,0>)) - wave1.append(createWaitUntilAliveEvent(0)) + + //wave1.append(createArcTitanEvent(< -12, 1720, 1456>,<0,0,0>, "hillRouteClose")) + //wave1.append(createNukeTitanEvent( < -64, 964, 1456>,<0,0,0>, "hillRouteClose")) + //wave1.append(createCloakDroneEvent(< 1632, 4720, 1200>,<0,0,0>)) + //wave1.append(createWaitUntilAliveEvent(0)) // wave0.append(createArcTitanEvent(< -12, 1720, 1456>,<0,0,0>,"hillRouteClose")) //wave0.append(createArcTitanEvent(< -12, 1720, 1456>,<0,0,0>,"hillRouteClose")) @@ -82,7 +83,7 @@ void function initFrontierDefenseData() waveEvents.append(wave0) //waveEvents.append(wave0) - waveEvents.append(wave1) + //waveEvents.append(wave1) //waveEvents.append(wave2) //waveEvents.append(wave3) //waveEvents.append(wave4) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut index 37b89169..5c6a18ed 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch.nut @@ -1 +1,6 @@ -//fuck \ No newline at end of file +void function CodeCallback_MapInit() +{ + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_glitch_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut index f4b48f6d..73059b9e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave.nut @@ -4,6 +4,11 @@ void function CodeCallback_MapInit() { // there are some really busted titan startspawns that are on the fucking other side of the map from where they should be, so we remove them AddSpawnCallback( "info_spawnpoint_titan_start", TrimBadTitanStartSpawns ) + + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() + } void function TrimBadTitanStartSpawns( entity spawn ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_grave_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut index 37b89169..5c6a18ed 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_homestead.nut @@ -1 +1,6 @@ -//fuck \ No newline at end of file +void function CodeCallback_MapInit() +{ + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() +} \ No newline at end of file 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 37b89169..dcdd2c9a 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 @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut index 37b89169..5c6a18ed 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02.nut @@ -1 +1,6 @@ -//fuck \ No newline at end of file +void function CodeCallback_MapInit() +{ + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_relic02_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut index 37b89169..5c6a18ed 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw.nut @@ -1 +1,6 @@ -//fuck \ No newline at end of file +void function CodeCallback_MapInit() +{ + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() +} \ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_thaw_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file 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 5af01346..c1290bb0 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut @@ -29,6 +29,11 @@ void function CodeCallback_MapInit() // currently disabled until finished: intro if ( !IsFFAGame() ) ClassicMP_SetLevelIntro( WargamesIntroSetup, 20.0 ) + + // Load Frontier Defense Data + if(GameRules_GetGameMode()=="fd") + initFrontierDefenseData() +} } void function AddEvacNodes() diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames_fd.nut index 37b89169..dcdd2c9a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames_fd.nut @@ -1 +1,23 @@ -//fuck \ No newline at end of file +global function initFrontiereDefenseData +void function initFrontierDefenseData() +{ + shopPosition = <0,0,0> + + + array wave0 + array wave1 + array wave2 + array wave3 + array wave4 + + + + + + + waveEvents.append(wave0) + waveEvents.append(wave1) + waveEvents.append(wave2) + waveEvents.append(wave3) + waveEvents.append(wave4) +} \ No newline at end of file -- cgit v1.2.3