• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Merging "No Resurrection" Code

Jack Rackham

ex train dispatcher
Quest Writer
Storm Modder
When I tested looting muskets in the start of Ardent storyline it happened I got killed in the prison.
I was reincarnated in a tavern room and the officers joined me outside. But, I think it may be quest breaking as
I didn't get any continuation to the jungle etc.
 
When I tested looting muskets in the start of Ardent storyline it happened I got killed in the prison.
I was reincarnated in a tavern room and the officers joined me outside. But, I think it may be quest breaking as
I didn't get any continuation to the jungle etc.
Maybe the character attribute that disables resurrecting should be added to the player for such cases?
I remember adding support for something like that a while back.

@Grey Roger wouldn't get to notice that, because I know he plays with Resurrection OFF.
So good thing that you found out! :cheers
 
How do I arrange for continuation after a tavern resurrection? I didn't even think about it, partly because indeed I always play with resurrection off, and partly because I assumed the tavern resurrection automatically sent you back to where you'd come from. For all that I don't like the resurrection process myself, I know some people do, and would rather accommodate them if possible than force my non-resurrection policy on them.
 
I have resurrection off often during my quests simply because of situations like this.
 
If you set pchar.killed = true; , then resurrection is stopped and when you die, you die.
With that, you could have it disabled in crucial points and enable it again elsewhere.

Other than that, "resurrection" will teleport you to the "best" tavern it can find.
This is based on a town on the same island as your ship; and it tries to find a friendly one if it can.

There is technically nothing in place to prevent continuation of your game after being resurrected like that.
But of course when it triggers in the middle of a quest scene, you need to pre-define a way for the story to pick up again.
Having a location-specific quest that re-starts the story might be an option.
Then if you pass the "risk of dying" point, you can remove that "location-specific quest" and everything goes back to normal.

That way, if you don't die, you don't notice anything special.
But if you do die, you can trigger that pre-set quest and the story starts again from that.
 
The sensible move might be to use 'PChar.killed = true' to prevent resurrection until you actually have a ship, which won't be until you've escaped prison, rescued the crew, returned to town and (optionally) already been to the tavern to learn more about the payroll ship. Or, at the very least, until you're out of prison, by which time the quest condition to exit town on the way to rescue the crew should be set. Getting resurrected to the tavern when you're still supposed to be in prison could indeed be a problem so that, at least, will need to be prevented.

@Jack Rackham: just to confirm, did you resurrect to Havana tavern or to somewhere else?
 
If 'PChar.killed = true' forces the player to not be resurrected, does 'PChar.killed = false' mean you will be resurrected, or does the "Survival" setting in "Options" still take effect?
 
The sensible move might be to use 'PChar.killed = true' to prevent resurrection until you actually have a ship, which won't be until you've escaped prison, rescued the crew, returned to town and (optionally) already been to the tavern to learn more about the payroll ship. Or, at the very least, until you're out of prison, by which time the quest condition to exit town on the way to rescue the crew should be set. Getting resurrected to the tavern when you're still supposed to be in prison could indeed be a problem so that, at least, will need to be prevented.
That does sound like a good idea. :yes

If 'PChar.killed = true' forces the player to not be resurrected, does 'PChar.killed = false' mean you will be resurrected, or does the "Survival" setting in "Options" still take effect?
No, because it just checks for the presence of that attribute to determine if you are "killed for good".
If you would want that effect from 'PChar.killed = false', it should be quite possible to add that.

I recently moved the related code to PROGRAM\Loc_ai\LAi_fightparams.c if I recall.
Search for "killed" in that file and hopeflly you'll find the resurrecting section.
 
No, because it just checks for the presence of that attribute to determine if you are "killed for good".
If you would want that effect from 'PChar.killed = false', it should be quite possible to add that.
No, I want it to obey what you've set in "Options"! What I don't want is, having set 'PChar.killed = false' when you're clear of the prison, for the game to disregard the "Survival" setting and always resurrect you, as that would ruin the gameplay for me. If the situation is:
PChar.killed = true - disregard "Survival", death means death
PChar.killed = false - obey "Survival", death means resurrection if a check against your "Survival" setting passes
then that's fine.
 
