aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2022-07-23 15:25:07 +0100
committerGitHub <noreply@github.com>2022-07-23 16:25:07 +0200
commit92e0c79759e4388320f565f3922ff5608aff19d6 (patch)
tree98eb17812cada188dbbc8caba21c0f3c333300e0 /Northstar.CustomServers/mod/scripts/vscripts
parent2275aceea6d8f3db04b1b9de2d9556cb7554d373 (diff)
downloadNorthstarMods-92e0c79759e4388320f565f3922ff5608aff19d6.tar.gz
NorthstarMods-92e0c79759e4388320f565f3922ff5608aff19d6.zip
[FD] Tick Improvements (#450)
* Format SpawnTick and disable flag that broke stuff * Fixed ticks not counting down on death * Make ticks more aggressive towards players
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut14
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut21
2 files changed, 24 insertions, 11 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
index 068a41f0..d630cbed 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut
@@ -85,6 +85,7 @@ void function GamemodeFD_Init()
//death Callbacks
AddCallback_OnNPCKilled(OnNpcDeath)
AddCallback_OnPlayerKilled(GamemodeFD_OnPlayerKilled)
+ AddDeathCallback( "npc_frag_drone", OnTickDeath ) // ticks dont come up in the other callback because of course they dont
//Command Callbacks
AddClientCommandCallback("FD_ToggleReady",ClientCommandCallbackToggleReady)
@@ -183,6 +184,19 @@ void function SetTurretSettings_threaded(entity player)
DeployableTurret_SetAISettingsForPlayer_AT(player,"npc_turret_sentry_burn_card_at_fd")
}
+void function OnTickDeath( entity victim, var damageInfo )
+{
+ int findIndex = spawnedNPCs.find( victim )
+ if ( findIndex != -1 )
+ {
+ spawnedNPCs.remove( findIndex )
+
+ SetGlobalNetInt( "FD_AICount_Ticks", GetGlobalNetInt( "FD_AICount_Ticks" ) -1 )
+
+ SetGlobalNetInt( "FD_AICount_Current", GetGlobalNetInt( "FD_AICount_Current" ) -1 )
+ }
+}
+
void function OnNpcDeath( entity victim, entity attacker, var damageInfo )
{
if(victim.IsTitan()&&attacker in file.players)
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 d69b17fd..8792a861 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd_events.nut
@@ -1088,9 +1088,9 @@ void function fd_spawnCloakDrone(SmokeEvent smokeEffect,SpawnEvent spawnEvent,Fl
AddMinimapForHumans(npc)
}
-void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent)
+void function SpawnTick( SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowControlEvent flowControlEvent,SoundEvent soundEvent )
{
- PingMinimap(spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0)
+ PingMinimap( spawnEvent.origin.x, spawnEvent.origin.y, 4, 600, 150, 0 )
entity pod = CreateDropPod( spawnEvent.origin, <0,0,0> )
SetTeam( pod, TEAM_IMC )
InitFireteamDropPod( pod )
@@ -1102,23 +1102,22 @@ void function SpawnTick(SmokeEvent smokeEffect,SpawnEvent spawnEvent,FlowControl
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")
+ 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 )
- guy.EnableNPCMoveFlag(NPCMF_WALK_ALWAYS | NPCMF_PREFER_SPRINT)
DispatchSpawn( guy )
- AddMinimapForHumans(guy)
- SetTargetName( guy, GetTargetNameForID(eFD_AITypeIDs.TICK))
+ AddMinimapForHumans( guy )
+ SetTargetName( guy, GetTargetNameForID( eFD_AITypeIDs.TICK ) )
SetSquad( guy, squadName )
- spawnedNPCs.append(guy)
-
+ spawnedNPCs.append( guy )
+ guy.AssaultSetFightRadius( expect int( guy.Dev_GetAISettingByKeyField("LookDistDefault_Combat") ) ) // make the ticks target players very aggressively
guys.append( guy )
}
ActivateFireteamDropPod( pod, guys )
- thread SquadNav_Thread(guys,spawnEvent.route)
+ thread SquadNav_Thread( guys, spawnEvent.route )
}