[Gcblue-commits] gcb_data/scenario AirfieldTest.py,NONE,1.1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-07-23 00:47:10
|
Update of /cvsroot/gcblue/gcb_data/scenario In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3609/scenarios Added Files: AirfieldTest.py Log Message: --- NEW FILE: AirfieldTest.py --- # SM is ScenarioManager object def CreateScenario(SM): SM.CreateAlliance(1, 'Friendly') SM.CreateAlliance(2, 'OPFOR') SM.SetUserAlliance(1) SM.SetScenarioDescription('Test scenario, airstrip vs. ragtag forces') SM.SetScenarioLoaded(1) SM.SetScenarioName('Airfield Test') SM.SetDateTime(2004, 6, 15, 16, 0, 0) unit = SM.GetDefaultUnit() order = SM.GetDefaultOrder() order.SetOrderName('Patrol') unit.AddOrder(order) ### Alliance 2 (enemy) units unit.className = 'Airstrip' unit.unitName = 'FT001' unit.SetPosition(-5.0, 50.5, 0) unit.heading = 90 unit.speed = 0.0 SM.AddUnitToAlliance(unit, 2) unit.className = 'Mig25' unit.unitName = 'Bear 72' unit.SetPosition(-5.5, 49.6, 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.7, 1500) # lon, lat, alt unit.heading = 90 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 2) unit.className = 'Mig25' unit.unitName = 'Bear 74' unit.SetPosition(-5.7, 49.4, 1500) # lon, lat, alt unit.heading = 90 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 2) unit.className = 'Mig25' unit.unitName = 'Bear 75' unit.SetPosition(-5.7, 49.5, 1500) # lon, lat, alt unit.heading = 90 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 2) unit.className = 'Cruiser' unit.unitName = 'Bigfish 1' unit.SetPosition(-5.6, 49.8, 0) unit.heading = 95 unit.speed = 1.0 SM.AddUnitToAlliance(unit, 2) unit.className = 'Destroyer' unit.unitName = 'Bigfish 2' unit.SetPosition(-5.6, 49.65, 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 = 'Patrol Boat' unit.unitName = 'Picket 1' unit.SetPosition(-4.25, 49.65, 0) unit.heading = 270 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 1) unit.className = 'Airstrip' unit.unitName = 'FT000' unit.SetPosition(-4.3, 50.5, 0) unit.heading = 270 unit.speed = 0.0 SM.AddUnitToAlliance(unit, 1) nAir = 7 for n in range(0, nAir): unitName = 'Hammer %d' % (n + 1) # AddUnitToFlightDeck(<carrier name>,<unit class>,<name>, <location>) # <location>: 1 = HANGAR, 2 = DECK, 3 = CATAPULT SM.AddUnitToFlightDeck('FT000','Harrier GR3a-STK',unitName, 3) SM.AddUnitToFlightDeck('FT000','AEW aircraft','Goose 1', 3) SM.AddUnitToFlightDeck('FT000','Mig25','Laser 2', 1) SM.AddUnitToFlightDeck('FT000','Mig25','Laser 3', 1) SM.AddUnitToFlightDeck('FT000','Mig25','Laser 4', 1) AddGoals(SM) def AddGoals(SM): # alliance 1 goals goal_1a = SM.DestroyGoal('Bigfish 1') goal_1b = SM.DestroyGoal('Bigfish 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('FT000') 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 West') 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 ragtag rebel forces') BM.ConsoleText('') BM.ConsoleText('Destroy at will.') BM.ConsoleText('The two enemy surface ships are your high priority targets') 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('You have command of airbase FT000 ') BM.ConsoleText(' to assist you in your mission') BM.ConsoleText('') BM.ConsoleText('Hit the "F" key after hooking your carrier to'); BM.ConsoleText(' raise the flight deck control panel'); BM.TrackCamera('FT000', 10.0, 100.0, -100.0, 1500.0, -50.0, 150.0, 100.0) BM.Text3D('FT000', 10.0, 0.5, 0.2, 24.0, 1) BM.SetEventTime(22) BM.Set3DMode(1) BM.ConsoleText('') BM.ConsoleText('On to the mission, Good hunting.') BM.SetEventTime(28) BM.Set3DMode(1) BM.SetBriefingMode(0) # leave briefing mode BM.PlayAudio('tension1',0) # name, seek time from beginning of song BM.Resume() # resumes game |