Jump to content

Adding new campaigns


Recommended Posts

You would need to provide all the files and data you find referenced in campaign.2da. (I think the best example is how EET handles SoD).

About GUI I have no deep experience but you probably need to add your campaign to BGEE.lua

 

A number of things depend on how your campaign integrates in the game, i.e is it separate like the pits or is it somewhere in the sequnce of BG1 - SoD - BG2 - ToB.

For my own *campaigns* SandrahRtF and ToT which follow after ToB I have not done all this although I once considered it. I decided against it as the only way for transit was to play ToB until the very end and make a decision with the Solar there. So I instead added my mods in form of additional chapters after ToB. http://gibberlings3.net/forums/index.php?showtopic=27913&do=findComment&comment=242897

 

All this is from memory, I had discussed that with k4thos at the time when my decision was due and he offered assistance if I would really have done it, but he has not been around here for several months now. I am sorry but I deleted the PM exchange we had on the subject when it became clear how I would handle my case, the helpful detail was in it (at least it indicates that in principle it can be done).

Edited by Roxanne
Link to comment

I don't think the Bhaalspawn needs to go Planehopping, but they could. >.>

 

I am pretty comfortable with setting up the campaign.2da appropriately but I have absolutely no idea how to incorporate it into the UI. Shame that k4thos isn't around to answer questions about it; he seemed to think it was pretty easy to add new campaigns to the Select Campaign function.

Link to comment

I don't think the Bhaalspawn needs to go Planehopping, but they could. >.>

 

I am pretty comfortable with setting up the campaign.2da appropriately but I have absolutely no idea how to incorporate it into the UI. Shame that k4thos isn't around to answer questions about it; he seemed to think it was pretty easy to add new campaigns to the Select Campaign function.

Just an idea for testing

In BGEE.lua

START_CAMPAIGN_BG1 = 1,

START_CAMPAIGN_SOD = 2,

START_CAMPAIGN_SOA = 3,

START_CAMPAIGN_TOB = 4,

START_CAMPAIGN_BP1 = 5,

START_CAMPAIGN_BP2 = 6,

START_CAMPAIGN_TUT = 7, >>> the tutorials, use them for your trial

Replace the TUT entries in campaign.2da by your settings and see how it works.

Link to comment

Aquadrizzt, yes, it's easy. And the current UI code supports unlimited amount of campaigns (scrollbar will show up if there is not enough space in the book.)

 

All you need to do is:

1. Choose your campaign ID, let's say it will be "AQU"

2. Create a constant value and variable that will be used in GUI for your campaign.

COPY_EXISTING ~bgee.lua~ ~override~
    REPLACE_TEXTUALLY ~START_CAMPAIGN_TUT = 7,~ ~START_CAMPAIGN_TUT = 7,
   START_CAMPAIGN_AQU = 8,~

It needs unique number so better code could be written to detect all currently occpied campaign numbers rather than just setting it as 8 but this is just a quick example. This number will be than used not only in UI.MENU but also as a way to get correct BAM images displayed (this number corresponds to cycle number in BAM files with logos, titles and campaign icons) and stored in Baldur.lua (that config file in "My documents") when the campaign is chosen (Active Campaign).

 

3. Add your campaign to CAMPAIGN.2DA and reference 2DA files, movies etc. that will be used by it. Open CAMPAIGN.2DA to see what each column is used for (you will find self-explanatory names in the first row) For example:

APPEND ~CAMPAIGN.2DA~ ~AQU            BALDUR         -1             2              INTERDIA       *              MASTAREA       33             -1             *              *              PDIALOG        save           STARTARE       STRTGOLD       STARTPOS       *              *              *              *              WORLDMAP       BALDUR         1              0xFFFFFFFF     1              INTRO15F       PARTY          INTERACT       YEARS          REPUTATI       CLASTEXT       RACETEXT~

4. Add your campaign title and description:

COPY_EXISTING ~M_EET.lua~ ~override~
    REPLACE_TEXTUALLY ~eetStrings = {~ ~eetStrings = {
    EET_CMP_TEXT_AQU = "Your campaign description",
    EET_CMP_TITLE_AQU = "Your campaign title",~

You can evaluate the text during installation of course to support different languages.

 

5. Add code to UI.MENU:

COPY_EXISTING ~UI.MENU~ ~override~
//append to function onCampaignButton(buttonNum)
    REPLACE_TEXTUALLY ~Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_TUT)~ ~Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_TUT)
        elseif(buttonNum == const.START_CAMPAIGN_AQU) then
            startEngine:OnCampaignButtonClick('AQU',true)
            Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_AQU)~

Title image, big logo and small icon needs to be added to appropariate BAM files but I've recently written code that can patch BAM v2 files without problems (for now implemented in Lava's mods like Souther Edge if you need reference), so you don't have to overwite whole file, just append to it new art. Let me know if you need help with it.

Edited by K4thos
Link to comment

I'm going to necro this rather old thread, even knowing k4thos is not around, in hopes that someone might have some updated knowledge about how to make this work? I am trying to get the IWD1 and IWD2 campaigns added to the EET "choose campaign" screen when they are added by tipun's mods. I've got everything worked out except the UI.menu stuff:

On 6/29/2017 at 5:06 PM, K4thos said:

5. Add code to UI.MENU:

COPY_EXISTING ~UI.MENU~ ~override~
//append to function onCampaignButton(buttonNum)
    REPLACE_TEXTUALLY ~Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_TUT)~ ~Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_TUT)
        elseif(buttonNum == const.START_CAMPAIGN_AQU) then
            startEngine:OnCampaignButtonClick('AQU',true)
            Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_AQU)~

