Good evening,
I've spent some time the past two weeks trying to achieve continued playing after a failed boarding attempt, I think this should allow the option for playing without ever needing to reload due to game restrictions.
Started out with a toggle, but I think basing it on the survival chance should be enough, refraining from adding more toggles to internal settings.
After I identified to relevant pieces of code (I believe), I've got several options doing parts of what I was trying to achieve, but not one without issues.
So here I am again, frustrated as I seem unable to find out why exactly it behaves strangely.
The most workable solution so far was to use GameOverE, which has me ending up in a dinghy, but it behaves strangely.
I'm getting the lock to F1 as if I had died on land (telling me to wait for the tavern medics to leave) and at the same time I fail to clear the boarding scene.
I found the culprit not allowing me to go to the main menu, but I'm totally unable to tell where it is disabled again, NoSave.Resurrection == false and similiar attempts did not work for me either.
Code:
if(CheckAttribute(GetMainCharacter(), "NoSave.Resurrection"):
{
LogIt(TranslateString("", "You can't save or load until") + " " + GetMyFullName(ResurrectingOfficiant) + " " + TranslateString("", "leaves."));
return;
}
But as far as I could tell, the boarding code is all over the place in several files and folders, same with land fights, it seems. I have gone through 30+ ´files and tried to find out how to clear the whole boarding scene properly, to no avail. Nothing I've tried seems to be the function which is responsible. Is anyone familiar with that system by any chance? I'm out of ideas where else to look/what else to try.
Or perhaps there is a chart displaying the logic behind the many files, where often several seem to address some aspect of the same functionality?
As it stands now, my change, while technically working, is totally not playable and without help I won't be able to get it working properly, but I suspect it's just a minor step to finalize.
I'm already able to direct sail, sail-to and use the worldmap, but once I enter land-mode, the previous boarding scene is placed over the actual environment, which blocks me from doing anything but fast-travel.
Here is GameOverE for your reference:
Code:
void GameOverE()
{
ref mc = GetMainCharacter();
if(rand(100) + (sti(mc.skill.Sneak)*3) > DEATHRATE) // BF mar05
{ //ccc new survival section
// KK
if (HasSubStr(mc.ship.type, "Tartane") == true || mc.ship.type == "Gunboat") {
GameOverOrg("sea");
DeleteSeaEnvironment();
return;
}
// <-- KK
Event("DoInfoShower","sl","MainMenuLaunch",true); //TIH - black out the screen to hide uglyjunk
LAi_SetCurHPMax(mc);
mc.lost.ship.type = GetCharacterShipID(mc); // PB: So you can get her back if necessary
GiveShip2Character(mc,SHIP_LIFEBOAT,"Lifeboat",-1,GetServedNation(),false,false);
// KK -->
SetCharacterGoods(mc, GOOD_BALLS , 0);
SetCharacterGoods(mc, GOOD_GRAPES , 0);
SetCharacterGoods(mc, GOOD_KNIPPELS, 0);
SetCharacterGoods(mc, GOOD_BOMBS , 0);
AddCharacterGoods(mc, GOOD_WHEAT , 2);
AddCharacterGoods(mc, GOOD_RUM , 2);
// <-- KK
mc.lifeboatlaunch = true; //TIH - better check for when they sank
Sea_ReloadStart();
PostEvent("DoInfoShower",100,"s",""); //TIH - clears black screen
PlaySound("#ship_sinking"); //ccc mar20 // KK
Log_SetStringToLog(TranslateString("","You manage to launch a boat in the last moment.")); //ccc mar20
Log_SetStringToLog(TranslateString("","With a few mates you escape from disaster.")); //ccc mar20
} else { //ccc call original GameOver function
GameOverOrg("sea");
DeleteSeaEnvironment();
return;
}
}
Also, attached the sea.c file and internal settings, I believe I didn't change anything else for more direct encounters to work.