[Gcblue-commits] gcb_data/scenario FourOnFourAir.py,NONE,1.1 SurfAir.py,NONE,1.1 Test1.txt,1.1,NONE
Status: Alpha
Brought to you by:
ddcforge
|
From: <ddc...@us...> - 2004-01-01 23:41:23
|
Update of /cvsroot/gcblue/gcb_data/scenario
In directory sc8-pr-cvs1:/tmp/cvs-serv5934/scenario
Added Files:
FourOnFourAir.py SurfAir.py
Removed Files:
Test1.txt TestScenarioA.txt
Log Message:
--- NEW FILE: FourOnFourAir.py ---
# SM is ScenarioManager object
def CreateScenario(SM):
SM.CreateAlliance(1, 'Friendly')
SM.CreateAlliance(2, 'OPFOR')
SM.SetUserAlliance(1)
SM.SetScenarioDescription('A test scenario with 4 generic aircraft on each side')
SM.SetScenarioLoaded(1)
SM.SetScenarioName('Test Scenario A')
SM.SetDateTime(2004, 4, 15, 17, 0, 0)
unit = SM.GetDefaultUnit()
order = SM.GetDefaultOrder()
order.SetOrderName('Patrol')
unit.AddOrder(order)
nAir = 4
for n in range(0, nAir):
### Add Alliance 1 aircraft
unit = SM.GetDefaultUnit()
unit.className = 'Generic aircraft'
unitName = 'Tiger %d' % n
unit.unitName = unitName
unit.lat = 49.8 + 0.025*n
unit.lon = -4.5
unit.alt = 1500
unit.heading = 270
unit.speed = 0.7
SM.AddUnitToAlliance(unit, 1)
### Add Alliance 2 aircraft
unit = SM.GetDefaultUnit()
order = SM.GetDefaultOrder()
order.SetOrderName('Patrol')
unit.AddOrder(order)
unit.className = 'Generic aircraft'
unitName = 'Bear %d' % n
unit.unitName = unitName
unit.lat = 50 + 0.08*n
unit.lon = -5.5 + 0.025*n
unit.alt = 1500
unit.heading = 90
unit.speed = 0.7
SM.AddUnitToAlliance(unit, 2)
# add goals
AddGoals(SM)
def AddGoals(SM):
# alliance 1 goals
goal_1a = SM.DestroyGoal('Bear 1')
goal_1b = SM.DestroyGoal('Bear 2')
goal_1 = SM.CompoundGoal(0) # 0 - AND, 1 - OR
goal_1.AddGoal(goal_1a)
goal_1.AddGoal(goal_1b)
SM.SetAllianceGoal(1, goal_1)
# alliance 2 goals
goal_2 = SM.DestroyGoal('Tiger 1')
SM.SetAllianceGoal(2, goal_2)
# BM is BriefingManager (same as ScenarioManager for now) object
def CreateBriefing(BM):
BM.SetEventTime(0)
BM.Pause()
BM.PauseAudio()
BM.SetBriefingMode(1) # 0 - normal tactical display, 1 - briefing disp
BM.Set3DMode(0) # 0 - off, 1 - small, 2 - med, 3 - full screen
BM.ConsoleText('Test of the briefing system follows...')
BM.SetEventTime(4)
BM.ConsoleText('') # a blank line
BM.ConsoleText('Destroy the aircraft to the Northwest')
BM.ConsoleText('Protect Tiger 1')
BM.ConsoleText('')
BM.ConsoleText('Zooming map...')
BM.SetEventTime(7)
BM.ChangeMapView(-5.5, 50.1, 4.0) # (lon, lat, lon span) in degrees
BM.SetEventTime(8)
BM.ConsoleText('')
BM.ConsoleText('Text can be displayed on the map like this')
BM.SetEventTime(9)
# text, lon, lat, duration in seconds, 0 - no effect, 1 - blend effect
BM.MapText('Here is where the enemy is', -5.5, 50.1, 12, 1)
BM.SetEventTime(10)
BM.MapText('These are your forces', -4.5, 49.8, 10, 1)
BM.SetEventTime(12)
BM.HookPlatform('Tiger 1')
BM.ConsoleText('3D camera moves can be scripted')
BM.SetEventTime(16)
BM.Set3DMode(2) # large 3D, console still visible
# unit, duration, az1, az2, el1, el2, range1, range2
BM.ConsoleText('')
BM.ConsoleText('This is a slow rotation view');
BM.FlybyCamera('Tiger 1', 10.0, 120, 180, 5, 5, 55, 50)
# text, duration, x, y, font size, effect
BM.Text3D('Tiger 1', 10.0, 0.5, 0.5, 32.0, 1)
BM.SetEventTime(27)
BM.ConsoleText('')
BM.ConsoleText('This is a zoom out');
BM.FlybyCamera('Tiger 1', 10.0, 180, 180, 5, 5, 50, 200)
BM.SetEventTime(37)
BM.Set3DMode(1)
BM.ConsoleText('')
BM.ConsoleText('On to the mission, Good hunting.')
BM.SetEventTime(40)
BM.Set3DMode(1)
BM.SetBriefingMode(0) # leave briefing mode
BM.PlayAudio('tension1',0) # name, seek time from beginning of song
BM.Resume() # resumes game
--- NEW FILE: SurfAir.py ---
# SM is ScenarioManager object
def CreateScenario(SM):
SM.CreateAlliance(1, 'Friendly')
SM.CreateAlliance(2, 'OPFOR')
SM.SetUserAlliance(1)
SM.SetScenarioDescription('Test scenario, surface and air on each side')
SM.SetScenarioLoaded(1)
SM.SetScenarioName('SurfAir')
SM.SetDateTime(2004, 4, 15, 17, 0, 0)
unit = SM.GetDefaultUnit()
order = SM.GetDefaultOrder()
order.SetOrderName('Patrol')
unit.AddOrder(order)
### Alliance 2 (enemy) units
unit.className = 'Mig25'
unit.unitName = 'Bear 72'
unit.SetPosition(-5.5, 49.9, 1500) # lon, lat, alt
unit.heading = 90
unit.speed = 0.7
SM.AddUnitToAlliance(unit, 2)
unit.className = 'Mig25'
unit.unitName = 'Bear 73'
unit.SetPosition(-5.5, 49.85, 1500) # lon, lat, alt
unit.heading = 90
unit.speed = 0.7
SM.AddUnitToAlliance(unit, 2)
unit.className = 'Destroyer'
unit.unitName = 'Plate 12'
unit.SetPosition(-5.6, 49.9, 0)
unit.heading = 95
unit.speed = 1.0
SM.AddUnitToAlliance(unit, 2)
### Alliance 1 units (friendly)
unit.ClearOrders()
unit.className = 'Mig25'
unit.unitName = 'Laser 1'
unit.SetPosition(-4.4, 49.8, 1500)
unit.heading = 270
unit.speed = 0.7
SM.AddUnitToAlliance(unit, 1)
unit.className = 'Harrier GR3a'
unit.unitName = 'Striker 1'
unit.SetPosition(-4.25, 49.7, 1200)
unit.heading = 340
unit.speed = 0.5
SM.AddUnitToAlliance(unit, 1)
unit.className = 'Cruiser'
unit.unitName = 'Grizzly 1'
unit.SetPosition(-4.3, 49.7, 0)
unit.heading = 260
unit.speed = 1.0
SM.AddUnitToAlliance(unit, 1)
AddGoals(SM)
def AddGoals(SM):
# alliance 1 goals
goal_1a = SM.DestroyGoal('Plate 12')
goal_1b = SM.DestroyGoal('Bear 72')
goal_1 = SM.CompoundGoal(0) # 0 - AND, 1 - OR
goal_1.AddGoal(goal_1a)
goal_1.AddGoal(goal_1b)
SM.SetAllianceGoal(1, goal_1)
# alliance 2 goals
goal_2 = SM.DestroyGoal('Laser 1')
SM.SetAllianceGoal(2, goal_2)
# BM is BriefingManager (same as ScenarioManager for now) object
def CreateBriefing(BM):
BM.SetEventTime(0)
BM.Pause()
BM.PauseAudio()
BM.SetBriefingMode(1) # 0 - normal tactical display, 1 - briefing disp
BM.Set3DMode(0) # 0 - off, 1 - small, 2 - med, 3 - full screen
BM.ConsoleText('Briefing follows...')
BM.SetEventTime(4)
BM.ConsoleText('') # a blank line
BM.ConsoleText('Destroy the forces to the Northwest')
BM.ConsoleText('Protect your forces')
BM.ConsoleText('')
BM.SetEventTime(7)
BM.ChangeMapView(-5.5, 50.1, 4.0) # (lon, lat, lon span) in degrees
BM.SetEventTime(8)
BM.ConsoleText('')
BM.ConsoleText('Enemy consists of one Destroyer and two Mig25s')
BM.SetEventTime(9)
# text, lon, lat, duration in seconds, 0 - no effect, 1 - blend effect
BM.MapText('Approx location of OPFOR', -5.5, 49.9, 12, 1)
BM.SetEventTime(12)
BM.Set3DMode(2) # large 3D, console still visible
# unit, duration, az1, az2, el1, el2, range1, range2
BM.ConsoleText('')
BM.ConsoleText('Your cruiser is armed with SAMs and SSMs');
BM.TrackCamera('Grizzly 1', 10.0, 100.0, -100.0, 1500.0, -50.0, 150.0, 100.0)
BM.Text3D('CRUISER', 10.0, 0.7, 0.5, 24.0, 1)
BM.SetEventTime(22)
BM.ConsoleText('')
BM.ConsoleText('Use your Mig to defeat the enemy fighters')
BM.ConsoleText('The 4 key will active afterburners')
BM.FlybyCamera('Laser 1', 4.0, 80, 120, 15, 5, 50, 65)
BM.Text3D('MIG25', 4.0, 0.7, 0.5, 24.0, 1)
BM.SetEventTime(26)
BM.ConsoleText('')
BM.ConsoleText('Your Harrier provides strike support to take out the destroyer.')
BM.FlybyCamera('Striker 1', 5.0, 80, 120, 15, 5, 50, 65)
BM.Text3D('HARRIER', 5.0, 0.7, 0.5, 24.0, 1)
BM.SetEventTime(31)
BM.Set3DMode(1)
BM.ConsoleText('')
BM.ConsoleText('On to the mission, Good hunting.')
BM.SetEventTime(34)
BM.Set3DMode(1)
BM.SetBriefingMode(0) # leave briefing mode
BM.PlayAudio('tension1',0) # name, seek time from beginning of song
BM.Resume() # resumes game
--- Test1.txt DELETED ---
--- TestScenarioA.txt DELETED ---
|