aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
authorRoyalBlue1 <malte.hoermeyer@web.de>2022-02-24 17:50:40 +0100
committerRoyalBlue1 <malte.hoermeyer@web.de>2022-03-25 19:59:02 +0100
commit6bc02db86ceb6009fae579704d24e222bc69dda7 (patch)
treee790e1c7849b381d5e8493c23314e6bcbb2a7fe5 /Northstar.CustomServers
parentf306be5d74400b3f61ff5b4d4366351412304dde (diff)
downloadNorthstarMods-6bc02db86ceb6009fae579704d24e222bc69dda7.tar.gz
NorthstarMods-6bc02db86ceb6009fae579704d24e222bc69dda7.zip
Added Array to track alive Titans
Added rise shop
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut35
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut8
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut44
3 files changed, 78 insertions, 9 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
index 7f75144b..55f667d7 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
@@ -56,6 +56,7 @@ struct {
array<entity> routeNodes
table<string,float> harvesterDamageSource
bool haversterWasDamaged
+ array<entity> spawnedNPCs
}file
void function GamemodeFD_Init()
@@ -68,7 +69,23 @@ void function GamemodeFD_Init()
AddClientCommandCallback("FD_UseHarvesterShieldBoost",useShieldBoost)
RegisterSignal("FD_ReachedHarvester")
RegisterSignal("OnFailedToPath")
+ AddDeathCallback("npc_titan",OnNpcDeath)
+ AddDeathCallback("npc_stalker",OnNpcDeath)
+ AddDeathCallback("npc_spectre",OnNpcDeath)
+ AddDeathCallback("npc_super_spectre",OnNpcDeath)
+ AddDeathCallback("npc_soldier",OnNpcDeath)
+ AddDeathCallback("npc_frag_drone",OnNpcDeath)
+ AddDeathCallback("npc_drone",OnNpcDeath)
+
+}
+void function OnNpcDeath( entity ent, var damageInfo ){
+ int findIndex = file.spawnedNPCs.find( ent )
+ if ( findIndex != -1 )
+ {
+ file.spawnedNPCs.remove( findIndex )
+ }
+ printt("callback")
}
void function RateSpawnpoints_FD(int _0, array<entity> _1, int _2, entity _3){}
@@ -629,8 +646,9 @@ void function spawnArcTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEven
{
entity npc = CreateArcTitan(TEAM_IMC,spawnEvent.origin,spawnEvent.angles)
thread titanNav_thread(npc,spawnEvent.route)
+ SetSpawnOption_Titanfall(npc)
DispatchSpawn(npc)
- thread NPCTitanHotdrops(npc,true)
+ file.spawnedNPCs.append(npc)
thread EMPTitanThinkConstant(npc)
}
@@ -644,20 +662,22 @@ void function waitForTime(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent
void function waitUntilLessThanAmountAlive(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent)
{
- int aliveTitans = GetEntArrayByClass_Expensive("npc_titan").len()
- while(aliveTitans>waitEvent.amount.tointeger())
+ int aliveTitans = file.spawnedNPCs.len()
+ int testamount = waitEvent.amount.tointeger()
+ while(aliveTitans>testamount)
{
- printt("Titans alive",aliveTitans,waitEvent.amount.tointeger())
+ printt("Titans alive",aliveTitans,testamount)
WaitFrame()
- aliveTitans = GetEntArrayByClass_Expensive("npc_titan").len()
+ aliveTitans = file.spawnedNPCs.len()
}
-
+ printt("Titans alive end",aliveTitans,testamount)
}
void function spawnSuperSpectre(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEvent waitEvent,SoundEvent soundEvent)
{
entity npc = CreateSuperSpectre(TEAM_IMC,spawnEvent.origin,spawnEvent.angles)
+ SetSpawnOption_Titanfall(npc)
DispatchSpawn(npc)
}
@@ -692,9 +712,10 @@ void function spawnNukeTitan(SmokeEvent smokeEvent,SpawnEvent spawnEvent,WaitEve
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)
DispatchSpawn(npc)
+ file.spawnedNPCs.append(npc)
- thread NPCTitanHotdrops(npc,true)
NukeTitanThink(npc,fd_harvester.harvester)
}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut
index 37b89169..94dce470 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise.nut
@@ -1 +1,7 @@
-//fuck \ No newline at end of file
+global function CodeCallback_MapInit
+
+void function CodeCallback_MapInit()
+{
+ if(GameRules_GetGameMode()=="fd")
+ initFrontierDefenseData()
+} \ No newline at end of file
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut
index 37b89169..74485971 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_rise_fd.nut
@@ -1 +1,43 @@
-//fuck \ No newline at end of file
+global function initFrontierDefenseData
+
+
+void function initFrontierDefenseData()
+{
+ shopPosition = < -5165.42, -679.285, 384.031> //only aproximate position
+
+
+
+ array<WaveEvent> wave0
+ array<WaveEvent> wave1
+ array<WaveEvent> wave2
+ array<WaveEvent> wave3
+ array<WaveEvent> wave4
+
+
+
+ //wave0.append(createSmokeEvent(< -12, 1720, 1556>,30))
+ // wave0.append(createSmokeEvent(< -64, 964, 1556>,30))
+ // wave0.append(createWaitForTimeEvent(10))
+ // wave0.append(createSuperSpectreEvent(< -64, 964, 1556>,<0,0,0>,""))
+
+ // for(int i = 0; i<2;i++){
+ // wave0.append(createNukeTitanEvent(< -12, 1720, 1556>,<0,0,0>,"hillRouteClose"))
+ // wave0.append(createWaitForTimeEvent(3))
+ // }
+ // wave0.append(createWaitUntilAliveEvent(0))
+ // for(int i = 0; i<3;i++){
+ // wave1.append(createNukeTitanEvent(< -12, 1720, 1556>,<0,0,0>,"hillRouteClose"))
+ // wave1.append(createWaitForTimeEvent(3))
+ // }
+ // wave1.append(createWaitUntilAliveEvent(0))
+ // wave0.append(createArcTitanEvent(< -12, 1720, 1556>,<0,0,0>,"hillRouteClose"))
+
+ //wave0.append(createArcTitanEvent(< -12, 1720, 1556>,<0,0,0>,"hillRouteClose"))
+ // wave0.append(createDroppodStalkerEvent(< -12, 1720, 1556>,""))
+
+ waveEvents.append(wave0)
+ waveEvents.append(wave1)
+ waveEvents.append(wave2)
+ waveEvents.append(wave3)
+ waveEvents.append(wave4)
+} \ No newline at end of file