In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
- quot;"""Strings for m01.dat
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
description = "$8000",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
Edited on 2005-07-17 22:45:43 by 81.240.255.226
Additions:
My thoughts of how humiliating this was left my mind as I my eyes took in the marvel that was this cock in front of me Favorite Cremation Favored Cremation
Flagellation Pill Note: if you want to create a new campaign instead of overriding the Ascension campa
1000
ign, then, in order to play the campaign, you will have to change your Homeworld 2 shortcut so that it looks something like this:
- quot;...\Homeworld2\Bin\Release\Homeworld2.exe" -campaign <CampaignName> -startingLevel <FirstLevel>
Go to your "...\Homeworld2\Data" directory and create the following directories:
You can name these directories whatever you want. I recommend the "m""""" format or something similar. Relic used the following:
- quot;""LevelData""\Campaign\Ascension\m01_tanis"
- quot;""LevelData""\Campaign\Ascension\m02_hiigara"
- quot;""LevelData""\Campaign\Ascension\m15_homeworld"
- quot;""LevelData""\Campaign\Ascension\m01"
- quot;""LevelData""\Campaign\Ascension\m02"
In the "...\Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\""LevelData""\Campaign" directory create a new file called:
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
""--"" This is the name of our campaign. It is displayed to the left of the mission select screen.
- quot;"displayName"" = "Postmortem"
- quot;"--"" This creates the structure for the missions
- quot;"--"" The first mission's details
- quot;"--"" This tells the game to play the animatic prior to the game starting
- quot;"--"" postload = function ()
- quot;"--"" ""playAnimatic""("data:animatics/A00.lua",1,1);
- quot;"--"" end,
- quot;"--"" Informs the game where to get the mission information from
directory = "M01",
- quot;"--"" The name of the level to load
level = "M01.level",
- quot;"--"" Tells the game what to do when the mission is complete
if bWin ""
"" 1 then
- quot;"postLevelComplete""()
- quot;"--"" This is the title of the mission in the mission selection screen
- quot;"displayName"" = "Mission One",
- quot;
1000
"--"" This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
- quot;"postLevelComplete""()
quot;"displayName"" = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "
TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
- quot;M01.level"
- quot;M01.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
In "...\Ascension\m02\" we need:
- quot;M02.level"
- quot;M02.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function ""DetermChunk""()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("""
MotherShip""")
addToSOBGroup("Hgn_Mothership", """
MotherShip""")
end ""--"" End of deterministic function
function ""NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
In "m02.level" copy this:
1000
wColour(0, 0, 0, 1)
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
quot;"raceID"" = 1,
quot;"startPos"" = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = ""--"" The player number
{ ""--"" Team Colour (White)
{ ""--"" Stripe Colour (Black)
quot;"--"" Badge to display
quot;""DATA:badges""/kiith naabal.tga",
{ ""--"" Engine trail colour (I think. I haven't played with it)
quot;data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
""--"" Imports the library files
dofilepath("""Data:scripts""\\SCAR\\SCAR_Util.lua";)
quot;"--"" Sets the objectives
function ""
OnInit""()
- quot;"--"" Adds the Rule_Init
Rule_Add("Rule_Init")
- quot;"--"" ""OnInit"" isn't a rule so there is no need to remove it
- quot;"--"" Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
- quot;"--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""MotherShip""", """FighterProduction""")
- quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
- quot;"--"" Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
- quot;"--"" We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
- quot;"--"" Checks to see if the player has
1000
a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
setMissionComplete(1) is, as far as I can tell, the variable used in the
postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
""--"" The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
""--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""
MotherShip""", """
FighterProduction""")
quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = """PlayerStartPoint"""
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfi
1000
les.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
- quot;"""Strings for m01.dat
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
description = "$8000",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
Deletions:
How to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
Note: if you want to create a new campaign instead of overriding the Ascension campaign, then, in order to play the campaign, you will have to change your Homeworld 2 shortcut so that it looks something like this:
Go to your "...\
Homeworld2\Data" directory and create the following directories:
"LevelData"
"LevelData\Campaign"
"LevelData\Campaign\Ascension\"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
"LevelData\Campaign\Ascension\mNN"
You can name these directories whatever you want. I recommend the "m##" format or something similar. Relic used the following:
"LevelData\Campaign\Ascension\m01_tanis"
"LevelData\Campaign\Ascension\m02_hiigara"
"LevelData\Campaign\Ascension\m15_homeworld"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
In the "...\
Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\LevelData\Campaign" directory create a new file called:
"Ascension.Campaign"
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
-- This is the name of our campaign. It is displayed to the left of the mission select screen.
displayName = "Postmortem"
-- This creates the structure for the missions
-- The first mission's details
-- This tells the game to play the animatic prior to the game starting
-- postload = function ()
-- playAnimatic("data:animatics/A00.lua",1,1);
-- end,
-- Informs the game where to get the mission information from
directory = "M01",
-- The name of the level to load
level = "M01.level",
-- Tells the game what to do when the mission is complete
if bWin == 1 then
postLevelComplete()
-- This is the title of the mission in the mission selection screen
displayName = "Mission One",
-- This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
postLevelComplete()
displayName = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "
TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
"M01.level"
"M01.lua"
"Teamcolour.lua"
"Datafiles.lua"
In "...\Ascension\m02\" we need:
"M02.level"
"M02.lua"
"Teamcolour.lua"
"Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function DetermChunk()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("MotherShip")
addToSOBGroup("Hgn_Mothership", "MotherShip")
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
In "m02.level" copy this:
function DetermChunk()
-- Player Startpoint.
addPoint("PlayerStartPoint", {0, 0, 12300}, {0, 180, 0})
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
raceID = 1,
startPos = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = -- The player number
{ -- Team Colour (White)
{ -- Stripe Colour (Black)
-- Badge to display
"DATA:badges/kiith naabal.tga",
{ -- Engine trail colour (I think. I haven't played with it)
"data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
-- Imports the library files
dofilepath("Data:scripts\\SCAR\\SCAR_Util.lua")
function OnInit()
-- Adds the Rule_Init
Rule_Add("Rule_Init")
-- OnInit isn't a rule so there is no need to remove it
-- Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
-- Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
-- We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
-- Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
-- Updates the objective
setMissionComplete(1) is, as far as I can tell, the variable used in the postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
-- Updates the objective
-- The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = "PlayerStartPoint"
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
How to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
Go to your "...\
Homeworld2\Data" directory and create the following directories:
"LevelData"
"LevelData\Campaign"
"LevelData\Campaign\Ascension\"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
"LevelData\Campaign\Ascension\mNN"
You can name these directories whatever you want. I recommend the "m##" format or something similar. Relic used the following:
"LevelData\Campaign\Ascension\m01_tanis"
"LevelData\Campaign\Ascension\m02_hiigara"
"LevelData\Campaign\Ascension\m15_homeworld"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
In the "...\
Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\LevelData\Campaign" directory create a new file called:
"Ascension.Campaign"
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
-- This is the name of our campaign. It is displayed to the left of the mission select screen.
displayName = "Postmortem"
-- This creates the structure for the missions
-- The first mission's details
-- This tells the game to play the animatic prior to the game starting
-- postload = function ()
-- playAnimatic("data:animatics/A00.lua",1,1);
-- end,
-- Informs the game where to get the mission information from
directory = "M01",
-- The name of the level to load
level = "M01.level",
-- Tells the game what to do when the mission is complete
if bWin == 1 then
postLevelComplete()
-- This is the title of the mission in the mission selection screen
displayName = "Mission One",
-- This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
postLevelComplete()
displayName = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "
TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
"M01.level"
"M01.lua"
"Teamcolour.lua"
"Datafiles.lua"
In "...\Ascension\m02\" we need:
"M02.level"
"M02.lua"
"Teamcolour.lua"
"Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function DetermChunk()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("MotherShip")
addToSOBGroup("Hgn_Mothership", "MotherShip")
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
In "m02.level" copy this:
function DetermChunk()
-- Player Startpoint.
addPoint("PlayerStartPoint", {0, 0, 12300}, {0, 180, 0})
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
raceID = 1,
startPos = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = -- The player number
{ -- Team Colour (White)
{ -- Stripe Colour (Black)
-- Badge to display
"DATA:badges/kiith naabal.tga",
{ -- Engine trail colour (I think. I haven't played with it)
"data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
-- Imports the library files
dofilepath("Data:scripts\\SCAR\\SCAR_Util.lua")
function OnInit()
-- Adds the Rule_Init
Rule_Add("Rule_Init")
-- OnInit isn't a rule so there is no need to remove it
-- Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
-- Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
-- We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
-- Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
-- Updates the objective
setMissionComplete(1) is, as far as I can tell, the variable used in the postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
-- Updates the objective
-- The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = "PlayerStartPoint"
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
After straightening my apron, I took the glasses out to the hot tub Genital Herpes Image Genital Herpes Picture
Buy Marlboro Cigarette Purchase Marlboro Cigarette
Lorazepam 1mg Lorazepam 1mg
Spybot Search And Destry Spybot Seek And Destry
Thefacebook Domicile Thefacebook Dwelling
Occasion Auto Lotocar Occasion Auto Lotocar
Auction Barrett Motorcar Jackson Auction Barrett Machine Jackson
Wrecked Machine Wrecked Car
Gucci Knockoffs Gucci Knockoffs
Dom Lorazepam Dom Lorazepam
Estimator Recycling Reckoner Recycling
Effects Lorazepam Effects Lorazepam
Java Roulette Java Roulette
Nile Cruises Nile Cruises
Discount Cigarette Discount Cigarette
Medication Dictionary Medication Dictionary
100mg Demerol 100mg Demerol
Grand Thievery Auto San Andreas August Theft Auto San Andreas
Dude Wheres My Automobile Swell Wheres My Machine
Accounting Jobs Accounting Jobs
He crawled into the middle of the bed and turned out the lightHow to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
- quot;...\Homeworld2\Bin\Release\Homeworld2.exe" -campaign <CampaignName> -startingLevel <FirstLevel>
Go to your "...\Homeworld2\Data" directory and create the following directories:
You can name these directories whatever you want. I recommend the "m""""" format or something similar. Relic used the following:
- quot;""LevelData""\Campaign\Ascension\m01_tanis"
- quot;""LevelData""\Campaign\Ascension\m02_hiigara"
- quot;""LevelData""\Campaign\Ascension\m15_homeworld"
- quot;""LevelData""\Campaign\Ascension\m01"
- quot;""LevelData""\Campaign\Ascension\m02"
In the "...\Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\""LevelData""\Campaign" directory create a new file called:
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
""--"" This is the name of our campaign. It is displayed to the left of the mission select screen.
- quot;"displayName"" = "Postmortem"
- quot;"--"" This creates the structure for the missions
- quot;"--"" The first mission's details
- quot;"--"" This tells the game to play the animatic prior to the game starting
- quot;"--"" postload = function ()
- quot;"--"" ""playAnimatic""("data:animatics/A00.lua",1,1);
- quot;"--"" end,
- quot;"--"" Informs the game where to get the mission information from
directory = "M01",
- quot;"--"" The name of the level to load
level = "M01.level",
- quot;"--"" Tells the game what to do when the mission is complete
if bWin ""
"" 1 then
- quot;"postLevelComplete""()
- quot;"--"" This is the title of the mission in the mission selection screen
- quot;"displayName"" = "Mission One",
- quot;"--"" This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
- quot;"postLevelComplete""()
- quot;"displayName"" = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
- quot;M01.level"
- quot;M01.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
In "...\Ascension\m02\" we need:
- quot;M02.level"
- quot;M02.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function ""DetermChunk""()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("""
MotherShip""")
addToSOBGroup("Hgn_Mothership", """
MotherShip""")
end ""--"" End of deterministic function
function ""NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
In "m02.level" copy this:
function ""
DetermChunk""()
- quot;"--"" Player Startpoint.
addPoint("""PlayerStartPoint""", {0, 0, 12300}, {0, 180, 0})
end ""--"" End of deterministic function
function ""
NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
quot;"raceID"" = 1,
quot;"startPos"" = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = ""--"" The player number
{ ""--"" Team Colour (White)
{ ""--"" Stripe Colour (Black)
quot;"--"" Badge to display
quot;""DATA:badges""/kiith naabal.tga",
{ ""--"" Engine trail colour (I think. I haven't played with it)
quot;data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
""--"" Imports the library files
dofilepath("""Data:scripts""\\SCAR\\SCAR_Util.lua";)
quot;"--"" Sets the objectives
function ""
OnInit""()
- quot;"--"" Adds the Rule_Init
Rule_Add("Rule_Init")
- quot;"--"" ""OnInit"" isn't a rule so there is no need to remove it
- quot;"--"" Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
- quot;"--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""MotherShip""", """FighterProduction""")
- quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
- quot;"--"" Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
- quot;"--"" We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
- quot;"--"" Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
setMissionComplete(1) is, as far as I can tell, the variable used in the
postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
""--"" The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
""--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""
MotherShip""", """
FighterProduction""")
quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = """PlayerStartPoint"""
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
- quot;"""Strings for m01.dat
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
description = "$8000",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
Edited on 2005-07-16 23:06:47 by 211.138.91.21
Additions:
After straightening my apron, I took the glasses out to the hot tub Genital Herpes Image Genital Herpes Picture
Buy Marlboro Cigarette Purchase Marlboro Cigarette
Lorazepam 1mg Lorazepam 1mg
Spybot Search And Destry Spybot Seek And Destry
Thefacebook Domicile Thefacebook Dwelling
Occasion Auto Lotocar Occasion Auto Lotocar
Auction Barrett Motorcar Jackson Auction Barrett Machine Jackson
Wrecked Machine Wrecked Car
Gucci Knockoffs Gucci Knockoffs
Dom Lorazepam Dom Lorazepam
Estimator Recycling Reckoner Recycling
Effects Lorazepam Effects Lorazepam
Java Roulette Java Roulette
Nile Cruises Nile Cruises
Discount Cigarette Discount Cigarette
Medication Dictionary Medication Dictionary
100mg Demerol 100mg Demerol
Grand Thievery Auto San Andreas August Theft Auto San Andreas
Dude Wheres My Automobile Swell Wheres My Machine
Accounting Jobs Accounting Jobs
He crawled into the middle of the bed and turned out the lightHow to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
- quot;...\Homeworld2\Bin\Release\Homeworld2.exe" -campaign <CampaignName> -startingLevel <FirstLevel>
Go to your "...\Homeworld2\Data" directory and create the following directories:
You can name these directories whatever you want. I recommend the "m""""" format or something similar. Relic used the following:
- quot;""LevelData""\Campaign\Ascension\m01_tanis"
- quot;""LevelData""\Campaign\Ascension\m02_hiigara"
- quot;""LevelData""\Campaign\Ascension\m15_homeworld"
- quot;""LevelData""\Campaign\Ascension\m01"
- quot;""LevelData""\Campaign\Ascension\m02"
In the "...\Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\""LevelData""\Campaign" directory create a new file called:
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
""--"" This is the name of our campaign. It is displayed to the left of the mission select screen.
- quot;"displayName"" = "Postmortem"
- quot;"--"" This creates the structure for the missions
- quot;"--"" The first mission's details
- quot;"--"" This tells the game to play the animatic prior to the game starting
- quot;"--"" postload = function ()
- quot;"--"" ""playAnimatic""("data:animatics/A00.lua",1,1);
- quot;"--"" end,
- quot;"--"" Informs the game where to get the mission information from
directory = "M01",
- quot;"--"" The name of the level to load
level = "M01.level",
- quot;"--"" Tells the game what to do when the mission is complete
if bWin ""
"" 1 then
- quot;"postLevelComplete""()
- quot;"--"" This is the title of the mission in the mission selection screen
- quot;"displayName"" = "Mission One",
- quot;"--"" This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
- quot;"postLevelComplete""()
- quot;"displayName"" = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
- quot;M01.level"
- quot;M01.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
In "...\Ascension\m02\" we need:
- quot;M02.level"
- quot;M02.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function ""DetermChunk""()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("""
MotherShip""")
addToSOBGroup("Hgn_Mothership", """
MotherShip""")
end ""--"" End of deterministic function
function ""NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
In "m02.level" copy this:
function ""
DetermChunk""()
- quot;"--"" Player Startpoint.
addPoint("""PlayerStartPoint""", {0, 0, 12300}, {0, 180, 0})
end ""--"" End of deterministic function
function ""
NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
quot;"raceID"" = 1,
quot;"startPos"" = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = ""--"" The player number
{ ""--"" Team Colour (White)
{ ""--"" Stripe Colour (Black)
quot;"--"" Badge to display
quot;""DATA:badges""/kiith naabal.tga",
{ ""--"" Engine trail colour (I think. I haven't played with it)
quot;data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
""--"" Imports the library files
dofilepath("""Data:scripts""\\SCAR\\SCAR_Util.lua";)
quot;"--"" Sets the objectives
function ""
OnInit""()
- quot;"--"" Adds the Rule_Init
Rule_Add("Rule_Init")
- quot;"--"" ""OnInit"" isn't a rule so there is no need to remove it
- quot;"--"" Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
- quot;"--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""MotherShip""", """FighterProduction""")
- quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
- quot;"--"" Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
- quot;"--"" We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
- quot;"--"" Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
setMissionComplete(1) is, as far as I can tell, the variable used in the
postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
""--"" The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
""--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""
MotherShip""", """
FighterProduction""")
quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = """PlayerStartPoint"""
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
- quot;"""Strings for m01.dat
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
description = "$8000",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
Deletions:
How to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
Go to your "...\
Homeworld2\Data" directory and create the following directories:
"LevelData"
"LevelData\Campaign"
"LevelData\Campaign\Ascension\"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
"LevelData\Campaign\Ascension\mNN"
You can name these directories whatever you want. I recommend the "m##" format or something similar. Relic used the following:
"LevelData\Campaign\Ascension\m01_tanis"
"LevelData\Campaign\Ascension\m02_hiigara"
"LevelData\Campaign\Ascension\m15_homeworld"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
In the "...\
Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\LevelData\Campaign" directory create a new file called:
"Ascension.Campaign"
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
-- This is the name of our campaign. It is displayed to the left of the mission select screen.
displayName = "Postmortem"
-- This creates the structure for the missions
-- The first mission's details
-- This tells the game to play the animatic prior to the game starting
-- postload = function ()
-- playAnimatic("data:animatics/A00.lua",1,1);
-- end,
-- Informs the game where to get the mission information from
directory = "M01",
-- The name of the level to load
level = "M01.level",
-- Tells the game what to do when the mission is complete
if bWin == 1 then
postLevelComplete()
-- This is the title of the mission in the mission selection screen
displayName = "Mission One",
-- This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
postLevelComplete()
displayName = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "
TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
"M01.level"
"M01.lua"
"Teamcolour.lua"
"Datafiles.lua"
In "...\Ascension\m02\" we need:
"M02.level"
"M02.lua"
"Teamcolour.lua"
"Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function DetermChunk()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("MotherShip")
addToSOBGroup("Hgn_Mothership", "MotherShip")
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
In "m02.level" copy this:
function DetermChunk()
-- Player Startpoint.
addPoint("PlayerStartPoint", {0, 0, 12300}, {0, 180, 0})
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
raceID = 1,
startPos = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = -- The player number
{ -- Team Colour (White)
{ -- Stripe Colour (Black)
-- Badge to display
"DATA:badges/kiith naabal.tga",
{ -- Engine trail colour (I think. I haven't played with it)
"data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
-- Imports the library files
dofilepath("Data:scripts\\SCAR\\SCAR_Util.lua")
function OnInit()
-- Adds the Rule_Init
Rule_Add("Rule_Init")
-- OnInit isn't a rule so there is no need to remove it
-- Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
-- Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
-- We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
-- Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
-- Updates the objective
setMissionComplete(1) is, as far as I can tell, the variable used in the postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
-- Updates the objective
-- The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = "PlayerStartPoint"
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
How to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
Go to your "...\
Homeworld2\Data" directory and create the following directories:
"LevelData"
"LevelData\Campaign"
"LevelData\Campaign\Ascension\"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
"LevelData\Campaign\Ascension\mNN"
You can name these directories whatever you want. I recommend the "m##" format or something similar. Relic used the following:
"LevelData\Campaign\Ascension\m01_tanis"
"LevelData\Campaign\Ascension\m02_hiigara"
"LevelData\Campaign\Ascension\m15_homeworld"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
In the "...\
Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\LevelData\Campaign" directory create a new file called:
"Ascension.Campaign"
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
-- This is the name of our campaign. It is displayed to the left of the mission select screen.
displayName = "Postmortem"
-- This creates the structure for the missions
-- The first mission's details
-- This tells the game to play the animatic prior to the game starting
-- postload = function ()
-- playAnimatic("data:animatics/A00.lua",1,1);
-- end,
-- Informs the game where to get the mission information from
directory = "M01",
-- The name of the level to load
level = "M01.level",
-- Tells the game what to do when the mission is complete
if bWin == 1 then
postLevelComplete()
-- This is the title of the mission in the mission selection screen
displayName = "Mission One",
-- This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
postLevelComplete()
displayName = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "
TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
"M01.level"
"M01.lua"
"Teamcolour.lua"
"Datafiles.lua"
In "...\Ascension\m02\" we need:
"M02.level"
"M02.lua"
"Teamcolour.lua"
"Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function DetermChunk()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("MotherShip")
addToSOBGroup("Hgn_Mothership", "MotherShip")
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
In "m02.level" copy this:
function DetermChunk()
-- Player Startpoint.
addPoint("PlayerStartPoint", {0, 0, 12300}, {0, 180, 0})
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
raceID = 1,
startPos = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = -- The player number
{ -- Team Colour (White)
{ -- Stripe Colour (Black)
-- Badge to display
"DATA:badges/kiith naabal.tga",
{ -- Engine trail colour (I think. I haven't played with it)
"data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
-- Imports the library files
dofilepath("Data:scripts\\SCAR\\SCAR_Util.lua")
function OnInit()
-- Adds the Rule_Init
Rule_Add("Rule_Init")
-- OnInit isn't a rule so there is no need to remove it
-- Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
-- Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
-- We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
-- Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
-- Updates the objective
setMissionComplete(1) is, as far as I can tell, the variable used in the postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
-- Updates the objective
-- The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = "PlayerStartPoint"
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
I blushed and replied, Thank you Mistress, very nice of you to say so Merry Stories Gay Stories
Spanking Tgp Zippy Tgp
Free Spanking Video Clips Free Spanking Television Clips
Pantyhose Photos Pantyhose Photos
Women Inwards Pantyhose Women Inward Pantyhose
Spanking Girls Merry Girls
Women Pee On Men Women Pissing On Workforce
Merry Personals Gay Personals
Sinew Hunks Brawn Hunks
Fledged Arouse Mature Arouse
Snappy Personals Lively Personals
Free Pantyhose Drift Unloose Pantyhose Drift
Snappy Stories Resign Brisk Stories Loose
Peeing Gay Pics Piss Gay Pics
Gay Spanking Gay Merry
Girls Pantyhose Drift Girls Pantyhose Drift
Unfreeze Spanking Stories Free Zippy Stories
Mature Thumbs Grow Thumbs
Outdoor Pee Outdoor Peeing
Girls Pissing Girls Pissing
the waitress announced as she set down the liter bottleHow to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
- quot;...\Homeworld2\Bin\Release\Homeworld2.exe" -campaign <CampaignName> -startingLevel <FirstLevel>
Go to your "...\Homeworld2\Data" directory and create the following directories:
You can name these directories whatever you want. I recommend the "m""""" format or something similar. Relic used the following:
- quot;""LevelData""\Campaign\Ascension\m01_tanis"
- quot;""LevelData""\Campaign\Ascension\m02_hiigara"
- quot;""LevelData""\Campaign\Ascension\m15_homeworld"
- quot;""LevelData""\Campaign\Ascension\m01"
- quot;""LevelData""\Campaign\Ascension\m02"
In the "...\Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\""LevelData""\Campaign" directory create a new file called:
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
""--"" This is the name of our campaign. It is displayed to the left of the mission select screen.
- quot;"displayName"" = "Postmortem"
- quot;"--"" This creates the structure for the missions
- quot;"--"" The first mission's details
- quot;"--"" This tells the game to play the animatic prior to the game starting
- quot;"--"" postload = function ()
- quot;"--"" ""playAnimatic""("data:animatics/A00.lua",1,1);
- quot;"--"" end,
- quot;"--"" Informs the game where to get the mission information from
directory = "M01",
- quot;"--"" The name of the level to load
level = "M01.level",
- quot;"--"" Tells the game what to do when the mission is complete
if bWin ""
"" 1 then
- quot;"postLevelComplete""()
- quot;"--"" This is the title of the mission in the mission selection screen
- quot;"displayName"" = "Mission One",
- quot;"--"" This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
- quot;"postLevelComplete""()
- quot;"displayName"" = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
- quot;M01.level"
- quot;M01.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
In "...\Ascension\m02\" we need:
- quot;M02.level"
- quot;M02.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function ""DetermChunk""()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("""
MotherShip""")
addToSOBGroup("Hgn_Mothership", """
MotherShip""")
end ""--"" End of deterministic function
function ""NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
In "m02.level" copy this:
function ""
DetermChunk""()
- quot;"--"" Player Startpoint.
addPoint("""PlayerStartPoint""", {0, 0, 12300}, {0, 180, 0})
end ""--"" End of deterministic function
function ""
NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
quot;"raceID"" = 1,
quot;"startPos"" = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = ""--"" The player number
{ ""--"" Team Colour (White)
{ ""--"" Stripe Colour (Black)
quot;"--"" Badge to display
quot;""DATA:badges""/kiith naabal.tga",
{ ""--"" Engine trail colour (I think. I haven't played with it)
quot;data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
""--"" Imports the library files
dofilepath("""Data:scripts""\\SCAR\\SCAR_Util.lua";)
quot;"--"" Sets the objectives
function ""
OnInit""()
- quot;"--"" Adds the Rule_Init
Rule_Add("Rule_Init")
- quot;"--"" ""OnInit"" isn't a rule so there is no need to remove it
- quot;"--"" Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
- quot;"--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""MotherShip""", """FighterProduction""")
- quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
- quot;"--"" Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
- quot;"--"" We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
- quot;"--"" Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
setMissionComplete(1) is, as far as I can tell, the variable used in the
postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
""--"" The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
""--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""
MotherShip""", """
FighterProduction""")
quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = """PlayerStartPoint"""
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
- quot;"""Strings for m01.dat
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
description = "$8000",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
Edited on 2005-07-13 16:30:38 by 210.0.200.2
Additions:
I blushed and replied, Thank you Mistress, very nice of you to say so Merry Stories Gay Stories
Spanking Tgp Zippy Tgp
Free Spanking Video Clips Free Spanking Television Clips
Pantyhose Photos Pantyhose Photos
Women Inwards Pantyhose Women Inward Pantyhose
Spanking Girls Merry Girls
Women Pee On Men Women Pissing On Workforce
Merry Personals Gay Personals
Sinew Hunks Brawn Hunks
Fledged Arouse Mature Arouse
Snappy Personals Lively Personals
Free Pantyhose Drift Unloose Pantyhose Drift
Snappy Stories Resign Brisk Stories Loose
Peeing Gay Pics Piss Gay Pics
Gay Spanking Gay Merry
Girls Pantyhose Drift Girls Pantyhose Drift
Unfreeze Spanking Stories Free Zippy Stories
Mature Thumbs Grow Thumbs
Outdoor Pee Outdoor Peeing
Girls Pissing Girls Pissing
the waitress announced as she set down the liter bottleHow to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
- quot;...\Homeworld2\Bin\Release\Homeworld2.exe" -campaign <CampaignName> -startingLevel <FirstLevel>
Go to your "...\Homeworld2\Data" directory and create the following directories:
You can name these directories whatever you want. I recommend the "m""""" format or something similar. Relic used the following:
- quot;""LevelData""\Campaign\Ascension\m01_tanis"
- quot;""LevelData""\Campaign\Ascension\m02_hiigara"
- quot;""LevelData""\Campaign\Ascension\m15_homeworld"
- quot;""LevelData""\Campaign\Ascension\m01"
- quot;""LevelData""\Campaign\Ascension\m02"
In the "...\Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\""LevelData""\Campaign" directory create a new file called:
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
""--"" This is the name of our campaign. It is displayed to the left of the mission select screen.
- quot;"displayName"" = "Postmortem"
- quot;"--"" This creates the structure for the missions
- quot;"--"" The first mission's details
- quot;"--"" This tells the game to play the animatic prior to the game starting
- quot;"--"" postload = function ()
- quot;"--"" ""playAnimatic""("data:animatics/A00.lua",1,1);
- quot;"--"" end,
- quot;"--"" Informs the game where to get the mission information from
directory = "M01",
- quot;"--"" The name of the level to load
level = "M01.level",
- quot;"--"" Tells the game what to do when the mission is complete
if bWin ""
"" 1 then
- quot;"postLevelComplete""()
- quot;"--"" This is the title of the mission in the mission selection screen
- quot;"displayName"" = "Mission One",
- quot;"--"" This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
- quot;"postLevelComplete""()
- quot;"displayName"" = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
- quot;M01.level"
- quot;M01.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
In "...\Ascension\m02\" we need:
- quot;M02.level"
- quot;M02.lua"
- quot;Teamcolour.lua"
- quot;Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function ""DetermChunk""()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("""
MotherShip""")
addToSOBGroup("Hgn_Mothership", """
MotherShip""")
end ""--"" End of deterministic function
function ""NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
In "m02.level" copy this:
function ""
DetermChunk""()
- quot;"--"" Player Startpoint.
addPoint("""PlayerStartPoint""", {0, 0, 12300}, {0, 180, 0})
end ""--"" End of deterministic function
function ""
NonDetermChunk""()
loadBackground("m03")
setDefaultMusic("""Data:sound""/music/STAGING/STAGING_04";)
end ""--"" End of nondeterm function
quot;"--"" ""HeaderInfo"": max number of players allowed on this level
quot;"maxPlayers"" = 1;
quot;"--"" ""PlayerInfo"": info on each possible player in this level
name = "",
quot;"raceID"" = 1,
quot;"startPos"" = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = ""--"" The player number
{ ""--"" Team Colour (White)
{ ""--"" Stripe Colour (Black)
quot;"--"" Badge to display
quot;""DATA:badges""/kiith naabal.tga",
{ ""--"" Engine trail colour (I think. I haven't played with it)
quot;data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
""--"" Imports the library files
dofilepath("""Data:scripts""\\SCAR\\SCAR_Util.lua";)
quot;"--"" Sets the objectives
function ""
OnInit""()
- quot;"--"" Adds the Rule_Init
Rule_Add("Rule_Init")
- quot;"--"" ""OnInit"" isn't a rule so there is no need to remove it
- quot;"--"" Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
- quot;"--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""MotherShip""", """FighterProduction""")
- quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
- quot;"--"" Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
- quot;"--"" We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
- quot;"--"" Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
setMissionComplete(1) is, as far as I can tell, the variable used in the
postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
- quot;"--"" Updates the objective
- quot;"--"" Removes the rule
""--"" The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
""--"" Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("""
MotherShip""", """
FighterProduction""")
quot;"--"" Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("""MotherShip""", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = """PlayerStartPoint"""
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
- quot;"""Strings for m01.dat
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
description = "$8000",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.
Deletions:
How to Create a Singleplayer Campaign by Wyvern. Discussion
Because I don't feel very creative, I'm just going to expand upon the "Postmortem" Campaign in the RDN Tools SCAR documentation. Read this documentation, as well. I'm also going to describe how to localize the campaign, though I recommend that you get a native speaker of the language you wish to translate to (Babel fish ain't that grand. Try translating English to German, and then back again - good for a laugh).
Final note before we begin: We are going to override the single player campaign "Ascension". It is not ideal, but it's the best we've been able to do so far. I highly recommend that you create a new profile before you start testing your SP campaign.
Go to your "...\
Homeworld2\Data" directory and create the following directories:
"LevelData"
"LevelData\Campaign"
"LevelData\Campaign\Ascension\"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
"LevelData\Campaign\Ascension\mNN"
You can name these directories whatever you want. I recommend the "m##" format or something similar. Relic used the following:
"LevelData\Campaign\Ascension\m01_tanis"
"LevelData\Campaign\Ascension\m02_hiigara"
"LevelData\Campaign\Ascension\m15_homeworld"
"LevelData\Campaign\Ascension\m01"
"LevelData\Campaign\Ascension\m02"
In the "...\
Homeworld2\Data" directory create the following directories:
We now need to create the campaign file. So, in the "...\LevelData\Campaign" directory create a new file called:
"Ascension.Campaign"
Why "Ascension.Campaign" and not "Postmortem.Campaign"? This is because we are overriding the "Ascension" campaign so that we can actually run our custom campaign.
Open the "Ascension.Campaign" file and enter this code in:
-- This is the name of our campaign. It is displayed to the left of the mission select screen.
displayName = "Postmortem"
-- This creates the structure for the missions
-- The first mission's details
-- This tells the game to play the animatic prior to the game starting
-- postload = function ()
-- playAnimatic("data:animatics/A00.lua",1,1);
-- end,
-- Informs the game where to get the mission information from
directory = "M01",
-- The name of the level to load
level = "M01.level",
-- Tells the game what to do when the mission is complete
if bWin == 1 then
postLevelComplete()
-- This is the title of the mission in the mission selection screen
displayName = "Mission One",
-- This is the description of the mission in the mission selection screen
description = "The first Postmortem mission",
directory = "M02",
level = "M02.level",
postLevelComplete()
displayName = "Mission Two",
description = "The second Postmortem mission",
For each mission that you have in the campaign file, you absolutely must have the "*.level" and "*.lua" files. The ".level" file has to be the same as the name given in the campaign file. The ".lua" has to have the same name as the ".level" file. It is recommended that you have a "
TeamColor.lua" in each mission folder. It controls the colour of each of the players in the campaign (each CPU-controlled fleet counts as a player). Seeing as we are going to localize the campaign, each mission directory also requires a "Datafiles.lua".
In "...\Ascension\m01\" we need:
"M01.level"
"M01.lua"
"Teamcolour.lua"
"Datafiles.lua"
In "...\Ascension\m02\" we need:
"M02.level"
"M02.lua"
"Teamcolour.lua"
"Datafiles.lua"
Step Four: ".level" Creation
To create a level that actually looks good, you have to have Maya, as well as the necessary skills to use it. However, you can also make a basic ".level" file using Notepad (or,
Lathe of Sajuuk
and, later, Notepad in order to edit the level, afterwards). So, seeing as this is just a test campaign, and that I have neither Maya nor the skill to use it if I did, we'll be using Notepad.
So, copy the following into "m01.level":
function DetermChunk()
addSquadron("Hgn_Mothership", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)
createSOBGroup("MotherShip")
addToSOBGroup("Hgn_Mothership", "MotherShip")
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
In "m02.level" copy this:
function DetermChunk()
-- Player Startpoint.
addPoint("PlayerStartPoint", {0, 0, 12300}, {0, 180, 0})
end -- End of deterministic function
function NonDetermChunk()
loadBackground("m03")
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")
end -- End of nondeterm function
-- HeaderInfo: max number of players allowed on this level
maxPlayers = 1;
-- PlayerInfo: info on each possible player in this level
name = "",
raceID = 1,
startPos = 1,
In "m02.level" we just add a start point.
Step Five: "TeamColour.lua"
[0] = -- The player number
{ -- Team Colour (White)
{ -- Stripe Colour (Black)
-- Badge to display
"DATA:badges/kiith naabal.tga",
{ -- Engine trail colour (I think. I haven't played with it)
"data:/effect/trails/hgn_trail_clr.tga",
The colours are set up as a Red, Green, Blue format. Each colour goes from 0 to 255. You need to have the '.0' after each number, or else it won't work. In Relic's "SCAR.pdf", it looks like decimals can also be used, instead, although I haven't tried it yet. I've also been having a problem with one team colour in my sp campaign... as soon as I work out what it is I'll update this if it needs it.
Step Six: "m01.lua"
Open up "m01.lua". For this mission we are going to set it up so that if the player builds a scout, they will complete the mission. If they build an intercepter, then they will fail. Pretty sad mission - but it'll demonstrate points. We should also add in objectives so that the player knows what is going on.
-- Imports the library files
dofilepath("Data:scripts\\SCAR\\SCAR_Util.lua")
function OnInit()
-- Adds the Rule_Init
Rule_Add("Rule_Init")
-- OnInit isn't a rule so there is no need to remove it
-- Does one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
-- Sets up the Win and Lose conditions
Rule_Add( "Rule_Player_Wins" )
Rule_Add( "Rule_Player_loses" )
-- We only want this rule to play the once. So, remove it now.
Rule_Remove( "Rule_Init" )
-- Checks to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
-- Updates the objective
setMissionComplete(1) is, as far as I can tell, the variable used in the postMission function for Mission 1 (in the "ascension.campaign" file).
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then
-- Updates the objective
-- The most important line
{ "Sound_EnableAllSpeech( 1 )", "" },
{ "Sound_EnterIntelEvent()", "" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_newobj_id, 'Description')", "" },
HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
Step Six: "m02.lua"
Because I am lazy - and because I really only want to show one more thing in the "mission.lua" files - copy and paste the contents of "m01.lua" into "m02.lua".
-- Makes it easy on the player and gives them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")
-- Tells the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")
sobGroup_LoadPersistantData("Hgn_Mothership")
Players_Flagship = "PlayerStartPoint"
SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then
Earlier I mentioned the "datfiles.lua" in each of the mission directories.
In "...\M01\datfiles.lua", add:
name = "locale:campaign/ascension/m01/m01.dat",
In "...\M02\datfiles.lua", add:
name = "locale:campaign/ascension/m02/m02.dat",
Now that this is done, we need to go to the "...\locale\English\campaign\ascension\m01" directory and create the "m01.dat" file.
Now, Fleet Command will say (it won't say it literally) "Welcome to my localized test mission" if we change this line in the "m01.lua":
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),
However, if the locale is set to French, then Fleet Command will say "$8000", instead. This is because, although we set up the English version of the "m01.dat" file with the $8000 string, we haven't (in this case) set up one for the French language. To sort this out, you need to create another "m01.dat" for each language you want to cater to.
For each language you are supporting, you need to create a "ui.ucs" file in the "...\locale\English", "...\locale\French", "...\locale\Braille" or "..\locale\whatever" directory.
However, this file also contains the strings necessary to create all of the Main Menu UI components. If we dont have them then the user will have to navigate around the menu system by memory. To get around this we need to copy the entire "ui.ucs" file and then add our mission selection strings (Mission Name, Description, etc) to the end of the file.
The easiest way is to uncompress "English.big" using the archive tool and then copy/alter the file. To do this, follow the following steps:
Copy the "archive.exe" file to your "...\Homeworld2\data" directory.
In a command prompt window, change to your "...\Homeworld2\Data" directory.
Type: archive -a English.big -e <whereYouWantToExtractItTo>
Then, copy & paste the "ui.ucs" file to the "...\Data\locale\English" directory.
In the "ascension.campaign" file, change:
description = "The first Postmortem mission",
If you want any of the other supported languages you are going to have to use the archive tool to unpack the "<languagename>.big" file located in the "...\Data" directory. However, as far as I can tell, Homeworld 2 only installs one language ".big" file.