RelicNews Forums

Go Back   RelicNews Forums > RDN - Relic Game Mods > Homeworld 2 - Tanis Shipyards
User Name
Password
Register FAQ Members List Arcade Mark Forums Read



Closed Thread
 
Thread Tools
Old 10th Dec 03, 7:49 PM   # 1
WyvernNZ
Guest
 

SP Campaign Creation

I've had a couple of people ask me about creating a single player game. I'm still learning myself, everything I'm going to add in here is just from my personal experience - feel free to correct me, add stuff that I've missed, etc. As I learn more and confirm/disprove theories about what is going on, I'll update it.

I'm going to assume that you already have the design documentation done for your mod. If you haven't or don't know what one is I recommend you head to www.gamedev.net and start reading some the game design articles/storyline development. Most of them are pretty advanced for a mod, but they give a general idea on what is needed. Someone made a simplified version of Chris Taylor's (Dungeon Siege, Total Annihilation) Design Document Template, but I can't find the url
I'm also going to assume that you understand how LUA scripting works... or are at least smart enough to figure it out.

Because I don't feel very creative I'm just going to expand on the 'Postmortem' Campaign in the RDN SCAR.pfd documentation - read it as well. I'm also going to include how to localise the Campaign, although I recommend that you get a native speaker of the languages you want to translate to - Babel fish ain't that grand (Try translating English to German and back again - good for a laugh).

Final note before we begin. We are going to be overriding the single player campaign 'Ascension' - it's 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.

Ok I lied - this is the Final Note: READ THE ENTIRE DOCUMENT BEFORE YOU BEGIN - TWICE.

Step One: Creating the Mission folder Hierarchy
Go to your ..\Homeworld2\Data directory and create the following directories:
LevelData
LevelData\Campaign
LevelData\Campaign\Ascension\

And for each level you want to have in the campaign, you need to make a directory. E.g.
LevelData\Campaign\Ascension\m01
LevelData\Campaign\Ascension\m02
...
LevelData\Campaign\Ascension\mNN

Now you can name these directories whatever you want. I recommend the mNN format or something simular. Relic used:
LevelData\Campaign\Ascension\m01_tanis
LevelData\Campaign\Ascension\m02_hiigara
...
LevelData\Campaign\Ascension\m15_homeworld

For the Postmortem campaign we are going to have 2 missions, so I can demonstrate how to use persistent fleets. So create the following directories
LevelData\Campaign\Ascension\m01
LevelData\Campaign\Ascension\m02

While we are creating Directories, we are also going to create the ones required for localising the campaign. You will need to add the same directories for English, French, Spanish, German, Leet, Braille, or whatever ? whichever languages you decide to support.
In the ..\homeworld2\data directory create the following directories:
Locale
Locale\<languagetosupport>\
Locale\<languagetosupport>\Campaign\
Locale\<languagetosupport>\Campaign\Ascension\
Locale\<languagetosupport>\Campaign\Ascension\m01
Locale\<languagetosupport>\Campaign\Ascension\m02


Step Two: Creating the Campaign File
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:
Code:
--This is the name of our Campaign to be displayed on the left of the --mission select screen displayName = "Postmortem" --This creates the structure for the missions Mission = {} --The first mission details Mission[1] = { --This tells the game to play the animatic prior to the game starting --postload = function () -- playAnimatic("data:animatics/A00.lua",1,1); -- end, --Inform the game where to get the mission information from directory = "M01", -- The name of the level to load level = "M01.level", -- Tell the game what to do when the mission is complete postlevel = function ( bWin ) if bWin == 1 then postLevelComplete() end end, -- 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", } Mission[2] = { directory = "M02", level = "M02.level", postlevel = function () postLevelComplete() end, displayName = "Mission Two", description = "The second Postmortem mission", }

Why are the postlevel fields of mission one and mission 2 different? Well mission one checks to see if the a certain value was set when the mission ends, and if it's true then move on to the next mission. Mission 2 moves on to the next mission regardless. At least that's my understanding of it; please correct me if I'm wrong.

Step Three: More File Creation
For each mission that you have in the campaign file, you absolutely must have the 2 files, *.level and *.lua. The .level file has to be the same as the name given in the campaign file, and 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 ? this 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 localise this campaign, each mission directory also requires a 'datfiles.lua'

For the Postmortem campaign we need these files
In Ascension\m01\
M01.level
M01.lua
Teamcolour.lua
Datafiles.lua
In Ascension\m02\
M02.level
M02.lua
Teamcolour.lua
Datafiles.lua

Step Four: .Level Creation
To create a level, which actually looks good, requires you to have maya and skill using it. However you can also make a basic .level using notepad ( or using the 'Lathe of Sarjuk', and then notepad edit it afterwards). So seeing as this is just a test campaign, and 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
Code:
function DetermChunk() addSquadron("Hgn_MotherShip", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1) addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991) setWorldBoundsInner({0, 0, 0}, {30000, 30000, 30000}) createSOBGroup("Mothership") addToSOBGroup("Hgn_Mothership", "Mothership") end -- end of deterministic function function NonDetermChunk() fogSetActive(0) setGlareIntensity(0) setLevelShadowColour(0, 0, 0, 1) loadBackground("m03") setSensorsManagerCameraDistances(12000, 60000) 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 player = {}; player[0] = { id = 0, name = "", resources = 20000, raceID = 1, startPos = 1 }

Functions of Interest:
Code:
AddSquadron( <nameofsquadron>, <modelname>, {PosX, PosY, PosZ}, <ownerid>, {RotX, RotY, RotZ}, <noidea>, <Hyperspace> ) CreateSobGroup( <sobgroupname> ) AddToSobGroup( <nameofsquadron>, <sobgroupname> )


The <hyperspace> takes the values 1 or 0 and it determines if the squadron should be created in hyperspace or in real space respectively.
Other:
The player number always starts at 0, and goes up in steps of one.

In m02.level copy this

Code:
function DetermChunk() --Player Startpoint. addPoint("PlayerStartPoint", {0, 0, 12300}, {0, 180, 0}) setWorldBoundsInner({0, 0, 0}, {30000, 30000, 30000}) end -- end of deterministic function function NonDetermChunk() fogSetActive(0) setGlareIntensity(0) setLevelShadowColour(0, 0, 0, 1) loadBackground("m03") setSensorsManagerCameraDistances(12000, 60000) 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 player = {}; player[0] = { id = 0, name = "", resources = 20000, raceID = 1, startPos = 1 }

In m02.level we just add a start point.

Other Notes:
Code:
addSphere("name", {X, Y, Z}, <unknown>)

This command creates a 'volume' in the map. A volume is an invisible area which is used in scripts for detection and events. The volume itself doesn't do anything in the game. However using lua script we can use the volume as a waypoint to order ships to hyperspace in, check to see if there is a certain ship, or group of ships inside (or not) the volume. I'l not 100% sure but I think the <unknown> feild of the addsphere command is the radius of the sphere

SOBGroups:
Sobgroups are a way of identifying one or more ships. When you have identifyed a ship, it is then possible to issue commands to that sobgroup through lua scripting. For more information about SOBGroups, see the Relic Scar Documentation.

