![]() |
#1
|
|||
|
|||
![]()
This is an attempt to collate some of the things I’ve found out in the course of building a campaign.
These are very much empirical findings and may change due to further knowledge/patches. If you know better/have new info PLEASE TELL US. Most of what I’ve learned is by ‘pulling apart’ the work of others, the built in RAF campaign is quite instructive in different methods (partic scripts). Dig around in the files, it might help get aquainted with how stuff works. For the purposes of explanation I’ve used my 501 sqn campaign to illustrate points. What is a campaign? At it’s simplest a campaign is a series of missions, but being a MG game it has its quirks as to how to do this. This link may be useful to understand the file structure. http://forum.1cpublishing.eu/showpos...74&postcount=3 This shows the edits needed in the main “campaigns.ini” file, in bold Notes-in red text [Main] campaign_gb campaign_de campaign_501 campaign name [campaign_gb] folder campaign_gb title Cliffs Of Dover image Poster.bmp [campaign_de] folder campaign_de title Adler Angriff image Poster.bmp [campaign_501] campaign name- same as [Main] folder campaign_501 folder your campaign is stored in title campaign_501 title of campaign- the campaign_ doesn’t appear in name image waiting.bmp campaign selection pic So, assuming you have your missions you need to create a folder in //….steamapps/…/parts/…/campaign/ folder and name it- in my case I used “campaign_501” All your mission files/briefings, scripts go in here. There are also 3 other files necessary to make/modify, a campaign.mis file, a campaign.ini file and a campaign briefing file. Campaign.mis This is really simple : Code:
[PARTS] core.100 bob.100 [MAIN] MAP Land$English_Channel_1940 BattleArea 150000 100000 100000 150000 1000 TIME 12 WeatherIndex 0 CloudsHeight 0 BreezeActivity 0 ThermalActivity 0 [splines] [CustomChiefs] [Stationary] [Buildings] [BuildingsLinks] Campaign.ini This is the file that orders how the missions are played. It appears to be just a list of mission names enclosed in “ ” quotes. Mine looks like this:- Code:
[Battles] "1" "2" "3" "4" "5" …….. "24" "25" At the moment I’m not sure how to do the ‘branching missions’ Campaign briefing Things start to get a little complicated here. This is the file that contains your campaign descriptions and links to any media used.(atm sound in briefings doesn’t appear to work so I am only mentioning pics). It’s another text file and can be split into parts, each with a specific purpose. [1] <Name> MainIntro <Description> July 25, 1940 You are a Sgt pilot with 501 Sqn,… // text shown in campaign selection screen- description of campaign. This text also appears on lhs having selected campaign (start screen). The main campaign selection pic is defined in the main “campaigns.ini” <Slide> Campaign.jpg pic which appears in campaign ‘start’ screen <Caption> 501 Sqn at Gravesend July - September 1940//your text underneath pic on rhs of ‘start’ screen. A general note- pics can be .bmp, .jpg, or .gif(animated doesn’t work)- those tested so far. Text can be as long or short as you want, scroll bar appears automatically if needed. So, now we have a ‘working’ campaign it’s probably a good point to look at the actual missions themselves… Briefings Personally I find it easier to edit the briefing files in notepad, rather than in fmb, -but use what works for you. The file is again split into sections by [] with numbers in each section. The ordering of the numbers doesn’t appear to matter. I find it useful to ‘template’ the briefing file (partic if using same pics in sections) and then fill in the text by copy/paste etc. Really up to you to arrange this how you want to fit the ‘style’ of your campaign. The [Intro] section appears at the ‘pre mission selection’ stage The [Regular] section appears having selected the misson I’ve usually used the [Mission] briefing to appear just before you fly (select this in fmb as players plane briefing in properties). Then there are the success and failure sections. So that’s 5 possible ways to impart information to the player Missions Not a lot to add here, Heinkill’s dummies guide covers most things http://simhq.com/forum/ubbthreads.ph...ml#Post3423371 I would like to point out that playing with the skill levels individually seems to help shape the combat. The most ‘important’ appears to be visibility- keep this at average and the AI will not ‘notice’ enemy E/A until they are in a (3D) radius of ~ 1km. This can be very relevant if there is a height difference between airgroups. Advanced flying is the other major one- keeping this below veteran level reduces the crazy barrel rolling. The rest are self explanatory, play around with levels for individual planes, partic in ‘target’ bomber groups? Scripting The bit I know very little about! It is also not strictly necessary- see campaign_de The bit that is trickier than IL2 is the mission success- we now have to use scripts to do this. For campaigns you have to use something like: - Code:
//$reference Campaign.dll using System; using System.Collections; using System.Collections.Generic; using maddox.game; using maddox.game.world; public class Mission : maddox.game.campaign.Mission { // your code here } This last bit is the bit that tells the game you’ve completed your mission- you just have to choose how this occurs!! I’ve used 3 basic methods: Success on landing(and crash landing) Success on spawn Success on passing through a ‘trigger’ Variations/combinations of these are of course possible(indeed the possibilities are huge-if you know what you are doing!!) Scripting also gives the opportunity to ‘pass messages’ to players at certain times in the mission. If nothing else the “GpHudLog” feature is extremely useful in testing to show when/if triggers are activated. There is also a “SayToGroup” method to play ‘speech’ to player. I can forsee this being quite used in the future.( triggered radar vectors perhaps?) Well, hope some of this helps, Happy building/flying. |
#2
|
|||
|
|||
![]()
There is a much better way of making campaigns. This method is far more powerful and flexible (and it won't get overwritten with every update). Here's a quick overview.
I. Be sure to have Visual Studio installed. II. Download this example campaign that naryv posted. As far as I know, this is exactly the code that is used for the stock campaigns. III. In the example campaign, open the Visual Studio solution at parts/tst/src/Campaign/TstCapaign.sln. Under "Solution Explorer" on the right, expand both "References" folders. Some of these will probably have errors. Right click on the "References" folder. Navigate to Steam/steamapps/common/il-2 sturmovik cliffs of dover/parts/core and add the references that are showing errors. IV. Now, we will modify the code to work with our campaign. First, change the namespace at the top of both TstCampaign.cs and TstMission.cs to something like yourname.campaign. Next, go to lines 178 and 179 in TstCampaign.cs. Change USER_PATH and PATH to more appropriate values. USER_PATH is where the campaigns state files will be saved. make this something like "$user/mission/yourname/campaign/". PATH is where your campaigns.ini file will be placed. Make it something like "$home/parts/yourname/campaign/". V. Save all of the files you've modified and press F6. This will compile the code. Hopefully, you don't get errors. The compiled .dlls can be found in TstCampaign/parts/tst/src/Campaign/TstCampaign/bin/debug and TstCampaign/parts/tst/src/Campaign/TstCampaign/bin/debug. You will need to modify the script files for your missions to user your new .dlls. This is very simple. There is an example of this in naryv's campaign. VI. Open the xml file in TstCampaign/AddIns using Visual Studio. Change name="TstCampaign" to the name of your campaign. Change type="tst.campaign.Campaigns" to match your campaign. Using our previous example, we would make it type="yourname.campaign.Campaigns". Change path="$home/parts/tst/TstCampaign.dll" to the location where your newly compiled .dlls will be stored. Something like path="$home/parts/yourname/yourCampaign.dll". Be sure that the name of your .dll matches the name in your xml file. Change text="Tst Campaign" to the name you want your campaign to appear under in the main menu. VII. After saving the xml file, we now have everything we need. To install your campaign, all you have to do is copy your xml file into Steam/steamapps/common/il-2 sturmovik cliffs of dover/AddIns. Then, put the two .dll files you compiled into the appropriate directory in "parts". In our example, we would put them into parts/yourname. Now, take the campaigns.ini file and folder containing the missions and put them into the folder you specified in the TstCampaign code. In our example, this was parts/yourname/campaign/. After putting everything together, you should be able to start Cliffs of Dover and see your campaigns in the menu. That was a very brief overview of how to set up a basic campaign. There are many many more possibilities, but I don't have time to write a full guide |
![]() |
|
|