diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-06-22 14:30:49 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-06-22 14:30:49 +0100 |
commit | 207facbc402f5639cbcd31f079214351ef605cf2 (patch) | |
tree | 4710b2a88dd64f3dfea1609d31a5de9141640951 /Northstar.CustomServers/scripts/vscripts/mp/_spawn_functions.nut | |
parent | c2d438568df6d98cf731807e30eaa7da31e5ea52 (diff) | |
download | NorthstarMods-207facbc402f5639cbcd31f079214351ef605cf2.tar.gz NorthstarMods-207facbc402f5639cbcd31f079214351ef605cf2.zip |
initial commit after moving to new repo
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/mp/_spawn_functions.nut')
-rw-r--r-- | Northstar.CustomServers/scripts/vscripts/mp/_spawn_functions.nut | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/mp/_spawn_functions.nut b/Northstar.CustomServers/scripts/vscripts/mp/_spawn_functions.nut new file mode 100644 index 000000000..3d9b84f3a --- /dev/null +++ b/Northstar.CustomServers/scripts/vscripts/mp/_spawn_functions.nut @@ -0,0 +1,60 @@ +untyped + +global function SpawnFunctions_Init + +function SpawnFunctions_Init() +{ + if ( IsLobby() ) + return + + // shared OnSpawned callbacks + AddSpawnCallback( "script_mover", SpawnScriptMover ) + AddSpawnCallback( "path_track", SpawnPathTrack ) + AddSpawnCallback( "info_hint", SpawnInfoHint ) + AddDeathCallback( "npc_titan", EmptyDeathCallback ) // so death info gets sent to client + + // Arc Cannon Targets + foreach ( classname, val in ArcCannonTargetClassnames ) + { + AddSpawnCallback( classname, AddToArcCannonTargets ) + } + + foreach ( classname, val in ProximityTargetClassnames ) + { + AddSpawnCallback( classname, AddToProximityTargets ) + } +} + +void function EmptyDeathCallback( entity _1, var _2 ) +{ +} + + +void function SpawnPathTrack( entity node ) +{ + if ( node.HasKey( "WaitSignal" ) ) + RegisterSignal( node.kv.WaitSignal ) + + if ( node.HasKey( "SendSignal" ) ) + RegisterSignal( node.kv.SendSignal ) + + if ( node.HasKey( "WaitFlag" ) ) + FlagInit( expect string( node.kv.WaitFlag ) ) + + if ( node.HasKey( "SetFlag" ) ) + FlagInit( expect string( node.kv.SetFlag ) ) +} + +void function SpawnScriptMover( entity ent ) +{ + if ( ent.HasKey( "custom_health" ) ) + { + //printt( "setting health on " + ent + " to " + ent.kv.custom_health.tointeger() ) + ent.SetHealth( ent.kv.custom_health.tointeger() ) + } +} + +void function SpawnInfoHint( entity ent ) +{ + Assert( !ent.HasKey( "hotspot" ) || ent.kv.hotspot.tolower() in level.hotspotHints, "info_hint at " + ent.GetOrigin() + " has unknown hotspot hint: " + ent.kv.hotspot.tolower() ) +}
\ No newline at end of file |