mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master' into master-adding
This commit is contained in:
commit
6f3e076f13
@ -562,9 +562,16 @@ function DATABASE:_EventOnDeadOrCrash( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
if self.UNITS[Event.IniDCSUnitName] then
|
||||
self:DeleteUnit( Event.IniDCSUnitName )
|
||||
-- add logic to correctly remove a group once all units are destroyed...
|
||||
if Event.IniObjectCategory == 3 then
|
||||
if self.STATICS[Event.IniDCSUnitName] then
|
||||
self:DeleteStatic( Event.IniDCSUnitName )
|
||||
end
|
||||
else
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if self.UNITS[Event.IniDCSUnitName] then
|
||||
self:DeleteUnit( Event.IniDCSUnitName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -577,11 +584,13 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniUnit then
|
||||
self:AddUnit( Event.IniDCSUnitName )
|
||||
self:AddGroup( Event.IniDCSGroupName )
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if not self.PLAYERS[PlayerName] then
|
||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
self:AddUnit( Event.IniDCSUnitName )
|
||||
self:AddGroup( Event.IniDCSGroupName )
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if not self.PLAYERS[PlayerName] then
|
||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -594,9 +603,11 @@ function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniUnit then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if self.PLAYERS[PlayerName] then
|
||||
self:DeletePlayer( PlayerName )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if self.PLAYERS[PlayerName] then
|
||||
self:DeletePlayer( PlayerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -538,7 +538,7 @@ function SET_BASE:_EventOnBirth( Event )
|
||||
if Event.IniDCSUnit then
|
||||
local ObjectName, Object = self:AddInDatabase( Event )
|
||||
self:T3( ObjectName, Object )
|
||||
if self:IsIncludeObject( Object ) then
|
||||
if Object and self:IsIncludeObject( Object ) then
|
||||
self:Add( ObjectName, Object )
|
||||
--self:_EventOnPlayerEnterUnit( Event )
|
||||
end
|
||||
@ -908,9 +908,11 @@ end
|
||||
function SET_GROUP:AddInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
if not self.Database[Event.IniDCSGroupName] then
|
||||
self.Database[Event.IniDCSGroupName] = GROUP:Register( Event.IniDCSGroupName )
|
||||
self:T3( self.Database[Event.IniDCSGroupName] )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if not self.Database[Event.IniDCSGroupName] then
|
||||
self.Database[Event.IniDCSGroupName] = GROUP:Register( Event.IniDCSGroupName )
|
||||
self:T3( self.Database[Event.IniDCSGroupName] )
|
||||
end
|
||||
end
|
||||
|
||||
return Event.IniDCSGroupName, self.Database[Event.IniDCSGroupName]
|
||||
@ -1333,9 +1335,11 @@ end
|
||||
function SET_UNIT:AddInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
if not self.Database[Event.IniDCSUnitName] then
|
||||
self.Database[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnitName )
|
||||
self:T3( self.Database[Event.IniDCSUnitName] )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if not self.Database[Event.IniDCSUnitName] then
|
||||
self.Database[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnitName )
|
||||
self:T3( self.Database[Event.IniDCSUnitName] )
|
||||
end
|
||||
end
|
||||
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
|
||||
@ -375,8 +375,6 @@ function ZONE_RADIUS:BoundZone( Points )
|
||||
["heading"] = 0,
|
||||
} -- end of ["group"]
|
||||
|
||||
self:E( Tire )
|
||||
|
||||
coalition.addStaticObject( country.id.USA, Tire )
|
||||
end
|
||||
|
||||
@ -841,8 +839,6 @@ function ZONE_POLYGON_BASE:BoundZone( )
|
||||
["heading"] = 0,
|
||||
} -- end of ["group"]
|
||||
|
||||
self:E( Tire )
|
||||
|
||||
coalition.addStaticObject( country.id.USA, Tire )
|
||||
|
||||
end
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170305_0931' )
|
||||
env.info( 'Moose Generation Timestamp: 20170305_1434' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -6554,8 +6554,6 @@ function ZONE_RADIUS:BoundZone( Points )
|
||||
["heading"] = 0,
|
||||
} -- end of ["group"]
|
||||
|
||||
self:E( Tire )
|
||||
|
||||
coalition.addStaticObject( country.id.USA, Tire )
|
||||
end
|
||||
|
||||
@ -7020,8 +7018,6 @@ function ZONE_POLYGON_BASE:BoundZone( )
|
||||
["heading"] = 0,
|
||||
} -- end of ["group"]
|
||||
|
||||
self:E( Tire )
|
||||
|
||||
coalition.addStaticObject( country.id.USA, Tire )
|
||||
|
||||
end
|
||||
@ -7766,9 +7762,16 @@ function DATABASE:_EventOnDeadOrCrash( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
if self.UNITS[Event.IniDCSUnitName] then
|
||||
self:DeleteUnit( Event.IniDCSUnitName )
|
||||
-- add logic to correctly remove a group once all units are destroyed...
|
||||
if Event.IniObjectCategory == 3 then
|
||||
if self.STATICS[Event.IniDCSUnitName] then
|
||||
self:DeleteStatic( Event.IniDCSUnitName )
|
||||
end
|
||||
else
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if self.UNITS[Event.IniDCSUnitName] then
|
||||
self:DeleteUnit( Event.IniDCSUnitName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -7781,11 +7784,13 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniUnit then
|
||||
self:AddUnit( Event.IniDCSUnitName )
|
||||
self:AddGroup( Event.IniDCSGroupName )
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if not self.PLAYERS[PlayerName] then
|
||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
self:AddUnit( Event.IniDCSUnitName )
|
||||
self:AddGroup( Event.IniDCSGroupName )
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if not self.PLAYERS[PlayerName] then
|
||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -7798,9 +7803,11 @@ function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniUnit then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if self.PLAYERS[PlayerName] then
|
||||
self:DeletePlayer( PlayerName )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if self.PLAYERS[PlayerName] then
|
||||
self:DeletePlayer( PlayerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -8535,7 +8542,7 @@ function SET_BASE:_EventOnBirth( Event )
|
||||
if Event.IniDCSUnit then
|
||||
local ObjectName, Object = self:AddInDatabase( Event )
|
||||
self:T3( ObjectName, Object )
|
||||
if self:IsIncludeObject( Object ) then
|
||||
if Object and self:IsIncludeObject( Object ) then
|
||||
self:Add( ObjectName, Object )
|
||||
--self:_EventOnPlayerEnterUnit( Event )
|
||||
end
|
||||
@ -8905,9 +8912,11 @@ end
|
||||
function SET_GROUP:AddInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
if not self.Database[Event.IniDCSGroupName] then
|
||||
self.Database[Event.IniDCSGroupName] = GROUP:Register( Event.IniDCSGroupName )
|
||||
self:T3( self.Database[Event.IniDCSGroupName] )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if not self.Database[Event.IniDCSGroupName] then
|
||||
self.Database[Event.IniDCSGroupName] = GROUP:Register( Event.IniDCSGroupName )
|
||||
self:T3( self.Database[Event.IniDCSGroupName] )
|
||||
end
|
||||
end
|
||||
|
||||
return Event.IniDCSGroupName, self.Database[Event.IniDCSGroupName]
|
||||
@ -9330,9 +9339,11 @@ end
|
||||
function SET_UNIT:AddInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
if not self.Database[Event.IniDCSUnitName] then
|
||||
self.Database[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnitName )
|
||||
self:T3( self.Database[Event.IniDCSUnitName] )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if not self.Database[Event.IniDCSUnitName] then
|
||||
self.Database[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnitName )
|
||||
self:T3( self.Database[Event.IniDCSUnitName] )
|
||||
end
|
||||
end
|
||||
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170305_0931' )
|
||||
env.info( 'Moose Generation Timestamp: 20170305_1434' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -6554,8 +6554,6 @@ function ZONE_RADIUS:BoundZone( Points )
|
||||
["heading"] = 0,
|
||||
} -- end of ["group"]
|
||||
|
||||
self:E( Tire )
|
||||
|
||||
coalition.addStaticObject( country.id.USA, Tire )
|
||||
end
|
||||
|
||||
@ -7020,8 +7018,6 @@ function ZONE_POLYGON_BASE:BoundZone( )
|
||||
["heading"] = 0,
|
||||
} -- end of ["group"]
|
||||
|
||||
self:E( Tire )
|
||||
|
||||
coalition.addStaticObject( country.id.USA, Tire )
|
||||
|
||||
end
|
||||
@ -7766,9 +7762,16 @@ function DATABASE:_EventOnDeadOrCrash( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
if self.UNITS[Event.IniDCSUnitName] then
|
||||
self:DeleteUnit( Event.IniDCSUnitName )
|
||||
-- add logic to correctly remove a group once all units are destroyed...
|
||||
if Event.IniObjectCategory == 3 then
|
||||
if self.STATICS[Event.IniDCSUnitName] then
|
||||
self:DeleteStatic( Event.IniDCSUnitName )
|
||||
end
|
||||
else
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if self.UNITS[Event.IniDCSUnitName] then
|
||||
self:DeleteUnit( Event.IniDCSUnitName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -7781,11 +7784,13 @@ function DATABASE:_EventOnPlayerEnterUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniUnit then
|
||||
self:AddUnit( Event.IniDCSUnitName )
|
||||
self:AddGroup( Event.IniDCSGroupName )
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if not self.PLAYERS[PlayerName] then
|
||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
self:AddUnit( Event.IniDCSUnitName )
|
||||
self:AddGroup( Event.IniDCSGroupName )
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if not self.PLAYERS[PlayerName] then
|
||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -7798,9 +7803,11 @@ function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniUnit then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if self.PLAYERS[PlayerName] then
|
||||
self:DeletePlayer( PlayerName )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if self.PLAYERS[PlayerName] then
|
||||
self:DeletePlayer( PlayerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -8535,7 +8542,7 @@ function SET_BASE:_EventOnBirth( Event )
|
||||
if Event.IniDCSUnit then
|
||||
local ObjectName, Object = self:AddInDatabase( Event )
|
||||
self:T3( ObjectName, Object )
|
||||
if self:IsIncludeObject( Object ) then
|
||||
if Object and self:IsIncludeObject( Object ) then
|
||||
self:Add( ObjectName, Object )
|
||||
--self:_EventOnPlayerEnterUnit( Event )
|
||||
end
|
||||
@ -8905,9 +8912,11 @@ end
|
||||
function SET_GROUP:AddInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
if not self.Database[Event.IniDCSGroupName] then
|
||||
self.Database[Event.IniDCSGroupName] = GROUP:Register( Event.IniDCSGroupName )
|
||||
self:T3( self.Database[Event.IniDCSGroupName] )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if not self.Database[Event.IniDCSGroupName] then
|
||||
self.Database[Event.IniDCSGroupName] = GROUP:Register( Event.IniDCSGroupName )
|
||||
self:T3( self.Database[Event.IniDCSGroupName] )
|
||||
end
|
||||
end
|
||||
|
||||
return Event.IniDCSGroupName, self.Database[Event.IniDCSGroupName]
|
||||
@ -9330,9 +9339,11 @@ end
|
||||
function SET_UNIT:AddInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
if not self.Database[Event.IniDCSUnitName] then
|
||||
self.Database[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnitName )
|
||||
self:T3( self.Database[Event.IniDCSUnitName] )
|
||||
if Event.IniObjectCategory == 1 then
|
||||
if not self.Database[Event.IniDCSUnitName] then
|
||||
self.Database[Event.IniDCSUnitName] = UNIT:Register( Event.IniDCSUnitName )
|
||||
self:T3( self.Database[Event.IniDCSUnitName] )
|
||||
end
|
||||
end
|
||||
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
|
||||
@ -18,9 +18,9 @@ local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
|
||||
|
||||
local Scoring = SCORING:New( "Shooting Range 1" )
|
||||
|
||||
Scoring:SetMultiplierDestroyScore( 10 )
|
||||
Scoring:SetScaleDestroyScore( 10 )
|
||||
|
||||
Scoring:SetMultiplierDestroyPenalty( 40 )
|
||||
Scoring:SetScaleDestroyPenalty( 40 )
|
||||
|
||||
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
|
||||
|
||||
@ -35,4 +35,4 @@ Scoring:AddZoneScore( ShootingRangeZone, 200 )
|
||||
local SceneryZone = ZONE:New( "ScoringZone2" )
|
||||
Scoring:AddZoneScore( SceneryZone, 200 )
|
||||
|
||||
|
||||
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,139 @@
|
||||
---
|
||||
-- Name: SCO-500 - Scoring Multi Player Demo Mission 1
|
||||
-- Author: Pikey and FlightControl
|
||||
-- Date Created: 1 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A demo mission for the scoring. Read the briefing and have fun.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
||||
|
||||
-- Define the patrol zones
|
||||
local BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) )
|
||||
local RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) )
|
||||
|
||||
-- Define the engage zones
|
||||
local BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) )
|
||||
local RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) )
|
||||
|
||||
-- Define the Spawn zones for ground vehicles
|
||||
local BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) )
|
||||
--local RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) )
|
||||
|
||||
local RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" )
|
||||
|
||||
-- Define the Scoring zones that define the shelters
|
||||
local BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) )
|
||||
local RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) )
|
||||
|
||||
-- Define the Set of Clients that are used for the AI Balancers
|
||||
local BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player")
|
||||
local RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player")
|
||||
|
||||
-- Define the Spawn objects for the AI planes
|
||||
local BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
||||
local RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
||||
|
||||
-- Define the AI Balancers for the planes
|
||||
local BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
||||
local RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
||||
|
||||
-- Define the Spawn objects for the airbase defenses
|
||||
local BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
||||
local BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
||||
local RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
||||
local RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
||||
|
||||
-- Define the ground forces spawning engines...
|
||||
|
||||
-- First define the template arrays.
|
||||
local BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" }
|
||||
local RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" }
|
||||
|
||||
-- New we are using these templates to define the spawn objects for the ground forces.
|
||||
-- We spawn them at random places into the define zone.
|
||||
local BlueGroundSpawn = SPAWN
|
||||
:New( "Blue Ground Forces" )
|
||||
:InitLimit( 12, 30 )
|
||||
:InitRandomizeZones( { BlueSpawnGroundZone } )
|
||||
:InitRandomizeTemplate( BlueGroundTemplates )
|
||||
:SpawnScheduled( 60, 0.2 )
|
||||
|
||||
local RedGroundSpawn = SPAWN
|
||||
:New( "Red Ground Forces" )
|
||||
:InitLimit( 12, 30 )
|
||||
:InitRandomizeTemplate( RedGroundTemplates )
|
||||
:InitRandomizeZones( { RedSpawnGroundZone } )
|
||||
:SpawnScheduled( 60, 0.2 )
|
||||
|
||||
|
||||
|
||||
local BlueCap = {}
|
||||
local RedCap = {}
|
||||
|
||||
-- Define the OnAfterSpawned events of the AI balancer Spawn Groups
|
||||
function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
if AIGroup then
|
||||
BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 )
|
||||
local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
||||
|
||||
Cap:ManageFuel( 0.4, 180 )
|
||||
Cap:SetEngageZone( BlueEngageZone )
|
||||
Cap:SetControllable( AIGroup )
|
||||
Cap:Start()
|
||||
end
|
||||
end
|
||||
|
||||
function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
if AIGroup then
|
||||
RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 )
|
||||
local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
||||
|
||||
Cap:ManageFuel( 0.4, 180 )
|
||||
Cap:SetEngageZone( BlueEngageZone )
|
||||
Cap:SetControllable( AIGroup )
|
||||
Cap:Start()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- Okay, now that we defined all this stuff, now make the SCORING setup ...
|
||||
|
||||
-- First define a Scoring object
|
||||
local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" )
|
||||
|
||||
-- Define within the scoring the shelter designated targets.
|
||||
Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
||||
Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
||||
|
||||
-- Define the static objects that give extra scores
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 )
|
||||
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 )
|
||||
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 )
|
||||
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 )
|
||||
|
||||
-- Scale the scoring rewarded.
|
||||
Scoring:SetScaleDestroyScore( 30 )
|
||||
Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys.
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user