Step Five: TeamColour.lua
This sets up the colours that you want each side to have in your mission. While you don't need to have one, it is probably a good idea.
This is the code you need
Code:
teamcolours = { [0] = --The player number { { -- Team Colour (White) 255.0, 255.0, 255.0, }, { -- Stripe Colour (Black) 0.0, 0.0, 0.0, }, --Badge to display "DATA:badges/kiith naabal.tga", { -- Engine trail colour (I think - haven't played with it) 255.0, 255.0, 255.0, }, "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 else it wont work. The relic SCAR.pdf looks like it can also use decimals 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.

Setup
Code:
--Import the library files dofilepath("Data:scripts\\SCAR\\SCAR_Util.lua") --Set objectives obj_prim_newobj_id = 0

We are setting a global constant called ob_prim_newobj_id, so that we can refer to it at any point (just makes code tidier and easier to read)

Entry point
Code:
function OnInit() -- Add the Rule_Init Rule_Add("Rule_Init") --OnInit isn't a rule so there is no need to remove it end

The OnInit function is a required function. This is where the game starts off.

Initialisation of gamerules.
Code:
function Rule_Init() -- Do one of those fancy Intel-tell-the-player-whats-going-on Event_Start( "IntelEvent_Intro" ) -- Make it easy on the player and give them fighter production SobGroup_CreateSubSystem("MotherShip", "FighterProduction") -- Tell the Mothership to exit hyperspace SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume") --Setup the Win and Lose condition 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" ) End


The SobGroup_ExitHyperSpace function determines the orientation of the ship by taking the ships starting point and drawing an imaginary line to the center of the exitpoint (in this case the volume called 'Mothership_EnterVolume'). The ship then exits hyperspace at the center of the exit point volume, on the same orientation as the imaginary line drawn.

Player Win Conditions
Code:
function Rule_Player_Wins() --Check to see if the player has a squadron of Scouts if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then --Update the Objective Objective_SetState( obj_prim_newobj_id, OS_Complete ) --Remove the rule setMissionComplete( 1 ) end end

setMissionComplete(1) as far as I can tell is the variable used in the postMission function for Mission One (in the ascension.campaign file)

Player Lose Condition
Code:
function Rule_Player_Loses() if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then --Update the Objective Objective_SetState( obj_prim_newobj_id, OS_Fail ) --Remove the rule setMissionComplete( 0 ) end end

The mission will end as soon as the scout or interceptor are built and under the control of the player.

The next thing to do is to set up the events. Events are generally used for cut scenes and the like.
Introduction Intel Event
Code:
--Most important line Events = {} Events.IntelEvent_Intro = { { { "Sound_EnableAllSpeech( 1 )",""}, { "Sound_EnterIntelEvent()","" }, { "Universe_EnableSkip(1)", "" }, HW2_LocationCardEvent( "Postmortem Tutorial", 5 ), }, { HW2_Letterbox( 1 ), HW2_Wait( 2 ), }, { HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ), }, { HW2_Wait( 1 ), }, { { "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 ), }, { HW2_Wait( 1 ), }, { HW2_Letterbox( 0 ), HW2_Wait( 2 ), { "Universe_EnableSkip(0)", "" }, { "Sound_ExitIntelEvent()", "" }, }, }

Once again my knowledge is pretty limited when it comes to events atm. It's a case of playing around with what is there.

Step Seven: m02.lua
Because I am lazy, and 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.
Change:
Code:
-- Make it easy on the player and give them fighter production SobGroup_CreateSubSystem("MotherShip", "FighterProduction") -- Tell the Mothership to exit hyperspace SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")

To:
Code:
SobGroup_LoadPersistantData("Hgn_Mothership") Players_Flagship = "PlayerStartPoint" SobGroup_Create(Players_Flagship) SobGroup_FillShipsByType(Players_Flagship, "Player_Ships0", "Hgn_Mothership")


This loads the fleet from the last mission into the current mission.
The ship name can be hgn_mothership, hgn_battlecruiser or hgn_carrier (probably works for the Vaygr equivalents as well, but not sure). This essentially tells the ships to parade around the named vessel.

You'll also need to change this line so that you can see that it actually happens.
Change:
Code:
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then

To:
Code:
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 1 then

At this point you should be able to run the sp campaign with the -overrideBigFile switch. Just go to the single player menu and play away

Step Eight: Localising Missions
Earlier I mentioned the datfiles.lua in each of the mission directories.
M01\datfiles.lua
Add:
Code:
Dictionaries = { { name = "locale:campaign/ascension/m01/m01.dat", }, }

M02\datfiles.lua
Add:
Code:
Dictionaries = { { name = "locale:campaign/ascension/m02/m02.dat", }, }

Now that that is done we need to go to the locale/English/campaign/ascension/m01 directory and create the m01.dat file.
To the file add these lines
Code:
filerange 8000 8999 rangestart 8000 8999 //Strings for m01.dat 8000 Welcome to my localised test mission. rangeend

The range 8000 to 8999 is reserved for Community mods - so there is no danger of screwing anything else up.

Now if we change this line in the m01.lua
Change:
Code:
HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),

To:
Code:
HW2_SubTitleEvent( Actor_FleetCommand, "$8000", 5 ),

Fleet Command will say (it won't say it literally) "Welcome to my localized test mission". However, if the locale is set to say 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.

Step Nine: Localising the Mission Selection
For each language you are supporting you need to create ui.ucs file in the locale\English or locale\French or locale\Braille directory.

However, this file also contains the strings necessary for 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 go to uncompress English.big using the archive tool, and copy/alter the file. To do this:

  • 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
  • Open with notepad (or whatever text editor) and add your data strings to the end
In our case we add this line
Code:
8000 Witty and informative description of the first mission

And in the ascension.campaign file
Change:
Code:
description = "The first Postmortem mission",

To:
Code:
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.

Step Ten: Coming Soon(tm)


Things Left to Do
Editing the AI
Using ReferenceFleets

I hope this is of help to people thinking about starting a single player campaign. If there are any errors (blatent or not) tell me and I'll fix them.

Thanks to:
Dark_Axel, and Mikail for suggestions, omissions, and helping me tidy up my writing.
-Wyvern

Last edited by WyvernNZ : 12th Dec 03 at 12:20 AM.
 
Old 10th Dec 03, 8:23 PM   # 2
thesamonthemoon
Guest
 

Nice. You should put it on the wiki.

Oh, by the way, I already trademarked "Coming Soon". Now I'm going to sue you for everything you have, Buahahahahaaa...
 
Old 10th Dec 03, 8:54 PM Forum Rules   # 3
Tel'Quessir
Creator of PDS&NGCS
 
Tel'Quessir's Avatar
 
Join Date: Oct 2003
Location: Singapore

Nice *rips whole page from monitor to disk*
Tel'Quessir is offline  
Old 11th Dec 03, 5:39 AM Child's Play Donator   # 4
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Wyvernz, I think you copied an error from the RDN file...

Quote:
{ "obj_prim_newobj_id = Objective_Add( 'Scout building', OT_Primary )", "" },
{ "Objective_AddDescription( obj_prim_startresourcing_id, 'Description')", "" }, HW2_SubTitleEvent( Actor_FleetIntel, "Build a scout squadron to win the mission", 4 ),


obj_prim_startresourcing_id should be the same name as the objective. In this case it should be obj_prim_newobj_id...

BTW, nice explaination. Still got an error in my LUA, no OnInit function??? It's there, must be a faulty script...
__________________
The Dark one has Arrived.
Dark_Axel is offline  
Old 11th Dec 03, 6:06 AM Child's Play Donator   # 5
WyvernNZ
Guest
 

@Dark_Axel, Cheers I hadn't noticed that and it is in the files I've been using to test ideas out in

If you send me the lua, I can have a look at it and see if I can see the problem.

@thesamonthemoon. I thought about wiki, but I figured that mistakes would get picked up quicker here . Er, yeah, and about the trademark infrac - *points* WHATS THAT! *Flees like a thief in the night*

-Wyvern
 
Old 11th Dec 03, 6:22 AM Forum Rules   # 6
Mikail
Lost in the Web...
 
Mikail's Avatar
 
Join Date: Jun 2003
Location: %HW2_ROOT%

This has been added to the wiki:

http://hw2.tproc.org/wiki/TutorialCampaign

-Mikail
__________________
Download my HW2 mods, maps & tools. link

Last edited by Mikail : 11th Dec 03 at 11:57 AM.
Mikail is offline  
Old 11th Dec 03, 10:47 AM Child's Play Donator   # 7
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Also some other notes...
Because of the trigger nature of HW2 they use the AddSphere command in the level file to create 'waypoints'.
'addSphere("name", {X, Y, Z}, unknown)'
These can be used within scripts for activating events, or hyper-in some enemy's, etc. These are thus important for SP mission. I'm not familiar with the scripting part but I think others will fill in the blanks on that.

Also about the SOBGroups, it's used to give groups of ships an identity, so it can be used within the script. Like in the postmortem example for checking if a group has been destroyed. But also ofcourse to hyper-in a group or give them attack orders etc.
Dark_Axel is offline  
Old 11th Dec 03, 11:55 AM Forum Rules   # 8
Mikail
Lost in the Web...
 
Mikail's Avatar
 
Join Date: Jun 2003
Location: %HW2_ROOT%

Your tutorial has two Step Sixes
Mikail is offline  
Old 11th Dec 03, 2:29 PM   # 9
WyvernNZ
Guest
 

@Mikail: Thanks and Thanks. It also used to have 2 step eights...I guess I just like even numbers

@Dark_Axel: Cheers once again. I've updated the tutorial to add those bits of knowledge to it in the '.level creation' step. I'm not 100% sure but I think the unknown feild in the addsphere command is the radius of the volume. Not sure how to check it as the thing is invisible...but I'll give it a try

-Wyvern
 
Old 11th Dec 03, 3:14 PM   # 10
WyvernNZ
Guest
 

I've tidied up some of the writing, and finished a sentence or two that I'd stopped mid-sentence.

-Wyvern
 
Old 12th Dec 03, 12:21 AM   # 11
WyvernNZ
Guest
 

Update: Added some information about orientation of a sob group exiting hyperspace, and filled in a missing feild for the addSquadron function.

-Wyvern
 
Old 20th Dec 03, 3:12 PM   # 12
KAHR-SIDIUS1
Guest
 

Hello, i have make from you have said but, the game crash when the loading of the m01 mission is end.

can you analys my files, i have give the hw2.log with the -luatrace

Hw2.log

Sat Dec 20 23:59:56 2003

Using ..profiles\ for profiles folder
GAME -- Using player profile nameplayers
Changing from a 32 bit colour depth in winNT (5.1 build 2600), Service Pack 1
Using NVIDIA Corporation's 1.4.1 GeForce3/AGP/SSE2 renderer (Suspected driver is nvoglnt.dll 6.14.10.5216)
SOUND -- created destination [ fdaudio ], handle [ 4 ] with [ 48 ] channels created
SOUND -- created destination [ fda streamer ], handle [ 5 ] with [ 8 ] channels created
Build name: Sajuuk-Khar - AutoBuild3498 - Ordered by smmatte
Built by : mrbuild
Data path : I:\Homeworld2\data
No mapping for font 'GenericSubtitleFont' - using 'default'
Resetting fp control word.
CmdLine: -overrideBigFile -w 1280 -h 1024 -luatrace
thumbnail Data:UI\MapThumbnails\Campaign\ascension\M01.tga does not exist for this tutorial
LOCALIZER -- Parsing error on line 2 in locale:campaign/ascension/m01/m01.dat
Starting Level: Data:\LevelData\Campaign\ascension\M01\M01.level
parameter: `=' expected;
last token read: `function' at line 14 in string ""
SCAR ERROR: could not find OnInit function in rule file (Data:\LevelData\Campaign\ascension\M01\m01.lua)--FATAL EXIT-- scar/223:! --stac trace-- 0x0062519F: getLibraryID () 0x004948BF: GSLobbySessionDesc::operator=() 0x0049034A: GSLobbySessionDesc::operator=() 0x0049090B: GSLobbySessionDesc::operator=()


the m01.level files

function DetermChunk()
addSquadron("Hgn_MotherShip", "Hgn_Mothership", {1614, 141, 5229}, 0, {0, 0, 0}, 0, 1)
addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)

setWorldBoundsInner({0, 0, 0}, {30000, 30000, 30000})
createSOBGroup("Mothership")
addToSOBGroup("Hgn_Mothership", "Mothership")

end -- endof deterministic function

function NonDetermChunk()

fogSetActive(0)
setGlareIntensity(0)
setLevelShadowColour(0, 0, 0, 1)
loadBackground("m03")
setSensorsManagerCameraDistances(12000, 60000)
setDefaultMusic("Data:sound/music/STAGING/STAGING_04")

end -- endof nondeterm function


--HeaderInfo: max number of players allowed on this level
maxPlayers = 1;

--PlayerInfo: info on each possible player in this level
player = {};
player[0] = {
id = 0,
name = "Hiigaran",
resources = 20000,
raceID = 1,
startPos = 1,
}


the m01.lua file


--Import the library files
dofilepath("Data:scripts\\SCAR\\SCAR_Util.lua")

--Set objectives
obj_prim_newobj_id = 0

function OnInit()
-- Add the Rule_Init

Rule_Add("Rule_Init")
--OnInit isn't a rule so there is no need to remove it
End

function Rule_Init()
-- Do one of those fancy Intel-tell-the-player-whats-going-on
Event_Start( "IntelEvent_Intro" )

-- Make it easy on the player and give them fighter production
SobGroup_CreateSubSystem("MotherShip", "FighterProduction")

-- Tell the Mothership to exit hyperspace
SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")

--Setup the Win and Lose condition
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" )
End

function Rule_Player_Wins()

--Check to see if the player has a squadron of Scouts
if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_scout" ) ) > 0 then

--Update the Objective
Objective_SetState( obj_prim_newobj_id, OS_Complete )

--Remove the rule
setMissionComplete( 1 )
end
end


function Rule_Player_Loses()

if (Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping( 0, "hgn_interceptor" )) > 0 then

--Update the Objective
Objective_SetState( obj_prim_newobj_id, OS_Fail )

--Remove the rule
setMissionComplete( 0 )
end
end



--Most important line
Events = {}

Events.IntelEvent_Intro =
{
{
{ "Sound_EnableAllSpeech( 1 )",""},
{ "Sound_EnterIntelEvent()","" },
{ "Universe_EnableSkip(1)", "" },
HW2_LocationCardEvent( "Postmortem Tutorial", 5 ),
},
{
HW2_Letterbox( 1 ),
HW2_Wait( 2 ),
},
{
HW2_SubTitleEvent( Actor_FleetCommand, "construiser un scout", 5 ),
-- HW2_SubTitleEvent( Actor_FleetCommand, "Welcome to my test mission", 5 ),
},
{
HW2_Wait( 1 ),
},
{
{ "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 ),
},
{
HW2_Wait( 1 ),
},
{
HW2_Letterbox( 0 ),
HW2_Wait( 2 ),
{ "Universe_EnableSkip(0)", "" },
{ "Sound_ExitIntelEvent()", "" },
},
}

the m01.dat

filerange 8000 8999
rangestart 8000 8999

//Strings for m01.dat
8000 Welcome to my localised test mission.

rangeend



thank you for you re help and sorry for my bad english

@+
 
Old 21st Dec 03, 12:18 AM   # 13
lotoiit
Guest
 

The example doesn't work, needs debug.
 
Old 21st Dec 03, 12:50 AM   # 14
lotoiit
Guest
 

I thought it would be easy, now I am depressed.
 
Old 21st Dec 03, 2:37 AM Child's Play Donator   # 15
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

KAHR-SIDIUS1

Quote:
LOCALIZER -- Parsing error on line 2 in locale:campaign/ascension/m01/m01.dat
Starting Level: Data:\LevelData\Campaign\ascension\M01\M01.level
parameter: `=' expected;
last token read: `function' at line 14 in string ""
SCAR ERROR: could not find OnInit function in rule file


The OnInit function isn't found because it has an error in it.
In this case the problem is in line 14...

Now you must understand that the logs says that OnInit doesn't exist because the Rule_Init file is bad. That confirms line 14 as the source of the problem.

BTW use tabs it makes it better readable.
Unfortunatly I don't see the problem right now...

And Lotoiit.. the example doesn't work because WyverNZ use the Scar RDN file as a source. Replace the "!! The PDF uses a different " which isn't recongnized by HW2.

you can see it better in the original text. It's a bigger ".
Dark_Axel is offline  
Old 21st Dec 03, 3:48 AM Child's Play Donator   # 16
KAHR-SIDIUS1
Guest
 

yes but, Rules_Ini file where is he and what do you make to resolve this bug ????
 
Old 21st Dec 03, 6:11 AM Child's Play Donator   # 17
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Rule_Add("Rule_Init")

hasn't got spaces around it... try add those
Dark_Axel is offline  
Old 21st Dec 03, 6:37 AM Child's Play Donator   # 18
KAHR-SIDIUS1
Guest
 

i have try but the game crash soo

i have reduced the M01.lua to minimum :

m01.lua

-- empty file that does nothing
-- this ensures the game never ends

dofilepath("data:scripts/SCAR/SCAR_Util.lua")

function OnInit()
Rule_Add("Rule_Init")

end

obj_prim_newobj_id = 0


function Rule_Init()

Event_Start("intelevent_intro")
Rule_Add("Rule_PlayerLoses")
Rule_Add("Rule_PlayerWins")
Rule_Remove("Rule_Init")
End

the Hw2.log said :

CmdLine: -overrideBigFile -w 1280 -h 1024 -luatrace
thumbnail Data:UI\MapThumbnails\Campaign\ascension\M01.tga does not exist for this tutorial
thumbnail Data:UI\MapThumbnails\Campaign\ascension\M01.tga does not exist for this tutorial
Starting Level: Data:\LevelData\Campaign\ascension\M01\M01.level
parameter: `=' expected;
last token read: `<eof>' at line 21 in string ""
SCAR ERROR: could not find OnInit function in rule file (Data:\LevelData\Campaign\ascension\M01\m01.lua) FATAL EXIT SCAR 223:! .........



if my m01.lua has only this :

-- empty file that does nothing
-- this ensures the game never ends

dofilepath("data:scripts/SCAR/SCAR_Util.lua")

function OnInit()
Rule_Add("Rule_Init")

end

obj_prim_newobj_id = 0

the game start but i don't have a mothership in the game...:monkey:



Are you an first mission campaign which is play (only the minimum) for i know why i don't arrived to build one ???

thx if you can make copy/drop in the topic

:flame:

PS i have see the HW2_scar.pdf in the Relics tools but :fencing:
 
Old 21st Dec 03, 9:01 AM Forum Rules   # 19
Taiidan Admiral
lol 1990s
 
Taiidan Admiral's Avatar
 
Join Date: Sep 2003
Location: Bel-air

I motion for this thread to recieve dockage.
__________________
Taiidan Admiral is offline Send a message via AIM to Taiidan Admiral  
Old 21st Dec 03, 9:56 AM Child's Play Donator   # 20
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Well, first of all, WyverNZ is a better scripter then me.
He has helped me becuase we both want to make SP campaigns.
Unfortunately he isn't online much this week.

And you don't even want to now, how many time I was dropped out of HW2 becuase of LUA errors...

Anyway, read the error log.. make use of it.
It helped me most with identifying the problems.

Again, check line 21...

BTW you probaly don't get a mothership becuase it's still in hyperspace. (I guess you did check that option)

Also, HW2 is very unforgiving when it comes to being case sensitive. Parameters and command need to be spelled with the right capital letters.

Other note,
Thanx to monty block!!!
There should be a way to create an campaign without overwriting the orignal. The right start up parameter should be '-campaign mycustomCampaign -startingLevel mycustomMap' but I haven't tested it yet.
Dark_Axel is offline  
Old 23rd Dec 03, 8:58 AM Child's Play Donator   # 21
KAHR-SIDIUS1
Guest
 

This function, is they exist really ???


addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)


The Hw2.log said which don't know the Mothership_EnterVolume in the lua file in the command line to exit the mothership of the hyperspace..... ???


thx for you answer


other question, are you other command line to .level file some "addsquadron";"addasteroids";"createsobgroup";"addsobgroup" ??

are they a Dictionnaries for ??

some thing for the .lua file ???


thx
 
Old 24th Dec 03, 1:03 AM Child's Play Donator   # 22
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Look at the KarosGraveYard it has a tutorial section. With an level tutorial by Malignus.

Keep in mind though, it's mainly written for MP levels. So it's not acurate for SP levels. And yes, there are many more things to create in the level files.

There are also many things in the LUA files to do, but it's not entirely documented. So many things are unknown. Luckily Wyvernz is helping me with that.

But I think I will explain a bit more on that when I finished my campaign.

BTW the addSphere function should be right.
If the LUA file can't find it, then check the spelling or capital letter.
Or just copy the name from the level file to the lua.

addSphere("Mothership_EnterVolume", {1641, 101, 5231}, 488.991)

SobGroup_ExitHyperSpace ("MotherShip", "Mothership_EnterVolume")

If the parameter would be written as "Mothership_entervolume" it would already cause problems because of wrong capitals.
Dark_Axel is offline  
Old 25th Dec 03, 1:09 AM Child's Play Donator   # 23
KAHR-SIDIUS1
Guest
 

hello,

Happy Chrismas and Hopes of the World :baloons:


I have resolved a some problems,

now, i have created 2 missions in the campaign, they are simple but this well....


The only thing, they i don't arrived to dock in the Chimera Station an MarineFrigate for launch them after then i arrived to do this with an interceptors...


and the Cpu player not very attack, they harvest with a collector and the carrier

are you possibility to setup (the IA of CPU) exemple Changed option between (Easy,Normal,Hard,...) in the mission .lua


thx

NB : Sorry for my Bad English
 
Old 26th Dec 03, 1:34 AM Child's Play Donator   # 24
KAHR-SIDIUS1
Guest
 

hello, i have resolved the probleme with marinefrigate

in the .level
there are make the next llines :

--Creer la Station Chimera created of Chimera Station
addSquadron("Meg_Chimera", "Meg_Chimera", {1614, 101, 5231}, 0, {0, 0, 0}, 0, 0)

--Creer un Groupe nommé Chimera Created of Chimera's Group
createSOBGroup("Chimera")

--Rajoute la station Meg_Chimera dans le groupe Chimera add Meg_Chimera in the Chimera's Group

addToSOBGroup("Meg_Chimera", "Chimera")

--Creer une zone de sortie virtuel ou d'inter action spherique appellé ChimeraSortie Created an virtual sphere of exit area or interactivity's action Called ChimeraSortie
addSphere("ChimeraSortie", {1614, 101, 5231}, 50)

--Creer un Group Fassault pour la marinefrigate
createSOBGroup("Fassault")

-- Creer un escadron pour la marine but the 1 at the End of line said the ship is in Hypersapce area Very important
addSquadron ("hgn_marinefrigate", "hgn_marinefrigate", {1634, 100, 5231}, 0, {0, 90, 0}, 0, 1)

-- Add in the Fassault's Group the marineFrigate
addToSOBGroup("hgn_marinefrigate","Fassault")


in the .lua
there are make the next llines :

dofilepath("Data:scripts/scar/scar_Util.lua")

function OnInit()
--MPRestrict()
Rule_Add("MainRule")
Rule_Add("InitRule")

end

function InitRule()

Normaly activated the Function Dock to the Chimera and Frigate but for Frigate this is not fonction really because they are normaly not possible to Dock an Frigate as the Interceptors

SobGroup_AbilityActivate("Chimera",AB_Steering,0)
SobGroup_AbilityActivate("Chimera",AB_Dock,0)
SobGroup_AbilityActivate("Fassault",AB_AcceptDocking,0)

Rule_Add("IntChimeraRule")

Rule_Remove("InitRule")
end

function IntChimeraRule()

--Et la pour la fregate de capture fait sortir the Fassault'Group de Hyperspace mais sans l effet dans la zone de sortie ChimeraSortie the Fassault exit of Hypesapce but nothing effect in the ChimeraSortie area

SobGroup_Spawn("Fassault","ChimeraSortie")

--Dock automaticly the Fassault to the Chimera
SobGroup_DockSobGroupInstant("Fassault","Chimera")
--Launch Fassault de Chimera

SobGroup_Launch("Fassault","Chimera")
-- Now clered the Rule for no using after
Rule_Remove("IntChimeraRule")

end

function MainRule()

-- The command of test win or lost or other

end

For the SobGroup_DockSobGroupInstant is well activated for marinefrigate or other captialship frigate destroyer ...

you re doing modified the .ship of ship
exemple Hgn_marinefrigate

Changed
NewShipType.DockFamily = "Frigate"
in
NewShipType.DockFamily = "Corvette"

and only this


exemple of code:

hgn_marinefrigate to folder Homeworld2\Data\Ship\hgn_marinefrigate\


NewShipType = StartShipConfig()
NewShipType.displayedName = "$1528"
NewShipType.sobDescription = "$1529"
NewShipType.maxhealth = 18000
NewShipType.regentime = 1200
NewShipType.minRegenTime = 1200
NewShipType.sideArmourDamage = 1.2
NewShipType.rearArmourDamage = 1.2
NewShipType.isTransferable = 1
NewShipType.useEngagementRanges = 1
NewShipType.unitCapsNumber = 2
NewShipType.SquadronSize = 1
NewShipType.passiveFormation = "Spear"
NewShipType.defensiveFormation = "x"
NewShipType.aggressiveFormation = "Claw"
NewShipType.mass = 100
NewShipType.collisionMultiplier = 1
NewShipType.thrusterMaxSpeed = 230
NewShipType.mainEngineMaxSpeed = 230
NewShipType.rotationMaxSpeed = 22
NewShipType.thrusterAccelTime = 7
NewShipType.thrusterBrakeTime = 2
NewShipType.mainEngineAccelTime = 8
NewShipType.mainEngineBrakeTime = 2
NewShipType.rotationAccelTime = 0.75
NewShipType.rotationBrakeTime = 0.4
NewShipType.thrusterUsage = 0.75
NewShipType.accelerationAngle = 40
NewShipType.mirrorAngle = 0
NewShipType.secondaryTurnAngle = 0
NewShipType.maxBankingAmount = 20
NewShipType.descendPitch = 20
NewShipType.goalReachEpsilon = 30
NewShipType.slideMoveRange = 100
NewShipType.controllerType = "Ship"
NewShipType.tumbleStaticX = 10
NewShipType.tumbleStaticY = 20
NewShipType.tumbleStaticZ = 5
NewShipType.tumbleDynamicX = 2
NewShipType.tumbleDynamicY = 10
NewShipType.tumbleDynamicZ = 5
NewShipType.tumbleSpecialDynamicX = 2
NewShipType.tumbleSpecialDynamicY = 10
NewShipType.tumbleSpecialDynamicZ = 5
NewShipType.relativeMoveFactor = 3
NewShipType.swayUpdateTime = 4
NewShipType.swayOffsetRandomX = 10
NewShipType.swayOffsetRandomY = 10
NewShipType.swayOffsetRandomZ = 10
NewShipType.swayBobbingFactor = 0.1
NewShipType.swayRotateFactor = 0
NewShipType.useTargetRandom = 1
NewShipType.targetRandomPointXMin = -0.5
NewShipType.targetRandomPointXMax = 0.5
NewShipType.targetRandomPointYMin = -0.65
NewShipType.targetRandomPointYMax = 0.45
NewShipType.targetRandomPointZMin = -0.9
NewShipType.targetRandomPointZMax = 0.6
NewShipType.dustCloudDamageTime = 160
NewShipType.nebulaDamageTime = 200
NewShipType.MinimalFamilyToFindPathAround = "MotherShip"
NewShipType.BuildFamily = "Frigate_Hgn"
NewShipType.AttackFamily = "Capturer"
NewShipType.DockFamily = "Corvette"
NewShipType.AvoidanceFamily = "Frigate"
NewShipType.DisplayFamily = "Frigate"
NewShipType.AutoFormationFamily = "Frigate"
NewShipType.CollisionFamily = "Big"
NewShipType.ArmourFamily = "MediumArmour"
NewShipType.UnitCapsFamily = "Frigate"
NewShipType.UnitCapsShipType = "CaptureFrigate"
NewShipType.fighterValue = 0
NewShipType.corvetteValue = 0
NewShipType.frigateValue = 10
NewShipType.neutralValue = 0
NewShipType.antiFighterValue = 0
NewShipType.antiCorvetteValue = 0
NewShipType.antiFrigateValue = 5
NewShipType.totalValue = 10
NewShipType.buildCost = 700
NewShipType.buildTime = 55
NewShipType.buildPriorityOrder = 30
NewShipType.retaliationRange = 5500
NewShipType.retaliationDistanceFromGoal = 160
NewShipType.visualRange = 1000
NewShipType.prmSensorRange = 5000
NewShipType.secSensorRange = 7000
NewShipType.detectionStrength = 1
NewShipType.TOIcon = "Diamond"
NewShipType.TOScale = 1
NewShipType.TODistanceFade0 = 9000
NewShipType.TODistanceDisappear0 = 7000
NewShipType.TODistanceFade1 = 4500
NewShipType.TODistanceDisappear1 = 3500
NewShipType.TODistanceFade2 = 12000
NewShipType.TODistanceDisappear2 = 35000
NewShipType.TOGroupScale = 1
NewShipType.TOGroupMergeSize = 0
NewShipType.mouseOverMinFadeSize = 0.045
NewShipType.mouseOverMaxFadeSize = 0.1
NewShipType.healthBarStyle = 1
NewShipType.nlips = 0.0001
NewShipType.nlipsRange = 6000
NewShipType.nlipsFar = 0.0001
NewShipType.nlipsFarRange = 10000
NewShipType.SMRepresentation = "HardDot"
NewShipType.meshRenderLimit = 13000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 1
NewShipType.minLOD = 0.25
NewShipType.goblinsStartFade = 1500
NewShipType.goblinsOff = 1500
NewShipType.upLOD = 2000
NewShipType.upLOD = 2500
NewShipType.downLOD = 2015
NewShipType.downLOD = 2515
NewShipType.minimumZoomFactor = 0.5
NewShipType.selectionLimit = 150000
NewShipType.preciseATILimit = 0
NewShipType.selectionPriority = 75
NewShipType.militaryUnit = 1
addAbility(NewShipType,"MoveCommand",1,0)
addAbility(NewShipType,"CanDock",1,0)
NewShipType.dockTimeBetweenTwoFormations = 1
NewShipType.dockTimeBeforeStart = 2
NewShipType.dockNrOfShipsInDockFormation = 1
NewShipType.dockFormation = "delta"
NewShipType.queueFormation = "dockline"
NewShipType.dontDockWithOtherRaceShips = 1
NewShipType.ignoreRaceWhenDocking = 0
addAbility(NewShipType,"CanLaunch")
NewShipType.launchTimeBetweenTwoFormations = 1
NewShipType.launchTimeBeforeStart = 2
NewShipType.launchNrOfShipsInDockFormation = 1
NewShipType.launchFormation = "delta"
addAbility(NewShipType,"ParadeCommand",1)
addAbility(NewShipType,"WaypointMove")
addAbility(NewShipType,"CaptureCommand",1,-50)
addAbility(NewShipType,"HyperSpaceCommand",0,1,200,500,0,3)
addAbility(NewShipType,"CanAttack",1,1,0,0,0.35,1.5,"Capturer, Corvette, Fighter, SmallCapitalShip, BigCapitalShip, Mothership","Frontal",{
Fighter = "MoveToTargetAndShoot",
},{
Corvette = "MoveToTargetAndShoot",
},{
Munition = "MoveToTargetAndShoot",
},{
SubSystem = "FrontalVsSubSystem",
})
addAbility(NewShipType,"GuardCommand",1,3000,600)
addAbility(NewShipType,"HyperspaceViaGateCommand",1,3,1,0.3)
addAbility(NewShipType,"CanBeCaptured",45,0.5)
addAbility(NewShipType,"CanBeRepaired")
addAbility(NewShipType,"RetireAbility",1,1)
LoadModel(NewShipType,1)
StartShipWeaponConfig(NewShipType,"Hgn_VulcanKineticTurretHeavy","Weapon_TurretTop","Weapon_TurretTop")
addShield(NewShipType,"EMP",220,20)
NewShipType.battleScarMaxTriBase = 75
NewShipType.battleScarMaxTriInc = 100
NewShipType.sobDieTime = 1
NewShipType.sobSpecialDieTime = 1
NewShipType.specialDeathSpeed = 40
NewShipType.chanceOfSpecialDeath = 0
NewShipType.deadSobFadeTime = 0
NewShipType.trailLinger = 4
setEngineBurn(NewShipType,6,1,1.5,60,1.01,0.1,0.25,120)
setEngineGlow(NewShipType,1,1,1.02,20,300,50,1.5,{
0.27,
0.47,
0.69,
0.25,
})
loadShipPatchList(NewShipType,"data:sound/sfx/ship/Hiigaran/Frigate/",0,"Engines/HFrigateEng","",1,"Ambience/HFrigateAmb","")

This is the End, :comp: :notadd:

Thx for all for documentation and explication but this only the begining

bye :joy:


Ps : are you know the utility of this line ? : GUID = {110, 91, 157, 190, 18, 23, 250, 78, 144, 20, 41, 246, 181, 128, 214, 12}

Thx

Last edited by KAHR-SIDIUS1 : 26th Dec 03 at 1:43 AM.
 
Old 26th Dec 03, 2:51 AM Child's Play Donator   # 25
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Heh, nice.
And yes, I also have experienced the fact that the AI only harvest and not attack. One of the few things I need to sort out before launching my own DEMO campaign.

Happy to hear that there are others active on the SP creation subject. Let me hear it when it's ready KAHR-SIDIUS1 :yippee:
Dark_Axel is offline  
Old 27th Dec 03, 8:21 AM Child's Play Donator   # 26
KAHR-SIDIUS1
Guest
 

yes thx

for you knowin, i have see in the scar.pdf file of relic

they speak, if we want have an AI difficulty,

we are join in the mission.lua the line

dofilepath("Data:ai/cpumilitary.lua")

or cpuresource.lua
or cpubuildsystem.lua
or cpuresearch.lua
or classdef.lua
or cpubuild.lua
or default.lua
or hiigaran_upgrades.lua
or vayg_upgrades.lua

i dont have try this but i think this good

but they speak soo, we have can to used the command line in .level

with a reactivefleettslot exemple of mission 11 of ascension campaign

addReactiveFleetSlot("Vaygr_AI_Carrier_Group", 3, 1, {-12387, 0, -20061}, 0, 0, 0, "Vgr_AssaultFrigate, Vgr_HeavyMissileFrigate")

But i don't know how is function and the differently param

trial and said me

but you have soo possibility to created a condition with sphere volume and united enemies lost for launch a new united for hyperspace .... see the post with marine frigate for used with an some modification

@+ :Slap:

Last edited by KAHR-SIDIUS1 : 27th Dec 03 at 8:24 AM.
 
Old 28th Dec 03, 12:32 PM Child's Play Donator   # 27
KAHR-SIDIUS1
Guest
 

Dark_Axel, i have an other problem :

i want make a Campaign Vaygr, my first trial was with an Hiigarans motherships and carrier but now when changed all hiigaran statement in Vaygr,

the Motherships Vaygr exit of hyperspace but i don't have Build something, are an idea or an anwer to resolved this problems ??

thx if you can give a code (or core) for just this in the .level or .lua

:rage:

@+
 
Old 28th Dec 03, 12:42 PM Child's Play Donator   # 28
RedXIII
Guest
 

Vaygr Carriers/Motherships cannot build Hiigaran ships, and vice versa.

I Am really looking forward to this. The modding group I am working with could use someone who can mod campaigns.
 
Old 29th Dec 03, 12:41 AM Child's Play Donator   # 29
KAHR-SIDIUS1
Guest
 

this is not my think,

i don't have build vaygr ships with a mothship vaygr or carrier vaygr in the solo campaign, and i don't knwow make this ????????? :?:

then i can build Hiigarans ships with a mothership Hiigaran or carrier Hiigarans !!!!!!!!!!!

please help me

thx :disagree:

Last edited by KAHR-SIDIUS1 : 29th Dec 03 at 2:27 AM.
 
Old 29th Dec 03, 6:44 AM Child's Play Donator   # 30
kurtdewolf
Guest
 

Check this out, it should help you with building other races.

http://forums.relicnews.com/showthr...highlight=build

http://forums.relicnews.com/showthr...highlight=build

http://forums.relicnews.com/showthr...highlight=build

If you search on build, (or whatever you want to know) It will give you a listing of posts to look through.

This has been done several times..

Hope this helps.
 
Old 30th Dec 03, 3:34 AM Child's Play Donator   # 31
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Have you set the player to the Vaygr race???

because a vaygr carrier under Hiigaran player can't build anything.
Dark_Axel is offline  
Old 31st Dec 03, 1:13 AM Child's Play Donator   # 32
KAHR-SIDIUS1
Guest
 

i have resolved a partial problems, i can build carrier vaygr from the mothership vaygr and whith the cariier i can build other ship vayrg, i have build an function from but, i have over problem, there are necessary to remove the carrier vaygr build in the queue of the Mothership but i don't know how to do it ????

my function

test if the player has an carrier vaygr in build queue
if yes give 1 to Variable
if no continuous the mainrule

and other function
test if variable is>0 and if the player has in awaken or sleeping carrier vaygr>0 and if number of CarrierVaygr is <3 (for 4 carrier max)
then
i give order to build and Vayg Carrier named in the ship script Hgn_Carrier2
but i don't have possiblility for the moment to remove older Vaygrcarrier belong to dockout of the mothership...

i think i have attacked to other way the problems

Thx for youre help kurtdewolf

@+ :thumb:

Last edited by KAHR-SIDIUS1 : 31st Dec 03 at 1:16 AM.
 
Old 31st Dec 03, 2:06 AM Child's Play Donator   # 33
WyvernNZ
Guest
 

Sorry I've taken so long to answer anything, I've been at home visiting my parents (no net connection).

Firstly, thanks to Dark_Axel for both trying to answer questions while I was away and for finding out how to run custom campaigns without overriding the ascension or tutorial campaigns.

I cant remember if this has been posted yet but this is the command line switch.
Code:
...\Homeworld2\Bin\Release\Homeworld2.exe -campaign CampaignName -startingLevel FirstLevel


That line will immediately start the campaign. It doesn't look like you are able to get to a mission selection screen like the ascesion one, but its one step closer

KAHR-SIDIUS1: I'll haven't looked anything to do with the ai just yet but I will do over the next few days, and I'll post here my findings

Other than that, happy New Years all, and I'm off to get drunk

-Wyvern
 
Old 31st Dec 03, 8:58 AM Child's Play Donator   # 34
KAHR-SIDIUS1
Guest
 

Happy new Years all

Thx WyvernNZ

i have resolved much problems

now, i can created an campaign vaygr, with Vaygr mothership and buildin CArrier shipyard and battlecruiser with building function for them

i can created event text for introduction the mission

i can build fighters from commstation or Chimera station

i can created and launch automaticly hiig assaultfrigate from chimerastation

i can give order to CPU for the battle...

and i can give a name for each player CPU or NOT in under ships

i have just an anomaly in the display of scoop under the desktop, the Capital ship are not their icons but an other icon unknow's ship :missile:

very good, now i can build mission campaign (simple with add functions )

i have soo changed the name of Tutorial menu to Campaign Vaygr :

the only thing i don't to do , this is created a voicespeech for the event or the animatic between mission :busted:

i don't know the custom of .lua and .nis files for speech and animatic :busted:


Good year for All :Pirate:



PS now, i have can build campaign with history of Makaan ascension in the territory Vaygr until he's attack the first(s) advancedpost of Hiigaran :fencing

Last edited by KAHR-SIDIUS1 : 31st Dec 03 at 9:06 AM.
 
Old 2nd Jan 04, 12:39 AM Child's Play Donator   # 35
KAHR-SIDIUS1
Guest
 

Good Year 2004 ; Bonne Année 2004 :nod:
 
Old 2nd Jan 04, 1:07 AM Forum Rules   # 36
Mikail
Lost in the Web...
 
Mikail's Avatar
 
Join Date: Jun 2003
Location: %HW2_ROOT%

Quote:
Originally posted by KAHR-SIDIUS1
Happy new Years all

Thx WyvernNZ

i have resolved much problems



For version 1, if you could just switch the fleets, that would be great. For version 2 you could change the written and recorded dialog.
Mikail is offline  
Old 4th Jan 04, 6:13 AM   # 37
KAHR-SIDIUS1
Guest
 

answer for you re problems Dark_Axel

Quote:
Originally posted by Dark_Axel
Heh, nice.
And yes, I also have experienced the fact that the AI only harvest and not attack. One of the few things I need to sort out before launching my own DEMO campaign.

Happy to hear that there are others active on the SP creation subject. Let me hear it when it's ready KAHR-SIDIUS1 :yippee:




You re problems is in the .level file RaceId chooce :

raceId=1 for the player X (cpu or human) to know whitch play with Higgarans units)
raceId=2 for Vaygr ; raceId=3 for Keeper raceID=4 for Bentusi )
for RaceID (3 or 4 i don't have try) 0 is not playable race !!!!! :dyn:

exemple for

maxPlayers = 3;

--PlayerInfo: info on each possible player in this level
player = {};

-- id=0 is for human player
player[0] = {
id = 0,
name = "Hiigaran",
resources = 950,
raceID = 1,
startPos = 0,
}

player[1] = {
id = 1,
name = "", You Can write Vaygr but the game play with nothing between ""
resources = 3000, and give hime Rus :skull:
raceID = 2,
startPos = 1,
}

player[2] = {
id = 2,
name = "Vaygr",
resources = 3000,
raceID = 0,
startPos = 2,
}


you can add this in more efficently (for exemple)

--Transporteur enemie
addSquadron("Vgr_carrier1", "Vgr_carrier", {10500, 50, 5100}, 1, {20, 20, 20}, 0, 0)
createSOBGroup("Enemie")
addToSOBGroup("Vgr_carrier1", "Enemie")
addReactiveFleetSlot("Enemie", 1, 1, {10500, 50, 51000}, 0, 0, 0, "Vgr_carrier1")

addReactiveFleetSlot("Enemie", 1 << the 1 is id of player, the second 1 is for difficulty of game the 1 id always good for more ...


good play

Last edited by KAHR-SIDIUS1 : 4th Jan 04 at 8:36 AM.
 
Old 14th Jan 04, 1:59 AM Child's Play Donator   # 38
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Thanx...
BTW I tried this also, before I started asking around about the AI...

Quote:
we are join in the mission.lua the line

dofilepath("Data:ai/cpumilitary.lua")

or cpuresource.lua
or cpubuildsystem.lua
or cpuresearch.lua
or classdef.lua
or cpubuild.lua
or default.lua
or hiigaran_upgrades.lua
or vayg_upgrades.lua


But it didn't work...
It's not accepted...

O, BTW do you know how to use the reactivefleet systems??
I would love to hear about it, so that I can use it ass well to add some difficulty settings....

If you can help me with the AI then you just earned a spot in the credits list... :devil:

Last edited by Dark_Axel : 14th Jan 04 at 8:22 AM.
Dark_Axel is offline  
Old 14th Jan 04, 8:25 AM Child's Play Donator   # 39
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

O, and.... the level and lua files are a bit BIG on the moment...
And then I haven't even started on the complexity it has...

My mission has some side quest and multiple triggers, so it is hard to see things. But if you want I can send you the files so you can take a peak and help me if you see something....

Or just add me in MSN... I'm from Holland so we're in the same timezone. Talks easier....
Dark_Axel is offline  
Old 14th Jan 04, 10:29 AM Child's Play Donator   # 40
KAHR-SIDIUS1
Guest
 

the reactivefleet is very impressive, the only thing i can said this :

the reactivefleet is used for the ship created in the begining game (in the .level ship)

this is not necessary to see in the map

we can created ship with (the 1 for hyperspace), after you created a group and your send the ships in this group, after in the m01.lua, you created the if then .... function to activated your ship when the player arrived to the X position or if is destroyed the Y ship

an exemple

in the m01.level


addSquadron("playerships", "Hgn_interceptor", {15000, 50, 15100}, 0, {20, 20, 20}, 0, 0)


createSOBGroup("Pships")
addToSOBGroup("playerships", "Pships")

--to target the area
addSquadron("Hgn_interceptor", "Hgn_interceptor", {-20500, 900, 0}, -1, {20, 20, 20}, 0, 0)
addsphere("target",{-20500, 900, 0}, 1000)

-- 1000 is volum

addSquadron("Vgr_carrier1", "Vgr_carrier", {10500, 50, 5100}, 1, {20, 20, 20}, 0, 1)
addSquadron("Vgr_battlecruiser1", "Vgr_battlecruiser", {10500, 50, 5150}, 1, {20, 20, 20}, 0, 1)

createSOBGroup("Safeships")
addToSOBGroup("Vgr_carrier1", "Safeships")
addToSOBGroup("Vgr_battlecruiser1", "Safeships")

addReactiveFleetSlot("Safeships", 1, 1, {10500, 50, 51000}, 0, 0, 0, "Vgr_carrier1, Vgr_battlecruiser1")

--addReactiveFleetSlot("Enemie", 1 << the 1 is id of player, the second 1 is for difficulty of game the 1 id always good for more ...


in the m01.lua add this


if (SobGroup_IsInVolume("Pships","target")>0) then

SobGroup_ExitHyperSpace("Safeships","target")
--The Interceptor is used 1*, the carrier arrived 1X
SobGroup_Clear("Pships")
end

Attention see well the letters H or h and etc .... for not crash

if you can printer the scar.pdf for the relic tools in the paper to see the all function possible and the detail, this is the only soluce

@+
 
Old 15th Jan 04, 1:13 AM Child's Play Donator   # 41
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Wait a minute...

Quote:
SobGroup_ExitHyperSpace("Safeships","target")
--The Interceptor is used 1*, the carrier arrived 1X
SobGroup_Clear("Pships")
end


the carrier arrived 1x.... So you can have it set to spawn 1, 2 or more units (copied) depending on difficulty???

:Pirate: Cool.... lets get it in battle...

BTW I already use similar commands like spawn them in....
For instance I hyper-in a carrier and at the same time spawn in and dock instant a group of fighters, who are scripted to luanch...

Last edited by Dark_Axel : 15th Jan 04 at 1:19 AM.
Dark_Axel is offline  
Old 15th Jan 04, 9:20 AM Child's Play Donator   # 42
KAHR-SIDIUS1
Guest
 

yes, you can created an other carrier with the some carrier but only the first carrier has destroyed, then you can re-used the old carrrier to second tactics.

verify the code, i can forbiden thing in (i have build code from my code but with changed (modification))

@+
 
Old 15th Jan 04, 9:47 AM Child's Play Donator   # 43
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Right...

So, my current list of problems is this...
1)no way of controlling cpu AI, the scar document states that it should be possible. But no documentation is available right now.
2)I don't have any engine or weapon sounds. Music and speech works. No idea why... can you check that problem Khar-Sidius1 with your level???

Lack of custom campaign slelection, but Geoff stated that they will look into it in the future.

And some minor other issues which aren't important....
Maybe we should ask one of the relic people for advice, especially the undocumented AI section.

O, and I fully tested the AI in my level. The enemy group, which consist of 3 Vaygr carriers, 2 destroyers and a cruiser. Only start producing ships for defence when I lay siege upon them....
So how the heck do I tell them to start attack the player at a given moment????
Dark_Axel is offline  
Old 16th Jan 04, 10:51 AM Child's Play Donator   # 44
KAHR-SIDIUS1
Guest
 

1 if you can controlled the Cpu IA, you are doing desactivated the autocontrol IA with this command CPU_Enable(1,0)

the 1 is for Id player ---- the 0 is disable autoAI 1 enable Auto AI attention id disable all function of Ia disable move and harvest soo then you can created the new IA setup in the m01.lua or created 1 IA in Auto IA and the second IA in Manual

and for the IA is your enemie really :

SetAlliance(2,0) -- create alliance between 2 and 0
--- 2 is for Id Player2 0 for humanplayer0

BreakAlliance(1,2) -- the player 1 and 2 are enemies
we can created the command in the 2x
exemple between player 1 and 2
BreakAlliance(1,2) for think of player 1
BreakAlliance(2,1) for think of player 2

idem for set alliance

exemple, created the sobgroup for humanplayership of beging game, or created 1 volumesphere A

you can created the if then else with the scar function

exemple when the Humanshipscarrier arrive in position of the sphere A then the Enemies ships exit of hyperspace and attack ships in the Volumesphere,

if you have a enemie carrier, you have the possibility with no ressource for created the ship automaticly

to used scar function with sobgroup, used the query sobgroup table or action sobgroup table, see and test,

i build an other mission, i try to resolved youre problems but 1 wait a moment thx

sorry for my bad english, i speak french

at tomorrow
 
Old 17th Jan 04, 6:14 AM Child's Play Donator   # 45
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Well, heck... we'll see....
Anyway, the level is almost done...
A couple of days to improve it... (damm, editing in notepad is time consuming and hard :comp: )

And then I will send a BETA version in a few days to you all...
Then you can see it for yourselfs and add comments...

Hopefully it will be perfect after that...
It will be my first release... :angel:

O, and I already noticed that you we're french...
I'm dutch BTW.... Glad that there are Frenchmen who talk English...

Je ne parle bien francais...
Dark_Axel is offline  
Old 9th Feb 04, 7:09 AM Forum Rules   # 46
Mikail
Lost in the Web...
 
Mikail's Avatar
 
Join Date: Jun 2003
Location: %HW2_ROOT%

Could you modify this tutorial so that it doesn't override the Ascension campaign?

[edit] Also, when using the command-line switch, do you use the actual name of the level file, or just "1" for mission 1?

Is the raceID for Hiigaran 1 or 0?

Last edited by Mikail : 9th Feb 04 at 9:47 AM.
Mikail is offline  
Old 9th Feb 04, 10:29 AM Child's Play Donator   # 47
Dark_Axel
Member
 
Dark_Axel's Avatar
 
Join Date: Nov 2002
Location: Netherlands

Haven't seen WyverNZ around lately (for the past weeks)
But I'm sure he will update it whenever he is back. Anyway, you can easily change the campaign and level files to your own liking.

But because of current limitations of HW2 it won't show any other campaign except the ascension file. To get you campaign working you need to add it in the command line menu.

-campaign mycustomCampaign -startingLevel mycustomMap

Where in the name can be changed to whatever you want, example...

DEMO.campaign
DEMO\M01_DEMO\M01_DEMO.level

Should be called upon with the following commandline...
"-campaign demo -startlevel M01_DEMO"

Unfortunately this will drop you right into the level, and afterwards will go back to the original menu and thus the original campaign. But I have good hopes that this will be 'improved' whenever a next patch is called upon.

race ID (Hiigaran = 1, Vaygr = 2).
Dark_Axel is offline  
Old 9th Feb 04, 12:11 PM Forum Rules   # 48
Mikail
Lost in the Web...
 
Mikail's Avatar
 
Join Date: Jun 2003
Location: %HW2_ROOT%

In the tutorial you list both datfiles.lua and Datafiles.lua.
Which is it?

[edit] Also, in the tutorial, the spelling of the sobgroup "MotherShip" is inconsistent.

There's an instance where "end" is spelled "End".

I finally got the tutorial to work. However, the mothership doesn't exit hyperspace near the camera. I had to search for it.

I get all kinds of crap like this in my HW2.log:

Code:
Cannot overwrite function HW2_rgb Cannot overwrite function HW2_SubTitleEvent Cannot overwrite function HW2_LocationCardEvent Cannot overwrite function HW2_CameraRotated Cannot overwrite function HW2_CameraPanned

Last edited by Mikail : 9th Feb 04 at 3:03 PM.
Mikail is offline  
Old 9th Feb 04, 4:49 PM Forum Rules   # 49
Mikail
Lost in the Web...
 
Mikail's Avatar
 
Join Date: Jun 2003
Location: %HW2_ROOT%

For the purpose of comparison, I've uploaded a campaign that should represent what the final product will be. You can compare the source to your own progress.

DOWNLOAD:
http://www.geocities.com/mikehorvath.geo/homeworld.htm

Please notify me of any errors.

Last edited by Mikail : 9th Feb 04 at 5:19 PM.
Mikail is offline  
Old 9th Feb 04, 5:17 PM   # 50
Yoris
Guest
 

I think it's totally cool you guys are working on SP campaigns. Although I know diddly about HW2 modding at this point, I'd like to learn. I have so many cool ideas, and HW2 offers amazing possibilities.:moose:
 
Closed Thread



Go Back   RelicNews Forums > RDN - Relic Game Mods > Homeworld 2 - Tanis Shipyards
User Name
Password
Register FAQ Members List Arcade Mark Forums Read



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




All times are GMT -7. The time now is 4:55 AM.

Page generated in 0.98886299 seconds (95.20% PHP - 4.80% MySQL) with 9 queries

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.