diff options
author | x3Karma <juliuslimck@gmail.com> | 2022-05-11 20:22:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-11 14:22:08 +0200 |
commit | 9d77289574cf8e410ec66264c1d7bd542fa5d6d7 (patch) | |
tree | 17a5f8cf9f322fb28b7b94373421e72dc65c5eac /Northstar.CustomServers | |
parent | 0c6ff1343083731618d48ff3f1f32e09f35243c3 (diff) | |
download | NorthstarMods-9d77289574cf8e410ec66264c1d7bd542fa5d6d7.tar.gz NorthstarMods-9d77289574cf8e410ec66264c1d7bd542fa5d6d7.zip |
Update _gamemode_fd.nut (#353)
- prevent final wave scoring by setting victory condition first
- added CreateTickEvent, SpawnTick, CreateTrackedDroppodTick functions
- fixed Arc Titans not spawning correctly
- fixed Nuke Titans not moving
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 76 |
1 files changed, 66 insertions, 10 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index fac1de81..58f497a6 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -14,6 +14,7 @@ global function createDroppodStalkerEvent global function createDroppodSpectreMortarEvent global function createWaitUntilAliveEvent global function createCloakDroneEvent +global function CreateTickEvent global struct SmokeEvent{ vector position @@ -415,6 +416,15 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) wait 2 //wave end + + if ( isFinalWave() && IsAlive( fd_harvester.harvester ) ) + { + //Game won code + SetRoundBased(false) + SetWinner(TEAM_MILITIA) + return true + } + SetGlobalNetBool("FD_waveActive",false) MessageToTeam(TEAM_MILITIA,eEventNotifications.FD_AnnounceWaveEnd) if(waveIndex<waveEvents.len()) @@ -466,13 +476,6 @@ bool function runWave(int waveIndex,bool shouldDoBuyTime) EmitSoundOnEntityOnlyToPlayer(player,player,"HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P") } } - if ( isFinalWave() && IsAlive( fd_harvester.harvester ) ) - { - //Game won code - SetRoundBased(false) - SetWinner(TEAM_MILITIA) - return true - } wait 10 return true @@ -964,6 +967,18 @@ WaveEvent function createCloakDroneEvent(vector origin,vector 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 +} + /************************************************************************************************************\ ####### # # ####### # # ####### ####### # # # # ##### ####### ### ####### # # ##### # # # # ## # # # # # ## # # # # # # # ## # # # @@ -994,10 +1009,11 @@ void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEven { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateArcTitan(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) - file.spawnedNPCs.append(npc) - DispatchSpawn(npc) npc.DisableNPCFlag(NPC_ALLOW_INVESTIGATE | NPC_USE_SHOOTING_COVER|NPC_ALLOW_PATROL) SetSpawnOption_Titanfall(npc) + SetSpawnOption_AISettings(npc,"npc_titan_stryder_leadwall_arc") + file.spawnedNPCs.append(npc) + DispatchSpawn(npc) thread titanNav_thread(npc,spawnEvent.route) thread EMPTitanThinkConstant(npc) } @@ -1068,11 +1084,11 @@ void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEve 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") - thread titanNav_thread(npc,spawnEvent.route) SetSpawnOption_Titanfall(npc) npc.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS) DispatchSpawn(npc) file.spawnedNPCs.append(npc) + thread titanNav_thread(npc,spawnEvent.route) thread NukeTitanThink(npc,fd_harvester.harvester) } @@ -1106,6 +1122,16 @@ void function fd_spawnCloakDrone(SmokeEvent smokeEffect,SpawnEvent spawnEvent,Wa file.spawnedNPCs.append(npc) } +void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +{ + PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) + for (int i = 0; i < floor(spawnEvent.spawnAmount / 4); i++) + { + thread CreateTrackedDroppodTick(spawnEvent.origin, TEAM_IMC, spawnEvent.route) + wait 0.5 + } +} + /****************************************************************************************\ ####### # # ####### # # ####### # # ####### # ###### ####### ###### # # # # ## # # # # # # # # # # # @@ -1204,6 +1230,36 @@ void function CreateTrackedDroppodStalker( vector origin, int team) ActivateFireteamDropPod( pod, guys ) } +void function CreateTrackedDroppodTick( vector origin, int team, string route = "" ) +{ + entity pod = CreateDropPod( origin, <0,0,0> ) + SetTeam( pod, team ) + InitFireteamDropPod( pod ) + waitthread LaunchAnimDropPod( pod, "pod_testpath", origin, <0,0,0> ) + + string squadName = MakeSquadName( team, UniqueString( "ZiplineTable" ) ) + array<entity> guys + + for ( int i = 0; i < 4; i++ ) + { + entity guy = CreateFragDrone( team, origin, <0,0,0> ) + + SetSpawnOption_AISettings(guy, "npc_frag_drone_fd") + SetTeam( guy, team ) + guy.EnableNPCFlag( NPC_ALLOW_PATROL | NPC_ALLOW_INVESTIGATE ) + guy.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS) + DispatchSpawn( guy ) + + SetSquad( guy, squadName ) + + if (route != "") + thread titanNav_thread(guy, route) // not working i think + guys.append( guy ) + } + + ActivateFireteamDropPod( pod, guys ) +} + void function PingMinimap(float x, float y, float duration, float spreadRadius, float ringRadius, int colorIndex) { foreach(entity player in GetPlayerArray()) |