Modding Custom Campaign: Difference between revisions
Knightlord07 (talk | contribs) No edit summary |
Knightlord07 (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
This is an tutorial how to make your own custom campaign & how does this work (This page | This is an tutorial how to make your own custom campaign & how does this work (This page Semi WIP) | ||
Please note if you are using on Android Phone, this is for Linux, Mac & PC only to make/editing campaign only | |||
== Introduction == | == Introduction == | ||
This is | 1.Editing your custom campaign JSM file | ||
This one is fairly easy to make, if you enter COW’s Map editor & go to the editing campaign tab. | |||
Once you add your maps in, click on the save tab & put it somewhere in your map folder. | |||
Once that done it will make a JSM file for it inside the folder you put in e.g maps folder. | |||
You need a program that runs JSM files such as MS Visual Studio Code, Notepad++ or any JS programs to save your current progress. | |||
2.Editing your script | |||
Same as 1. But this one is making JS files, same as making an editing campaign but this one is making in-game script stuff. | |||
3.Custom Musics | |||
If you want to add in Custom Music during in-game or campaign select screen you can. | |||
You need to go into your script nor custom campaign file to add in the custom music “This will make your campaign look fancy\cool to have custom music playing on the background” | |||
E.g "maps/yourcampaignfolderhere/yourmusichere/musichere.mp3" | |||
Same applied with script as well. | |||
4.Custom NPCs | |||
Custom NPCs only apply to dialogue stuff only, same with DOR/DC npcs as well. | |||
If you made custom npcs in your mod you have to manually edit your script to appear in your custom campaign level. | |||
5.Secret Reward/COs | |||
The Secret reward & COs are a special reward idea if you want to make your campaign add in a bit of treasure hunting to find neither rewards nor levels. | |||
COs are the same but you add them in the JSM file (Custom campaign), but you can act as rewards as well. (Also increase replayability for it) | |||
== Beginner Guide == | |||
Welcome to this beginner guide of making your own custom campaign for Commander Wars. | |||
So you really want to create a custom campaign? | |||
This guide will help you make one for the beginner custom campaign creator. | |||
First thing is create your own maps, once that done save it somewhere in the map folder (Or a custom campaign folder you made) | |||
Second is the folder name can be like this example.camp, the .camp will be invisible when you going to select in skirmish map battles (New game), | |||
but you can access that folder via map editor & campaign editor. | |||
Third thing is put your map in order so you can remember which map level that suppose to be in order, numbers should be ok for it | |||
Once you settle making your custom campaign make sure you save your current custom campaign progress either you can resume it or complete the custom campaign. | |||
In the campaign editor you can add in your maps in by pressing the add maps in (NOTE: you need to direct your map folder to your campaign folder so it’s easier to find & add your map in) | |||
Once you done adding in your maps in you can play around the campaign editing option (NOTE: you can do that but there is an easier way to make your campaign) | |||
== Advance Guide == | |||
Welcome to the advance guide on Custom Campaign for COW | |||
This one is making your level more interesting & adding some playable cos at the select screen. | |||
First thing is to go & find your custom campaign (it’s should be JSM file) right click it (NOTE: If you have notepad++ there is a an option to open notepad ++, if you don’t have notepad++ then your only option is Visual Studio Code just drag the JSM file on VSC screen it’s should pop your stuff in) | |||
For campaign editing you can check on other people’s custom campaigns nor check on the original Advance Wars 1-2 campaign via Github. | |||
The next thing about editing your JSM file you can create some interesting stuff such as playable cos, map orders & ects. | |||
The map order can be any if you want, you can use the default AW 1-2 campaign or create something new or custom you want to be. | |||
Now that should be done in order next is adding playable cos in the select screen. | |||
In order to do that you need this code “this.getSelectableCOs = function(campaign, map, player, coIndex)” that allow you to freely select a cos in the co selection screen before enter your level (NOTE: You cannot select your cos if your level have immediateStart enable), after you install that code you need to put another code in | |||
var variables = campaign.getVariables(); | |||
if (map.getMapName() === "Your level name here”) | |||
{ | |||
Return [“CO_NAMEHERE!”] | |||
} | |||
That will allow to show that co in the select screen itself when you going to select | |||
== Extra Guide == | |||
This is just extra stuff if you want to have extra playable co that is locked behind a certain level or rewards? | |||
This guide teach you the ways of secret rewards, level & cos | |||
For the cos if the player win the secret level they will be rewarded a certain co something like this | |||
if (map.getMapName() === "LEVELNAME") | |||
{ | |||
var variables = campaign.getVariables(); | |||
var NAMEWon = variables.createVariable("LEVELNAME"); | |||
if (LEVELWon.readDataBool() === true) | |||
{ | |||
return ["CO_NAMEHERE"]; | |||
} | |||
else | |||
{ | |||
return ["CO_NAMEHERE"]; | |||
} | |||
} | |||
You can see the bottom one show you that you only get the co you get during the campaign, if you manage to beat a secret level you gain the secret playable co as playable option during the campaign | |||
If you want a level locked behind a certain counter you can | |||
var NAMECounter = variables.createVariable("NAMECounter"); //Checking for beatable secret levels to access this true ending | |||
if (NAMECounter.readDataInt32() >= NUMBER && | |||
"This will acted like the one in Advance Wars 1 campaign" | |||
That will unlock extra bonus level content in your campaign. | |||
== Editing Campaign == | == Editing Campaign == | ||
Latest revision as of 16:21, 1 October 2026
This is an tutorial how to make your own custom campaign & how does this work (This page Semi WIP)
Please note if you are using on Android Phone, this is for Linux, Mac & PC only to make/editing campaign only
Introduction
1.Editing your custom campaign JSM file
This one is fairly easy to make, if you enter COW’s Map editor & go to the editing campaign tab.
Once you add your maps in, click on the save tab & put it somewhere in your map folder.
Once that done it will make a JSM file for it inside the folder you put in e.g maps folder.
You need a program that runs JSM files such as MS Visual Studio Code, Notepad++ or any JS programs to save your current progress.
2.Editing your script
Same as 1. But this one is making JS files, same as making an editing campaign but this one is making in-game script stuff.
3.Custom Musics
If you want to add in Custom Music during in-game or campaign select screen you can.
You need to go into your script nor custom campaign file to add in the custom music “This will make your campaign look fancy\cool to have custom music playing on the background”
E.g "maps/yourcampaignfolderhere/yourmusichere/musichere.mp3"
Same applied with script as well.
4.Custom NPCs
Custom NPCs only apply to dialogue stuff only, same with DOR/DC npcs as well.
If you made custom npcs in your mod you have to manually edit your script to appear in your custom campaign level.
5.Secret Reward/COs
The Secret reward & COs are a special reward idea if you want to make your campaign add in a bit of treasure hunting to find neither rewards nor levels.
COs are the same but you add them in the JSM file (Custom campaign), but you can act as rewards as well. (Also increase replayability for it)
Beginner Guide
Welcome to this beginner guide of making your own custom campaign for Commander Wars.
So you really want to create a custom campaign?
This guide will help you make one for the beginner custom campaign creator.
First thing is create your own maps, once that done save it somewhere in the map folder (Or a custom campaign folder you made)
Second is the folder name can be like this example.camp, the .camp will be invisible when you going to select in skirmish map battles (New game),
but you can access that folder via map editor & campaign editor.
Third thing is put your map in order so you can remember which map level that suppose to be in order, numbers should be ok for it
Once you settle making your custom campaign make sure you save your current custom campaign progress either you can resume it or complete the custom campaign.
In the campaign editor you can add in your maps in by pressing the add maps in (NOTE: you need to direct your map folder to your campaign folder so it’s easier to find & add your map in)
Once you done adding in your maps in you can play around the campaign editing option (NOTE: you can do that but there is an easier way to make your campaign)
Advance Guide
Welcome to the advance guide on Custom Campaign for COW
This one is making your level more interesting & adding some playable cos at the select screen.
First thing is to go & find your custom campaign (it’s should be JSM file) right click it (NOTE: If you have notepad++ there is a an option to open notepad ++, if you don’t have notepad++ then your only option is Visual Studio Code just drag the JSM file on VSC screen it’s should pop your stuff in)
For campaign editing you can check on other people’s custom campaigns nor check on the original Advance Wars 1-2 campaign via Github.
The next thing about editing your JSM file you can create some interesting stuff such as playable cos, map orders & ects.
The map order can be any if you want, you can use the default AW 1-2 campaign or create something new or custom you want to be.
Now that should be done in order next is adding playable cos in the select screen.
In order to do that you need this code “this.getSelectableCOs = function(campaign, map, player, coIndex)” that allow you to freely select a cos in the co selection screen before enter your level (NOTE: You cannot select your cos if your level have immediateStart enable), after you install that code you need to put another code in
var variables = campaign.getVariables();
if (map.getMapName() === "Your level name here”)
{
Return [“CO_NAMEHERE!”]
}
That will allow to show that co in the select screen itself when you going to select
Extra Guide
This is just extra stuff if you want to have extra playable co that is locked behind a certain level or rewards?
This guide teach you the ways of secret rewards, level & cos
For the cos if the player win the secret level they will be rewarded a certain co something like this
if (map.getMapName() === "LEVELNAME")
{
var variables = campaign.getVariables();
var NAMEWon = variables.createVariable("LEVELNAME");
if (LEVELWon.readDataBool() === true)
{
return ["CO_NAMEHERE"];
}
else
{
return ["CO_NAMEHERE"];
}
}
You can see the bottom one show you that you only get the co you get during the campaign, if you manage to beat a secret level you gain the secret playable co as playable option during the campaign
If you want a level locked behind a certain counter you can
var NAMECounter = variables.createVariable("NAMECounter"); //Checking for beatable secret levels to access this true ending
if (NAMECounter.readDataInt32() >= NUMBER &&
"This will acted like the one in Advance Wars 1 campaign"
That will unlock extra bonus level content in your campaign.
Editing Campaign
You can edit your own campaign in map editor via by menu & editing campaign tab, during the in-game editing campaign you can add in maps, enable & disable maps, variables, remove any maps (Unless you made a mistake that is) & last map that will mark as the end of the campaign itself.
This is file under .JSM
var Constructor = function() { // campaign
this.getCampaignName = function() { //campaignName
return qsTr(""); //This is your campaign name
}; //campaignName
this.getAuthor = function() { // campaignAuthor
return qsTr("Your Name"); // this is Your name
}; // campaignAuthor
this.getDescription = function() { // campaignDescription
return qsTr(""); //This is the description
}; // campaignDescription
this.getCurrentCampaignMaps = function(campaign) { // campaignMaps
var variables = campaign.getVariables();
var ret = ["maps/"]; // campaignMapsFolder that is targeting whatever folder you targeting
return ret;
}; // campaignMaps
this.mapFinished = function(campaign, map, result) { // campaignMapFinished This is where your campaign ended
var variables = campaign.getVariables();
var mapVar = variables.createVariable(map.getMapName());
mapVar.writeDataBool(result);
}; // campaignMapFinished
this.getCampaignFinished = function(campaign){ // campaignFinished
var variables = campaign.getVariables();
var wonCounter = 0;
return false;
} // campaignFinished
// campaign
};
Constructor.prototype = BASECAMPAIGN;
var campaignScript = new Constructor();World Map
This is under WIP
Custom Music
This is an interesting/special feature if you want to make your campaign look unique or special.
this.changeMusic = function(music)
{
audio.clearPlayList();
audio.addMusic(music);
audio.playMusic(0);
};
this.changeMusic("maps/your map name/your music/music name.mp3"); // temporary
/*
if
{
this.changeMusic("maps/your map name/your music/music name.mp3");
}
*/
//This allow you to hover your mouse into that campaign tab before click it
campaignScript.changeMusic("maps/your map name/your music/music name.mp3"); // temporary
//This allow you to use this music during in-game campaign level select
If you want to change music at certain level you can do that code is under this word here
var victoryCountVar = variables.createVariable("Victory Count");
var victoryCount = victoryCountVar.readDataInt32();
if (victoryCount >= 2)
{
campaignScript.changeMusic("maps/YOUR NAME.camp/YOUR MUSIC FOLDER/YOUR MUSIC.mp3");
}
else if (victoryCount >= 1)
{
campaignScript.changeMusic("maps/YOUR NAME.camp/YOUR MUSIC FOLDER/YOUR MUSIC.mp3");
}
else
{
campaignScript.changeMusic("maps/YOUR NAME.camp/YOUR MUSIC FOLDER/YOUR MUSIC.mp3");
}
This code only for this.getCurrentCampaignMaps = function(campaign)
And this is the last piece of code to change the music around
this.mapFinished = function(campaign, map, result)
{
var variables = campaign.getVariables();
var mapVar = variables.createVariable(map.getMapName());
mapVar.writeDataBool(result);
if (result)
{
mapVar.writeDataBool(true);
//Checking what mission you are playing on & it will detect once you clear the certain level the music will change & put +1 on victory count
switch (map.getMapName())
{
// Main missions
case "MAPNAME HERE":
// Secret missions
case "MAPNAME HERE":
var victoryCountVar = variables.createVariable("Victory Count");
victoryCountVar.writeDataInt32(victoryCountVar.readDataInt32() + 1);
break;
}
}
};