diff options
author | RoyalBlue1 <malte.hoermeyer@web.de> | 2022-05-31 20:05:20 +0200 |
---|---|---|
committer | RoyalBlue1 <malte.hoermeyer@web.de> | 2022-05-31 20:05:20 +0200 |
commit | db3129c542e073f2a81fbe231dc9b2c2b103194c (patch) | |
tree | ba1dc53425d655057f12e5026a06be0da4dea781 /Northstar.CustomServers | |
parent | e2a94756be58fd353320608f743816dbd5fd5c06 (diff) | |
download | NorthstarMods-db3129c542e073f2a81fbe231dc9b2c2b103194c.tar.gz NorthstarMods-db3129c542e073f2a81fbe231dc9b2c2b103194c.zip |
New wait events and split event
also fixed other events
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 29 | ||||
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut | 264 |
2 files changed, 196 insertions, 97 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index 9348f021..e92f9b7f 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -166,29 +166,11 @@ void function OnNpcDeath( entity victim, entity attacker, var damageInfo ) if ( findIndex != -1 ) { spawnedNPCs.remove( findIndex ) - switch(victimTypeID) //FD_GetAINetIndex_byAITypeID does not support all titan ids - { - case(eFD_AITypeIDs.TITAN): - case(eFD_AITypeIDs.RONIN): - case(eFD_AITypeIDs.NORTHSTAR): - case(eFD_AITypeIDs.SCORCH): - case(eFD_AITypeIDs.TONE): - case(eFD_AITypeIDs.ION): - case(eFD_AITypeIDs.MONARCH): - case(eFD_AITypeIDs.LEGION): - case(eFD_AITypeIDs.TITAN_SNIPER): - SetGlobalNetInt("FD_AICount_Titan",GetGlobalNetInt("FD_AICount_Titan")-1) - break - default: - string netIndex = GetAiNetIdFromTargetName(victim.GetTargetName()) - if(netIndex != "") - SetGlobalNetInt(netIndex,GetGlobalNetInt(netIndex)-1) - else - { - if (victim.GetTargetName() == "Cloak Drone") // special case for cloak drone, someone in respawn fucked up here - SetGlobalNetInt( "FD_AICount_Drone_Cloak", GetGlobalNetInt("FD_AICount_Drone_Cloak")-1) - } - } + + string netIndex = GetAiNetIdFromTargetName(victim.GetTargetName()) + if(netIndex != "") + SetGlobalNetInt(netIndex,GetGlobalNetInt(netIndex)-1) + SetGlobalNetInt("FD_AICount_Current",GetGlobalNetInt("FD_AICount_Current")-1) } @@ -1269,6 +1251,7 @@ string function GetAiNetIdFromTargetName(string targetName) case "drone": return "FD_AICount_Drone" case "cloakedDrone": + case "Cloaked Drone": return "FD_AICount_Drone_Cloak" case "tick": return "FD_AICount_Ticks" diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut index 4c44dac7..751134a6 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut @@ -38,10 +38,15 @@ global struct SpawnEvent{ int spawnAmount //Just used for Wave Info but can be used for spawn too should contain amound of spawned enemys string npcClassName string aiSettings + string entityGlobalKey } -global struct WaitEvent{ - float amount +global struct FlowControlEvent{ + float waitTime + int splitNextEventIndex + int waitAmount + int waitEntityType + array<string> waitGlobalDataKey } global struct SoundEvent{ @@ -49,20 +54,21 @@ global struct SoundEvent{ } global struct WaveEvent{ - void functionref(SmokeEvent,SpawnEvent,WaitEvent,SoundEvent) eventFunction + void functionref(SmokeEvent,SpawnEvent,FlowControlEvent,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 + FlowControlEvent flowControlEvent SoundEvent soundEvent + } - +global table<string,entity> GlobalEventEntitys global array<array<WaveEvent> > waveEvents @@ -108,12 +114,12 @@ void function runEvents(int firstExecuteIndex) if(currentEvent.shouldThread) { print("execute with thread") - thread currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.waitEvent,currentEvent.soundEvent) + thread currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.flowControlEvent,currentEvent.soundEvent) } else { print("execute without thread") - currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.waitEvent,currentEvent.soundEvent) + currentEvent.eventFunction(currentEvent.smokeEvent,currentEvent.spawnEvent,currentEvent.flowControlEvent,currentEvent.soundEvent) } if(currentEvent.nextEventIndex==0) { @@ -156,7 +162,7 @@ WaveEvent function createSmokeEvent(vector position,float lifetime,int nextEvent return event } -WaveEvent function createArcTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createArcTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnArcTitan @@ -168,10 +174,11 @@ WaveEvent function createArcTitanEvent(vector origin,vector angles,string route, event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createSuperSpectreEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createSuperSpectreEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnSuperSpectre @@ -183,10 +190,11 @@ WaveEvent function createSuperSpectreEvent(vector origin,vector angles,string ro event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createSuperSpectreEventWithMinion(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createSuperSpectreEventWithMinion(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnSuperSpectreWithMinion @@ -198,10 +206,11 @@ WaveEvent function createSuperSpectreEventWithMinion(vector origin,vector angles event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createDroppodGruntEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createDroppodGruntEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnDroppodGrunts @@ -212,10 +221,11 @@ WaveEvent function createDroppodGruntEvent(vector origin,string route,int nextEv event.spawnEvent.spawnAmount = 4 event.spawnEvent.origin = origin event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createDroppodStalkerEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createDroppodStalkerEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnDroppodStalker @@ -226,10 +236,11 @@ WaveEvent function createDroppodStalkerEvent(vector origin,string route,int next event.spawnEvent.spawnAmount = 4 event.spawnEvent.origin = origin event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createDroppodSpectreMortarEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createDroppodSpectreMortarEvent(vector origin,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnDroppodSpectreMortar @@ -240,17 +251,18 @@ WaveEvent function createDroppodSpectreMortarEvent(vector origin,string route,in event.spawnEvent.spawnAmount = 4 event.spawnEvent.origin = origin event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createWaitForTimeEvent(float amount,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createWaitForTimeEvent(float waitTime,int nextEventIndex,int executeOnThisCall = 1) { WaveEvent event event.shouldThread = false event.eventFunction = waitForTime event.executeOnThisCall = executeOnThisCall event.nextEventIndex = nextEventIndex - event.waitEvent.amount = amount + event.flowControlEvent.waitTime = waitTime return event } @@ -261,11 +273,11 @@ WaveEvent function createWaitUntilAliveEvent(int amount,int nextEventIndex,int e event.executeOnThisCall = executeOnThisCall event.nextEventIndex = nextEventIndex event.shouldThread = false - event.waitEvent.amount = amount.tofloat() + event.flowControlEvent.waitAmount = amount return event } -WaveEvent function createGenericSpawnEvent(string npcClassName,vector origin,vector angles,string route,int spawnType,int spawnAmount,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createGenericSpawnEvent(string npcClassName,vector origin,vector angles,string route,int spawnType,int spawnAmount,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnGenericNPC @@ -278,10 +290,11 @@ WaveEvent function createGenericSpawnEvent(string npcClassName,vector origin,vec event.spawnEvent.route = route event.spawnEvent.spawnType = spawnType event.spawnEvent.spawnAmount = spawnAmount + event.spawnEvent.entityGlobalKey = entityGlobalKey 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 function createGenericTitanSpawnWithAiSettingsEvent(string npcClassName,string aiSettings,vector origin,vector angles,string route,int spawnType,int spawnAmount,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnGenericNPCTitanwithSettings @@ -295,10 +308,11 @@ WaveEvent function createGenericTitanSpawnWithAiSettingsEvent(string npcClassNam event.spawnEvent.route = route event.spawnEvent.spawnType = spawnType event.spawnEvent.spawnAmount = spawnAmount + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createNukeTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createNukeTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnNukeTitan @@ -310,10 +324,11 @@ WaveEvent function createNukeTitanEvent(vector origin,vector angles,string route event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createMortarTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createMortarTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnMortarTitan @@ -324,10 +339,11 @@ WaveEvent function createMortarTitanEvent(vector origin,vector angles,int nextEv event.spawnEvent.spawnAmount = 1 event.spawnEvent.origin = origin event.spawnEvent.angles = angles + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function createCloakDroneEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function createCloakDroneEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = fd_spawnCloakDrone @@ -338,10 +354,11 @@ WaveEvent function createCloakDroneEvent(vector origin,vector angles,int nextEve event.spawnEvent.spawnAmount = 1 event.spawnEvent.origin = origin event.spawnEvent.angles = angles + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateTickEvent( vector origin, vector angles, int amount, string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateTickEvent( vector origin, vector angles, int amount, string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnTick @@ -352,10 +369,11 @@ WaveEvent function CreateTickEvent( vector origin, vector angles, int amount, st event.spawnEvent.spawnAmount = amount event.spawnEvent.origin = origin event.spawnEvent.angles = angles + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateNorthstarSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateNorthstarSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = spawnSniperTitan @@ -366,10 +384,11 @@ WaveEvent function CreateNorthstarSniperTitanEvent(vector origin,vector angles,i event.spawnEvent.spawnAmount = 1 event.spawnEvent.origin = origin event.spawnEvent.angles = angles + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateToneSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateToneSniperTitanEvent(vector origin,vector angles,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnToneSniperTitan @@ -380,11 +399,12 @@ WaveEvent function CreateToneSniperTitanEvent(vector origin,vector angles,int ne event.spawnEvent.spawnAmount = 1 event.spawnEvent.origin = origin event.spawnEvent.angles = angles + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateIonTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateIonTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnIonTitan @@ -396,10 +416,11 @@ WaveEvent function CreateIonTitanEvent(vector origin,vector angles,string route, event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateScorchTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateScorchTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnScorchTitan @@ -411,10 +432,11 @@ WaveEvent function CreateScorchTitanEvent(vector origin,vector angles,string rou event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateRoninTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateRoninTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnRoninTitan @@ -426,10 +448,11 @@ WaveEvent function CreateRoninTitanEvent(vector origin,vector angles,string rout event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateToneTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateToneTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnToneTitan @@ -441,10 +464,11 @@ WaveEvent function CreateToneTitanEvent(vector origin,vector angles,string route event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateLegionTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateLegionTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnLegionTitan @@ -456,10 +480,11 @@ WaveEvent function CreateLegionTitanEvent(vector origin,vector angles,string rou event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey return event } -WaveEvent function CreateMonarchTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1) +WaveEvent function CreateMonarchTitanEvent(vector origin,vector angles,string route,int nextEventIndex,int executeOnThisCall = 1,string entityGlobalKey="") { WaveEvent event event.eventFunction = SpawnMonarchTitan @@ -471,6 +496,30 @@ WaveEvent function CreateMonarchTitanEvent(vector origin,vector angles,string ro event.spawnEvent.origin = origin event.spawnEvent.angles = angles event.spawnEvent.route = route + event.spawnEvent.entityGlobalKey = entityGlobalKey + return event +} + +WaveEvent function CreateWaitForDeathOfEntitysEvent(array<string> waitGlobalDataKey,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = waitForDeathOfEntitys + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event. shouldThread = false + event.flowControlEvent.waitGlobalDataKey = waitGlobalDataKey + return event +} + +WaveEvent function CreateWaitForLessThanTypedEvent(int aiTypeId,int amount,int nextEventIndex,int executeOnThisCall = 1) +{ + WaveEvent event + event.eventFunction = waitForLessThanAliveTyped + event.executeOnThisCall = executeOnThisCall + event.nextEventIndex = nextEventIndex + event. shouldThread = false + event.flowControlEvent.waitAmount = amount + event.flowControlEvent.waitEntityType = aiTypeId return event } @@ -484,7 +533,7 @@ WaveEvent function CreateMonarchTitanEvent(vector origin,vector angles,string ro ####### # ####### # # # # ##### # # ##### # ### ####### # # ##### \************************************************************************************************************/ -void function spawnSmoke(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnSmoke(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { printt("smoke") SmokescreenStruct smokescreen @@ -500,7 +549,41 @@ void function spawnSmoke(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent w } -void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function waitForDeathOfEntitys(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +{ + while(IsAlive(fd_harvester.harvester)) + { + bool anyoneAlive = false + foreach(string key in flowControlEvent.waitGlobalDataKey ) + { + if(!(key in GlobalEventEntitys)) + continue + if(IsAlive(GlobalEventEntitys[key])) + anyoneAlive = true + } + if(!anyoneAlive) + break + } +} + +void function waitForLessThanAliveTyped(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) +{ + while(IsAlive(fd_harvester.harvester)) + { + int amount + foreach(entity npc in spawnedNPCs) + { + if(FD_GetAITypeID_ByString(npc.GetTargetName())) //TODO getaitypeid_bystring does not contain all possible strings + amount++ + } + if(amount<=flowControlEvent.waitAmount) + break + WaitFrame() + } + +} + +void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateArcTitan(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) @@ -514,14 +597,15 @@ void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEven npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) npc.AssaultSetFightRadius(0) + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc thread singleNav_thread(npc,spawnEvent.route) thread EMPTitanThinkConstant(npc) } -void function waitForTime(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function waitForTime(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { - float waitUntil = Time() + waitEvent.amount + float waitUntil = Time() + flowControlEvent.waitTime while(Time()<waitUntil) { if(!IsAlive(fd_harvester.harvester)) @@ -530,19 +614,20 @@ void function waitForTime(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent } } -void function waitUntilLessThanAmountAliveEvent(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function waitUntilLessThanAmountAliveEvent(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { - waitUntilLessThanAmountAlive(int(waitEvent.amount)) + waitUntilLessThanAmountAlive(flowControlEvent.waitAmount) } -void function spawnSuperSpectre(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnSuperSpectre(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateSuperSpectre(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) SetSpawnOption_AISettings(npc,"npc_super_spectre_fd") spawnedNPCs.append(npc) - + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc wait 4.7 DispatchSpawn(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) @@ -552,14 +637,15 @@ void function spawnSuperSpectre(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wait thread singleNav_thread(npc, spawnEvent.route) } -void function spawnSuperSpectreWithMinion(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnSuperSpectreWithMinion(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateSuperSpectre(TEAM_IMC,spawnEvent.origin,spawnEvent.angles) SetSpawnOption_AISettings(npc,"npc_super_spectre_fd") spawnedNPCs.append(npc) - + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc wait 4.7 DispatchSpawn(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) @@ -570,7 +656,7 @@ void function spawnSuperSpectreWithMinion(SmokeEvent smokeEvent,SpawnEvent spawn } -void function spawnDroppodGrunts(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnDroppodGrunts(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) @@ -585,7 +671,8 @@ void function spawnDroppodGrunts(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wai for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) { entity guy = CreateSoldier( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey+i.tostring()] <- guy SetTeam( guy, TEAM_IMC ) guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) guy.DisableNPCFlag( NPC_ALLOW_PATROL) @@ -604,7 +691,7 @@ void function spawnDroppodGrunts(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wai thread SquadNav_Thread(guys,spawnEvent.route) } -void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) @@ -619,7 +706,8 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wa for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) { entity guy = CreateStalker( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey+i.tostring()] <- guy SetTeam( guy, TEAM_IMC ) guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE | NPC_ALLOW_HAND_SIGNALS | NPC_ALLOW_FLEE ) guy.DisableNPCFlag( NPC_ALLOW_PATROL) @@ -629,7 +717,7 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wa SetSquad( guy, squadName ) guy.AssaultSetFightRadius( 0 ) // makes them keep moving instead of stopping to shoot you. AddMinimapForHumans(guy) - file.spawnedNPCs.append(guy) + spawnedNPCs.append(guy) SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.STALKER)) thread FDStalkerThink( guy , fd_harvester.harvester ) guys.append( guy ) @@ -668,7 +756,7 @@ void function spawnDroppodStalker(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wa } -void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) @@ -682,7 +770,8 @@ void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEv for ( int i = 0; i < 4; i++ ) { entity guy = CreateSpectre( TEAM_IMC, spawnEvent.origin,<0,0,0> ) - + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey+i.tostring()] <- guy SetTeam( guy, TEAM_IMC ) DispatchSpawn( guy ) @@ -695,14 +784,16 @@ void function spawnDroppodSpectreMortar(SmokeEvent smokeEvent,SpawnEvent spawnEv ActivateFireteamDropPod( pod, guys ) } -void function spawnGenericNPC(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnGenericNPC(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPC( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc DispatchSpawn(npc) } -void function spawnGenericNPCTitanwithSettings(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnGenericNPCTitanwithSettings(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan( spawnEvent.npcClassName, TEAM_IMC, spawnEvent.origin, spawnEvent.angles ) @@ -711,6 +802,8 @@ void function spawnGenericNPCTitanwithSettings(SmokeEvent smokeEvent,SpawnEvent SetSpawnOption_AISettings( npc, spawnEvent.aiSettings) SetSpawnOption_Titanfall(npc) DispatchSpawn(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) @@ -718,7 +811,7 @@ void function spawnGenericNPCTitanwithSettings(SmokeEvent smokeEvent,SpawnEvent } -void function SpawnIonTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnIonTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -726,14 +819,16 @@ void function SpawnIonTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEven SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn( npc ) - file.spawnedNPCs.append(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc + spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread CommonAIThink(npc, spawnEvent.route) + thread singleNav_thread(npc, spawnEvent.route) } -void function SpawnScorchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnScorchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -741,14 +836,16 @@ void function SpawnScorchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitE SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn( npc ) - file.spawnedNPCs.append(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc + spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread CommonAIThink(npc, spawnEvent.route) + thread singleNav_thread(npc, spawnEvent.route) } -void function SpawnRoninTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnRoninTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_stryder",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -756,14 +853,16 @@ void function SpawnRoninTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEv SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn( npc ) - file.spawnedNPCs.append(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc + spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread CommonAIThink(npc, spawnEvent.route) + thread singleNav_thread(npc, spawnEvent.route) } -void function SpawnToneTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnToneTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -771,14 +870,16 @@ void function SpawnToneTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEve SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn( npc ) - file.spawnedNPCs.append(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc + spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread CommonAIThink(npc, spawnEvent.route) + thread singleNav_thread(npc, spawnEvent.route) } -void function SpawnLegionTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnLegionTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -786,14 +887,16 @@ void function SpawnLegionTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitE SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn( npc ) - file.spawnedNPCs.append(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc + spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread CommonAIThink(npc, spawnEvent.route) + thread singleNav_thread(npc, spawnEvent.route) } -void function SpawnMonarchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnMonarchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -801,14 +904,16 @@ void function SpawnMonarchTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,Wait SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn( npc ) - file.spawnedNPCs.append(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc + spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) npc.GetTitanSoul().SetTitanSoulNetBool( "showOverheadIcon", true ) - thread CommonAIThink(npc, spawnEvent.route) + thread singleNav_thread(npc, spawnEvent.route) } -void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_ogre",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -818,6 +923,8 @@ void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEve npc.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS) npc.AssaultSetFightRadius(0) DispatchSpawn(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) @@ -827,7 +934,7 @@ void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEve } -void function spawnMortarTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnMortarTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) @@ -836,6 +943,8 @@ void function spawnMortarTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitE SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) @@ -843,7 +952,7 @@ void function spawnMortarTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitE thread MortarTitanThink(npc,fd_harvester.harvester) } -void function spawnSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function spawnSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_stryder",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -851,6 +960,8 @@ void function spawnSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitE SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc spawnedNPCs.append(npc) AddMinimapForTitans(npc) npc.WaitSignal( "TitanHotDropComplete" ) @@ -859,7 +970,7 @@ void function spawnSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitE } -void function SpawnToneSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnToneSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity npc = CreateNPCTitan("titan_atlas",TEAM_IMC, spawnEvent.origin, spawnEvent.angles) @@ -867,6 +978,8 @@ void function SpawnToneSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,W SetSpawnOption_Titanfall(npc) SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) // required for client to create icons DispatchSpawn( npc ) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc npc.AssaultSetFightRadius(0) spawnedNPCs.append(npc) AddMinimapForTitans(npc) @@ -875,15 +988,17 @@ void function SpawnToneSniperTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,W thread SniperTitanThink(npc,fd_harvester.harvester) } -void function fd_spawnCloakDrone(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function fd_spawnCloakDrone(SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { entity npc = SpawnCloakDrone( TEAM_IMC, spawnEvent.origin, spawnEvent.angles, fd_harvester.harvester.GetOrigin() ) spawnedNPCs.append(npc) + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey] <- npc SetTargetName( npc, GetTargetNameForID(spawnEvent.spawnType)) AddMinimapForHumans(npc) } -void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent) +void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent) { PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0) entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> ) @@ -897,7 +1012,8 @@ void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,WaitEvent w for ( int i = 0; i < spawnEvent.spawnAmount; i++ ) { entity guy = CreateFragDrone( TEAM_IMC, spawnEvent.origin, <0,0,0> ) - + if(spawnEvent.entityGlobalKey!="") + GlobalEventEntitys[spawnEvent.entityGlobalKey+i.tostring()] <- guy SetSpawnOption_AISettings(guy, "npc_frag_drone_fd") SetTeam( guy, TEAM_IMC ) guy.EnableNPCFlag( NPC_ALLOW_INVESTIGATE ) |