diff options
author | RoyalBlue1 <malte.hoermeyer@web.de> | 2022-02-17 02:33:37 +0100 |
---|---|---|
committer | RoyalBlue1 <malte.hoermeyer@web.de> | 2022-03-25 19:58:11 +0100 |
commit | c7178117149bdf57ba40a6a32d9022588ba998aa (patch) | |
tree | 972f0de52aedbed409715739eef4a6c62cd95e6e | |
parent | bd102d798a0b9db2dcbd6bd4045fb84c53fc031a (diff) | |
download | NorthstarMods-c7178117149bdf57ba40a6a32d9022588ba998aa.tar.gz NorthstarMods-c7178117149bdf57ba40a6a32d9022588ba998aa.zip |
Spawn Harvester and load Npc Routes
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index 8a6b8bf0..84361454 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -1,12 +1,119 @@ global function GamemodeFD_Init global function RateSpawnpoints_FD + +struct { + array<entity> aiSpawnpoints + array<entity> smokePoints + array<entity> routeNodes +}file + void function GamemodeFD_Init() { PrecacheModel( MODEL_ATTRITION_BANK ) + AddCallback_EntitiesDidLoad(LoadEntities) } void function RateSpawnpoints_FD(int _0, array<entity> _1, int _2, entity _3) { +} + +void function spawnSmokes() +{ + +} + + +array<entity> function getRoute(string routeName) +{ + foreach(entity node in file.routeNodes) + { + if(!node.HasKey("route_name")) + continue + if(node.kv.route_name==routeName) + return node.GetLinkEntArray() + } + printt("Route not found") + return [] +} + +vector function getShopPosition() +{ + switch(GetMapName()) + { + case"mp_forwardbase_kodai": + return < -3862.13, 1267.69, 1060.06> + default: + return <0,0,0> + } + unreachable + +} + + + +void function LoadEntities() +{ + CreateBoostStoreLocation(TEAM_MILITIA,getShopPosition(),<0,0,0>) + + + + + foreach ( entity info_target in GetEntArrayByClass_Expensive("info_target") ) + { + + if ( GameModeRemove( info_target ) ) + continue + + if(info_target.HasKey("editorclass")){ + switch(info_target.kv.editorclass){ + case"info_fd_harvester": + entity harvester = CreateEntity( "prop_script" ) + harvester.SetValueForModelKey( $"models/props/generator_coop/generator_coop.mdl" ) + harvester.SetOrigin( info_target.GetOrigin() ) + harvester.SetAngles( info_target.GetAngles() ) + harvester.kv.solid = SOLID_VPHYSICS + harvester.SetHealth(25000) + harvester.SetShieldHealthMax(6000) + harvester.SetShieldHealth(6000) + SetTeam(harvester,TEAM_IMC) + DispatchSpawn( harvester ) + SetGlobalNetEnt("FD_activeHarvester",harvester) + // entity blackbox = CreatePropDynamic(MODEL_HARVESTER_TOWER_COLLISION,info_target.GetOrigin(),info_target.GetAngles(),6) + // blackbox.Hide() + // blackbox.kv.CollisionGroup = TRACE_COLLISION_GROUP_PLAYER + + entity rings = CreatePropDynamic(MODEL_HARVESTER_TOWER_RINGS,info_target.GetOrigin(),info_target.GetAngles(),6) + thread PlayAnim( rings, "generator_cycle_fast" ) + + entity Harvester_Beam = StartParticleEffectOnEntity_ReturnEntity(harvester,GetParticleSystemIndex(FX_HARVESTER_BEAM),FX_PATTACH_ABSORIGIN_FOLLOW,0) + EffectSetControlPointVector( Harvester_Beam, 1, < 126.0, 188.0, 236.0 > ) + entity Harvester_Shield = StartParticleEffectOnEntity_ReturnEntity(harvester,GetParticleSystemIndex(FX_HARVESTER_OVERSHIELD),FX_PATTACH_ABSORIGIN_FOLLOW,0) + EffectSetControlPointVector( Harvester_Shield, 1, < 126.0, 188.0, 236.0 > ) + + break + case"info_fd_mode_model": + entity prop = CreatePropDynamic( info_target.GetModelName(), info_target.GetOrigin(), info_target.GetAngles(), 6 ) + break + case"info_fd_ai_position": + file.aiSpawnpoints.append(info_target) + break + case"info_fd_route_node": + file.routeNodes.append(info_target) + break + case"info_fd_smoke_screen": + file.smokePoints.append(info_target) + break + } + + + + } + + + + + } + }
\ No newline at end of file |