aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp/levels
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp/levels')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut15
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut45
2 files changed, 57 insertions, 3 deletions
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 37b891699..40cf942ec 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_colony02.nut
@@ -1 +1,14 @@
-//fuck \ No newline at end of file
+global function CodeCallback_MapInit
+
+void function CodeCallback_MapInit()
+{
+ AddEvacNode( CreateScriptRef( < -475.129913, 1480.167847, 527.363953 >, < 8.841560, 219.338501, 0 > ) )
+ AddEvacNode( CreateScriptRef( < 1009.315186, 3999.888916, 589.914917 >, < 23.945116, -146.680725, 0 > ) )
+ AddEvacNode( CreateScriptRef( < 2282.868896, -1363.706543, 846.188660 >, < 23.945116, -146.680725, 0 > ) )
+ AddEvacNode( CreateScriptRef( < 1911.771606, -752.053101, 664.741821 >, < 9.955260, 138.721191, 0 > ) )
+ AddEvacNode( CreateScriptRef( < 1985.563232, -1205.455078, 677.444763 >, < 13.809734, -239.877441, 0 > ) )
+ AddEvacNode( CreateScriptRef( < -59.625496, -1858.108887, 811.592407 >, < 20.556290, -252.775146, 0 > ) )
+ AddEvacNode( CreateScriptRef( < -1035.991211, -671.114380, 824.180908 >, < 16.220453, -24.511070, 0 > ) )
+
+ SetEvacSpaceNode( GetEnt( "intro_spacenode" ) )
+} \ 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 11587947f..3f3a05f2d 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut
@@ -2,6 +2,8 @@ untyped
global function CodeCallback_MapInit
struct {
+ array<entity> marvinSpawners
+
float introStartTime
entity militiaPod
entity imcPod
@@ -20,13 +22,14 @@ void function CodeCallback_MapInit()
SetEvacSpaceNode( GetEnt( "end_spacenode" ) )
// dissolve effects
- AddDeathCallback( "player", WargamesDissolveDeadEntity )
+ AddDeathCallback( "player", WargamesDissolveDeadEntity )
AddDeathCallback( "npc_soldier", WargamesDissolveDeadEntity )
AddDeathCallback( "npc_spectre", WargamesDissolveDeadEntity )
AddDeathCallback( "npc_pilot_elite", WargamesDissolveDeadEntity )
AddDeathCallback( "npc_marvin", WargamesDissolveDeadEntity )
- FlagClear( "Disable_Marvins" )
+ AddSpawnCallback( "info_spawnpoint_marvin", AddMarvinSpawner )
+ AddCallback_GameStateEnter( eGameState.Prematch, SpawnMarvinsForRound )
// currently disabled until finished: intro
if ( !IsFFAGame() )
@@ -40,6 +43,44 @@ void function WargamesDissolveDeadEntity( entity deadEnt, var damageInfo )
{
deadEnt.Dissolve( ENTITY_DISSOLVE_CHAR, < 0, 0, 0 >, 0 )
EmitSoundAtPosition( TEAM_UNASSIGNED, deadEnt.GetOrigin(), "Object_Dissolve" )
+
+ if ( deadEnt.IsPlayer() )
+ thread EnsureWargamesDeathEffectIsClearedForPlayer( deadEnt )
+ }
+}
+
+void function EnsureWargamesDeathEffectIsClearedForPlayer( entity player )
+{
+ // this is slightly shit but whatever lol
+ player.EndSignal( "OnDestroy" )
+
+ float startTime = Time()
+ while ( player.kv.VisibilityFlags != "0" )
+ {
+ if ( Time() > startTime + 4.0 ) // if we wait too long, just ignore
+ return
+
+ WaitFrame()
+ }
+
+ player.kv.VisibilityFlags = ENTITY_VISIBLE_TO_EVERYONE
+}
+
+void function AddMarvinSpawner( entity spawn )
+{
+ file.marvinSpawners.append( spawn )
+}
+
+void function SpawnMarvinsForRound()
+{
+ foreach ( entity spawner in file.marvinSpawners )
+ {
+ entity marvin = CreateMarvin( TEAM_UNASSIGNED, spawner.GetOrigin(), spawner.GetAngles() )
+ marvin.kv.health = 1
+ marvin.kv.max_health = 1
+ marvin.kv.spawnflags = 516
+ DispatchSpawn( marvin )
+ HideName( marvin )
}
}