Title image, big logo and small icon needs to be added to appropariate BAM files

His post must have been written before EET v13, because this stuff does not exist in UI.menu when EET v13 is installed.

I also don't know what has to happen with the icons. I have small 32x32 icons for IWD1 and IWD2, but I don't know how they should be copied in; and I don't know what characteristics the "large" icon or "logo" files should have.

Any help appreciated, this is the last thing I need to figure out before I can install and start beta-testing...

Link to comment

That UI.MENU step got simplified, I'm not even sure if it's needed at this point. The block looks like this in my EET BG2 testrun,. not assuming UI mods or EET_GUI or stuff like such:

	function onCampaignButton(buttonNum)
		if startCampaignData[buttonNum] ~= nil then
			startEngine:OnCampaignButtonClick(startCampaignData[buttonNum].id,true)
			Infinity_SetINIValue('Program Options','Active Campaign',buttonNum)
		else
			startEngine:OnCampaignButtonClick('BG1',true)
			Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_BG1)
		end
		currentCampaign = buttonNum
	end

 

Link to comment

Oh I think I see. Seems like the buttonNum variable stands in for whichever campaign you click. And I’m guessing it refers to the numbers defined in M_k#tbl.lua, to which I’ve already appended the proper information. 

So now just need to see what is supposed to happen with the campaign icons. Presumably I can find examples buried somewhere in EET itself, in how it adds the BG1/SoD/BP1 icons. 

Edited by subtledoctor
Link to comment

Actually, you need to expand M_K#TBL.lua.

{id = 'BG1', name = 'EET_CMP_TITLE_BG1', description = 'EET_CMP_TEXT_BG1', title = 0, bigLogo = 0, icon = 0, background = 2, button = 2, sidebar = 2, importEnabled = false, tutorialEnabled = false, forceParty = false, cheatAreasTable = cheatAreas},

id: 3-char uid

name: title defined in eetStrings at the bottom of M_K#TBL.lua

description: expanded desc, same location as title

title: frame index in TITLE.BAM

bigLogo: frame index in BIGLOGO.BAM

icon: index in CMPGEET.BAM (this one already includes the IWD icons)

background/button/sidebar/importenabled: lazy to look these up

tutorialEnabled: enables the tutorial button

forceParty: skip single-char generation dialog

cheatAreasTable: lists the areas available to the area jump list - default ones are in BGEE.LUA, you can define your own block in an M_XX.LUA.

I'm not sure, but you might need to expand bioClassData and bioRaceData wiith new coloumns for description.

Edited by Graion Dilach
Link to comment
3 hours ago, Graion Dilach said:

Actually, you need to expand M_K#TBL.lua.

Yes, I've already got this set up.

3 hours ago, Graion Dilach said:

title: frame index in TITLE.BAM

bigLogo: frame index in BIGLOGO.BAM

icon: index in CMPGEET.BAM (this one already includes the IWD icons)

Ah, that's the info I was looking for! Nice. I'm sure I can work with this.

3 hours ago, Graion Dilach said:

forceParty: skip single-char generation dialog

I assume this means it takes you to full-party generation - this is set to 'true' for BP1 and BP2 so I have it set to true for IWD1/IWD2 as well.

3 hours ago, Graion Dilach said:

cheatAreasTable: lists the areas available to the area jump list - default ones are in BGEE.LUA, you can define your own block in an M_XX.LUA

Ah, interesting. I suppose this won't be too hard to do, though I'm not sure it's worth the effort for an alpha/proof-of-concept version... if people wanna cheat-code themselves around the world, why stop them?

EDIT - or wait, by "area jump" does it mean this defines which areas are available on the worldmap?

3 hours ago, Graion Dilach said:

you might need to expand bioClassData and bioRaceData wiith new coloumns for description

I can't quite tell how this is supposed to work. I see the function in M_k#eet.lua, but in my EET install these seem to be blank? From M_k#tbl.lua:

-- class, kit, clastxtBIO: BG1, SOD, SOA, TOB, BP1, BP2, TUT, (...)
bioClassData = {
}

-- race, racetextBIO: BG1, SOD, SOA, TOB, BP1, BP2, TUT, (...)
bioRaceData = {
}

 

Edited by subtledoctor
Link to comment

Well. It installs fine, I can pick the IWD and IWD2 campaigns just fine, but beginning IWD1 results in CTD immediately after selecting the difficulty level. Beginning IWD2 results in a black screen with no UI after the game logo cinematic - I hear the scrolling chapter text but don't see it, then I can hear the opening conversation with Hendron but cannot see anything or interact with anything. I can use the keyboard to navigate blindly through the conversation, and I think it works in the UI afterward - when I hit [Esc] the music volume is lowered, like I just opened the menu - but I can see anything that is happening.

EDIT - weirdly, if I start a new BG2 game and console warp to Targos Docks (IW1000.are), it gives me the opening movie and scrolling chapter text, and starts the dialogue with Hendron and I can play normally (and an 8th-level barbarian can die tot he axe blows of six goblins). So something is specifically breaking with the game-start process.

If I warp to the Winter's Cradle Tavern (ID1006.are), I get the IWD1 opening movie/narration thing, then it sort of hangs; I can press escape to exit the cinematic (which, notably, will not be possible on an iPad) and then it puts me in the tavern and starts the introductory convo with Hrothgar. That goes fine, but the area is not rendered, it is a black screen with some people standing around. I can leave the tavern to Easthaven, then go back into the tavern and it renders fine. So there is clearly something wrong with that opening cinematic and the transition from it to gameplay.

EDIT 2 - this has all been worked out now. Nice. 

Edited by subtledoctor
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...