Custom Mission

From WiCWiki

Jump to: navigation, search

Contents

Should I do a Custom Mission or a MOD?

When you are done with your scripted single player mission and you want to release it to the rest of the world there are two ways you can do it. You must pack it either as a custom mission or as a MOD. The big difference between ‘custom missions’ and ‘MOD’ when it comes to Single Player is if you want to make one mission or a campaign. If you just want to make a single mission you should use ‘custom mission’ and if you want to do a whole campaign you should do a ‘MOD’. We will show you how to do both ways, but first we have to name the map.

Give the map a name and description.

The maps name and description are in the maps mapname.juice file inside the myMissionStats curly brackets. We can give the map different names and descriptions in multiplayer and single player.

For this tutorial we will change the name and description in the europeTest.juice file that are located at:

Wic_mod\maps\europeTest\europeTest.juice. If you open this file in the ‘JuiceMaker’ tool you will find myMissionStats under myWicedMap->myMissionStats.

myMissionStats
{
    myName do_Ruins
    mySPName "Script tutorial"
    myMapListName do_Ruins
    myDescription "Where a proud medieval castle once stood overlooking the ocean, NATO and Soviet forces now trade the first blows of World War III."
    mySPDescription "Where a proud medieval castle once stood overlooking the ocean, we have created the tutorial map."

myName The maps name in multiplayer.
myName do_Ruins

mySpName The maps name in the single player campaign and custom mission list. This name will be shown in the game, in Single Player, if you click the ‘Custom Mission’ button. All found custom missions will be listed here.
mySPName "Script tutorial"

mMapListName The maps name in the multiplayer map list.
myMapListName do_Ruins

myDescription The myDescription contains the description of the map in multiplayer.
myDescription "Where a proud medieval castle once stood overlooking the ocean, NATO and Soviet forces now trade the first blows of World War III."

mySPDescription

The variable mySPDescription contains the mission information/briefing of the map in single player and custom mission.
mySPDescription "Where a proud medieval castle once stood overlooking the ocean, we have created the tutorial map."

Create a Custom Mission.

To create a custom mission you need to compile all the files that you use in the mission to an *.sdf file. For our custom mission that means all files in the europeTest folder and some AI files that are in the commanderai folder.

There is two ways we can create sdf files, through WICEd or the WinSDF application, we will cover both ways. We start with the WinSDF way.


Create an sdf file with WinSDF.

The WinSDF tool comes with the mod kit. You will probably find it where you have WICEd and the mod kit installed.


The advantage of using WinSDF is that you will get full control over which files that you add to the sdf. WinSDF can also be use to edit an existing sdf file.


So let’s start the WinSDF application.


Image:Custom_Mission_001.jpg


The first thing we need to do is to click on the ‘Add files’ button and navigate to the wic\maps\europeTest folder. For some strange reason we can’t add a folder with all of its subfolders in one click, we have to look through each and every folder. (If you guys complain loud enough maybe they will fix it, hint-hint-nudge-nudge-you know what I mean!)


So we start by open the deploymentareamasks folder in your europeTest folder and select all the files and press open.


Image:Custom_Mission_002.jpg


That will add all the selected files to the sdf and it should look something like this.


Image:Custom_Mission_003.jpg


Look through the rest of the folders in the europeTest folder and add all files. With all files we mean all files, even the files in the europeTest root folder. (Ok, not all files, you can skip the *.juice files if they are compiled and the *.py files if there are *.pyo version of them).


Because we use the AI we also have to add the AI ice files that are located here:

wic\commanderai\singleplayerais\europeTest.

You probably will have 2 versions of the AI files, one Russian and one NATO and don’t forget to add all of them, including *.loc, *.hash etc.


When we have added all the files that are needed in the tutorial map we need to save it to an sdf file. Press the ‘Save SDF’ button and choose where you want to save it. Its important to remember that the name of the sdf file has to be the same as the maps folder otherwise it won’t work at all. Therefore we will name the sdf file europeTest.sdf.


If you chose this way to pack it you can skip the next chapter about sdfs in WICEd and continue reading in the chapter ‘Start a custom mission’.


Create an sdf file with WICEd.

If we just want to create a custom mission it can be handy to use WICEd to pack the map to an sdf file. We still have to use WinSDF to add some files like the AI files.


The first thing we have to do is to open the map, europeTest, in WICEd. Open the Compile Map window by clicking on the File Button in the menu bar and then click on Compile Map.


Image:Custom_Mission_004.jpg


When the window appears just click on the “Compile to SDF” button and it will start to compile the map. It may take a while to compile the map to an sdf file.


Image:Custom_Mission_005.jpg


When it’s done the sdf file will get the same name as the map, europeTest.sdf, and it will be in this location:

Documents and Settings\userName\My Documents\World in Conflict\Downloaded\maps


Image:Custom_Mission_006.jpg


But we aren’t done yet; because we can’t add the AI files from WICEd and we use AI in the europeTest map so, we must add them to the sdf file with the WinSDF tool.


To be able to add files with the WinSDF tool we need to move the sdf file to the root of our wic root folder and add the AI files to the sdf.


The AI files are located here:

wic\commanderai\singleplayerais\europeTest


Start a custom mission

Now that we have an sdf file that contains all the files that we need, we must place the whole packed sdf file it in the custom Maps folder that are located here:

Documents and Settings\userName\My Documents\World in Conflict\Custom Maps\


Image:Custom_Mission_007.jpg


When we have put the sdf file in the custom maps folder we can start WIC and our mission should be visible in the custom mission list, as in the image below.


Image:Custom_Mission_008.jpg


Now it’s just to select the mission and click on the “PLAY MISSION” button to test it.


Create a MOD.

To be able to play single player maps in a MOD we need to add a campaign juice file to the sdf file we made and the MOD itself needs a mod info file.


In the campaign juice file you add what missions the player can play and what order they should be in. You can also add information about possible medals and cutscenes.


The mod info file is for WiC to find the MOD and the MODs name to be able to list it in the list of MODs in the game.


The Campaign Juice file.

The campaign juice file controls in what order missions shall be played and where we want to show cutscenes if we have any. So the campaign file consists of mainly two things, Cutscenes and Missions.

A Cutscene is a bik movie and a Mission is the scripted map like our europeTest map.

The campaign file is located in wic\campaign\.


Add a mission to the campaign.

To be able to play a map we have to add it in a mission block. In the mission block we can also add medals that the player can be given as a reward.


We will cover the important part of it here. If you want to know how to add medals or cutscenes, you will find a detailed description in the end of this chapter.


This is how our campaign juice for the tutorial should look like.

If you open it in the ‘Juice Maker’ tool you’ll find it under myCampaign->cmp1->myItems


The ‘Mission1-EuropeTest’ next to ‘Mission’ is the name of the mission block. This name won’t be seen by anyone else but you (and your mum perhaps) so it really doesn’t matter what you name it.


Mission Mission1-EuropeTest
{
    myFile maps/europeTest/europeTest.ice
    myMedalsForCompletion
    {      
        [Possible medals will be here]
    }
}


myFile

The file path to the maps ice files.


myMedalsForCompletion

The description of this block is in the end of this chapter.


When we have created our campaign file we need to add it to the europeTest.sdf file. You must add all the campaign, but the campaign.juice file is optional really. Just make sure the ice, loc and hash file is up to date.


Image:Custom_Mission_009.jpg

Create a Modinfo file

To be able to load a MOD, we have to have a modinfo.ice and modinfo.loc files otherwise WIC won’t find the mod. Both those files are created when we save the Mod Info juice file in the ‘Juice Maker’ tool. You can find the Mod Info juice file in your wic root folder (where you unpacked and installed everything) and you will find our Mod Info juice file, the one for the test map, in our tutorial file root folder.


This is how the Mod Info juice file looks like. Actually, this is everything that will be in the file.


INCLUDE juice/modinfo.fruit


ModInfo myModInfo
{
    myModName europeTest
    myLocModName "Script Tutorial MOD"
}


myModName

The myModName variable must be the same name as the sdf file i.e. europeTest if you use our test map.


myLocModName

The variable myLocModName contains the name of the MOD that will be shown in the in game list of MODs. This is just a string and its only purpose is to be shown in the list of MODs.


Place the MOD in the right folder

The mod info files and the sdf have to be placed in a folder with the same name as the sdf file in Documents and Settings\All Users\Documents\World in Conflict\Mods\. The mod info files shall NOT be in the sdf file!


So our europeTest.sdf file and the mod info files will be placed in:

Documents and Settings\All Users\Documents\World in Conflict\Mods\ europeTest\


Image:Custom_Mission_010.jpg


Load a MOD

Now that we have created the mod info files and placed them in the right folder we have to load the MOD in the game. To do that we click the options menu in the game and click on “SELECT MOD” then it will list all MODs that WIC can find.


Image:Custom_Mission_011.jpg


Our MOD is called “Script Tutorial MOD” (the name we gave it in the mod info file in myLocModName "Script Tutorial MOD" in a previous paragraph).

Select the MOD and press the “SELECT MOD” button, as this will load our MOD. Now you only have to start the single player campaign and it will load our tutorial map instead of the usual Single player campaign.


How you add medals and cutscenes to the Campaign Juice file

We decided to put this information here, in the end of the chapter, because this is not crucial for the MOD to work. We use both cutscenes and medals in the single player campaign but we decided to not add them in the test map.


Add a medal to the mission

In myMedalsForCompletion we can add medals so that we can award them to the player when achieving certain goals. A Medal can be given in two different ways, either through python script or through one of the automatic choices that can be set by variables.

Here is an example on a medal from the single player campaign that we will give the player through python.


The first thing we will do is to give the medal a name. This name is what you will use to call it from the python code later on. You write the name next to “Medal”, in this case primary1.


Medal primary1
{
    myName "National Defense Service Ribbon"
    myDescription "Awarded for honorable conduct during the retreat from Seattle."
    myImage ui/icons/campaign/medals/primary/campaign_primary1.dds
    myCanOnlyBeCompletedViaPythonFlag 1
    myRequiredScore 0.0
    myRequiredKillDeathRatio 0.0
    myRequiredScoreWithTA 0.0
    myRequiredMaximumReinforcementsUsed -1
    myRequiredMaxReinforcementLosses -1
    myRequiredMaxFriendlyReinforcementLosses -1
}

myName

The variable myName is the name of the medal shown ingame.


myDescription

In myDescription we can add a description of why the player was awarded with the medal. By default the variable is set to <empty>.


myImage

By default the variable myImage is set to <empty> and if we want an image of the medal we add the file path here. The file must be an *.dds and it works the same way as with images in the objectives browser and message boxes.


myCanOnlyBeCompletedViaPythonFlag

This variable control if the medal should be completed through python code or some other requirements. The other requirements are set in the forthcoming variables.

By default its set to 0 and that means it shall not be completed through python.

All medals that are given to the player in the single player campaign are given through python code.


myRequiredScore

This variable set what score the player has to reach to get the medal. The default value is 0.0 and means that it will be ignored. Only works if the myCanOnlyBeCompletedViaPythonFlag is set to 0.


myRequiredKillDeathRatio

The kill/death ration the player has to have to deserve the medal. The default value is 0.0 and means that it will be ignored. Only works if the myCanOnlyBeCompletedViaPythonFlag is set to 0.


myRequiredScoreWithTA

The myRequiredScoreWithTA variable is what score the player has to get by using TA to deserve the medal. The default value is 0.0 and means that it will be ignored. Only works if the myCanOnlyBeCompletedViaPythonFlag is set to 0.


myRequiredMaximumReinforcementsUsed

The myRequiredMaximumReinforcementsUsed variable is the maximum number of reinforcement point the player is allowed to spend if he want the medal.

The default value is 0 and means that if the myCanOnlyBeCompletedViaPythonFlag is set to 0 the player isn’t allowed getting any reinforcements. To ignore the myRequiredMaximumReinforcementsUsed the value has to be set to -1.


myRequiredMaxReinforcementLosses

This variable is deprecated and should be set to -1. The default value is 0.


myRequiredMaxFriendlyReinforcementLosses

This variable is deprecated and should be set to -1. The default value is 0.


Give the player a medal through python.

If myCanOnlyBeCompletedViaPythonFlag variable is set to 1 we have to use the CompleteMedal python function to reward the player with the medal.


CompleteMedal( aMedalToComplete )

-The parameter is a medal name we have defined in the campaign file.


So to reward the player with the primary1 medal we do like this:


CompleteMedal( 'primary1' )

Add a cutscene to the campaign

To show a cutscene between missions we need to add a Cutscene block where we define which bik movie to show. If the cutscene can have a subtitle we need to add it to the subtitle ice. We will explain the subtitle juice later in this chapter.

The cutscene will be skipped if the player clicks the escape button.

Cutscene Cinematic_Seattle
{
   myFile movies/cutscene_seattle.bik
   mySubtitleFile campaign/subtitles/intro_cinematic.ice
   myName Seattle
   myDescription <empty>
}


myFile It’s the file path to the cutscene to show. The file must be an *.bik and for more info about bik format check out http://www.radgametools.com/. mySubtitleFile The variable mySubtitleFile can contain a file path to a subtitle ice file. If we don’t want to have a subtitle we put in <empty> instead. myName. The cinematics name in the cinematic list. myDescription This variable is deprecated and should be set to empty.


Add subtitle to the cutscene

If the player has the option to have subtitles in a cutscene, we need to have a subtitle juice file that is linked from the cutscene block in the campaign jucie file. It contains the texts and timing of the subtitle. The player can turn of subtitles in the options menu under audio.


Image:Custom_Mission_012.jpg


This is how a MovieSubtitle block looks like.

MovieSubtitleList mySubtitles
{
    MovieSubtitle Sub1
    {
        myText "We're getting reports from the Coast Guard about a developing situation at the harbor front."
        myStartTime 3.5
        myVisibleTime 3.8
    } 


myText The variable myText is the subtitle text to show.


myStartTime

The myStartTime variable is the time that we want to start showing the subtitle text.


myVisibleTime

The myVisibleTime variable is how long time in seconds the text shall be visible.

Appendix.

We give the map a name and description to use in the single player campaign and custom mission.


Changed files in this chapter:

europeTest.juice


Changes in the europeTest.juice file.


If you open this file in the ‘JuiceMaker’ tool you will find myMissionStats under myWicedMap->myMissionStats.

myMissionStats
{
    myName do_Ruins
    mySPName "Script tutorial"
    myMapListName do_Ruins
    myDescription "Where a proud medieval castle once stood overlooking the ocean, NATO and Soviet forces now trade the first blows of World War III."
    mySPDescription "Where a proud medieval castle once stood overlooking the ocean, we have created the tutorial map."
Chapter 1: Before we start < > Chapter 3: Areas and Command Points
Personal tools
User Created Content