No, I want it to obey what you've set in "Options"! What I don't want is, having set 'PChar.killed = false' when you're clear of the prison, for the game to disregard the "Survival" setting and always resurrect you, as that would ruin the gameplay for me. If the situation is:
PChar.killed = true - disregard "Survival", death means death
PChar.killed = false - obey "Survival", death means resurrection if a check against your "Survival" setting passes
then that's fine.
'PChar.killed = false' would actually do exactly the same as 'PChar.killed = true' because I just wrote the code to check if that attribute exists at all.
So to reset it back to normal, use this instead:
Code:
DeleteAttribute(PChar, "killed");

You get resurrected when this section of code is allowed to add the "NoSave.Resurrection" attribute:
Code:
    if (rand(100) + (makeint(chr.skill.Sneak)*3) >= DEATHRATE && !CheckAttribute(chr,"killed") && !bSuppressResurrection) // SJG
     {
       //ccc new survival section
       // KK -->
       string loc = "";
       if (CheckAttribute(chr, "location")) loc = chr.location;
       if (GetCharacterShipType(chr) != SHIP_NOTUSED) loc = GetCharacterShipLocation(chr);
       string TownID = GetBestTown(loc);
       // <-- KK
       
       if (TownID != "")
       {
         if(GetIslandIDFromTown(TownID) == "Redmond" && CheckAttribute(chr,"quest.Rdm_officiant") && chr.quest.Rdm_officiant == "Claire")
         {
           ResurrectingOfficiant = characterFromID("Redmond_officiant_jrh"); //JRH
         }
         else ResurrectingOfficiant = GetTownOfficiant(TownID);

         if (GetNationRelation2MainCharacter(GetTownNation(TownID)) == RELATION_ENEMY && CheckAttribute(ResurrectingOfficiant, "resurrection.shore") == true && FindLocation(ResurrectingOfficiant.resurrection.shore) > 0) {
           chr.location.from_sea = ResurrectingOfficiant.resurrection.shore;
           PlaceFleetNearShore(chr.location.from_sea);
         }
         if (chr.location.from_sea == "Muelle_shore_02") {
           chr.location.from_sea = "Muelle_port";
           PlaceFleetNearShore(chr.location.from_sea);
         }
         chr.NoSave.Resurrection = 1; // PB: Lock the main menu
       }
     }
So that happens when that first if-statement returns 'true'.
 
I have used these ones

Pchar.quest.disable_rebirth = "yes"; no rebirth
Pchar.quest.disable_rebirth = "no"; rebirth

referring to Seadogs.
 
I have used these ones

Pchar.quest.disable_rebirth = "yes"; no rebirth
Pchar.quest.disable_rebirth = "no"; rebirth

referring to Seadogs.
Hmm.... maybe we should replace those with
PChar.killed = true;
and
DeleteAttribute(PChar, "killed");

Otherwise there are two independent systems for the exact same things.
The "killed" method has the bonus of being meant for more general use.
After my rewrite of last month, that also influences the "Resurrection CTD prevention".

Even better would probably be to rename "killed" to "disable_rebirth" because that IS actually a more accurate description of it.
If you agree, it is easy enough to do a search-and-replace to get both in line. :yes
 
I was saying that if you don't object, I could do that too.
Should be simple enough. ;)
 
Let me know what you eventually choose to call it because I'll need to use the final version as well.
 
My intention is to rename the "killed" attribute to "disable_rebirth" and then change everything to match with that.
I'd suggest sticking with "killed" for now, until the global rename is done.
If you upload your files with "killed" in place before we do that search-and-replace, then your files will automatically be included in the process too. :yes
 
Except that almost as soon as I've uploaded the files, I work on them again to progress the storyline. And at the moment I'm only disabling and re-enabling resurrection for the prison escape scene, as that's the one which will certainly be broken if you get killed while in prison and resurrected outside prison. So it's best if I replace "killed" with "disable_rebirth" when necessary, then when I upload the next version you don't need to search and replace again.
 
Back
Top