Need some Script help? DFLion
//$reference Campaign.dll
//-$debug
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
using System.Diagnostics; // for Stopwatch timer
public class Mission : maddox.game.campaign.Mission {
public override void OnBattleStarted() {
base.OnBattleStarted();
}
public override void OnTrigger(int missionNumber, string shortName, bool active) {
if ("trigger01".Equals(shortName) && active) {
AiAction action = GamePlay.gpGetAction(ActorName.Full(missionNumber, "KG1_Ju88_01"));
if (action != null)
action.Do();
action = GamePlay.gpGetAction(ActorName.Full(missionNumber, "KG1_Ju88_02"));
if(action != null)
action.Do();
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}
public override bool IsMissionListener(int missionNumber) {
return true;
}
private void checkLanded(AiAircraft aircraft) {
if (GamePlay.gpPlayer().Place() != aircraft)
return;
GamePlay.gpHUDLogCenter("Press Esc to end mission.");
}
public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft) {
checkLanded(aircraft);
}
public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft) {
checkLanded(aircraft);
}
}
Thanks again Ataros and Blackdog kt, don't get me wrong, I think the scripting has got a lot of future potential for the Sim.
After hours and hours creating the campaign, you are confronted with the scripting to make everything work? (Sigh) with no official information. (I think what we are doing now is creating this official information - trial and error)
I created the above generic (for all missions) scripting for my 'KG1.III Ju88 Campaign'. Sometimes it works, sometimes it doesn't?
Here is each mission with its objective - help?
1. 26th Jun 1940 'Montdidier' -training mission
2. 27th Jun 1940 'Transfer to Rosieres-en-Santerre' - positioning/training flight
3. 2nd Jul 1940 'Caen-Carpiquet' - positioning flight
4. 2nd Jul 1940 'Minelaying' - night first combat mission
5. 3rd Jul 1940 'Ford' - night pattern bombing mission
6. 13th Jul 1940 'We bomb Portsmouth' - day pattern bombing mission
7. 25th Jul 1940 'Convoy Attack' - day dive bombing mission
8. 28th Jul 1940 'The Thames Estuary' - day pattern bombing mission
9. 4th Aug 1940 'Uphavon' -night pattern bombing mission
10. 12th Aug 1940 'Ventor' - day dive bombing mission
11. 30th Aug 1940 'We bomb Biggin Hill' day pattern bombing mission
12. 7th Sep 1940 'The London Docks' day pattern bombing mission
With the above info, I need some brilliant scripter to create a script for each mission, with success and failure scripts. The Ju88 unit flying in the Campaign is the Stab Staffel of KG1.III. Later on, after 'the learning curve' I can put some more interesting triggers in each campaign mission.
All these missions are based on actual combat reports from various Ju88 units - semi-historical. I have really enjoyed flying the Ju88 in the campaign, it certainly was one of Germany's best aicraft in WWII. I have produced a pilot's notes to help everybody get 'up and running' in the campaign.
DFLion
Last edited by dflion; 09-29-2011 at 12:11 PM.
|