diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-31 23:14:58 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-31 23:14:58 +0100 |
commit | 9a96d0bff56f1969c68bb52a2f33296095bdc67d (patch) | |
tree | 4175928e488632705692e3cccafa1a38dd854615 /Northstar.CustomServers/mod/scripts/vscripts/mp/_spawn_functions.nut | |
parent | 27bd240871b7c0f2f49fef137718b2e3c208e3b4 (diff) | |
download | NorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.tar.gz NorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.zip |
move to new mod format
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp/_spawn_functions.nut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/mp/_spawn_functions.nut | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_spawn_functions.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_spawn_functions.nut new file mode 100644 index 000000000..3d9b84f3a --- /dev/null +++ b/Northstar.CustomServers/mod/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 |