• 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!

Recoding the ransom mod

fudge dragon

Landlubber
Storm Modder
I have recently been working on the ransom dialogs, I have so far attempted to make it possible to take their money and kill them (very piratey -6 rep though) and I intend to include a small quest to claim ransom from the governor if the prisoner does not have as much money as the ransom amount (The governor will be as backstabbing as a pirate though)

However whenever I run the game, I encountered and coders nightmare! The cannot load dialog bug. My error.log reports this.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->COMPILE ERROR - file: dialogs\English\Prisoned_dialog.h; line: 1
Invalid array 'DLG_TEXT' initialization parameters list
COMPILE ERROR - file: dialogs\Prisoned_dialog.c; line: 465
invalid case syntax<!--c2--></div><!--ec2-->

I have been unable to figure out whats wrong with the top one and here is the offending code and down (if I comment out the bad code it moves down and complains about the next case, and the next case was a copy paste from previous cases.)


<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        case "exit_ransom_conform";
                if(prisonRansomCost>sti(NPChar.Money))
                    {
                PlayStereoSound("INTERFACE\took_item.wav");
                AddMoneyToCharacter(PChar,sti(NPChar.Money));
                    }
                else
                    {
                PlayStereoSound("INTERFACE\took_item.wav");
                AddMoneyToCharacter(PChar,prisonRansomCost);
                    }
                    dialog.Text = DLG_TEXT[57];
            Link.l1 = DLG_TEXT[58];
            Link.l1.go = "exit_ransom";
            Link.l2 = DLG_TEXT[59];
            Link.l2.go = "exit_ransom_denied";
        break;

        case "exit_ransom_denied";
            dialog.Text = DLG_TEXT[60];
            Link.l1 = DLG_TEXT[61];
            Link.l1.go = "exit_ransom_sharks";
        break;
        
        case "exit_ransom_sharks";
            ChangeCharacterReputation(pchar, -6);
                    Lai_SetActorType(NPChar);
            LAi_ActorTurnToCharacter(NPChar, PChar);
            LAi_ActorAnimation(NPChar, "afraid","", 10);
            DeleteAttribute(NPChar,"prisoned");
            DeleteAttribute(NPChar,"status");
            RemovePassenger(PChar,NPChar);
            if(CheckAttribute(NPChar,"ransom")) DeleteAttribute(NPChar,"ransom");
            ChangeCharacterAddressGroup(NPChar, "None", "", "");
            object SharksFader;
            CreateEntity(&SharksFader, "fader");
            SendMessage(&SharksFader, "lfl", FADER_IN, 0.5, true);
            StartVideo("Sharks_attack");
            DialogExit();
        break;<!--c2--></div><!--ec2-->

If anyone could cast their code eye over this snippet and tell me why its moaning at me would be appreciated (I even offered it Rum! But It still didn't work)

<i>(Note to the original author, I have changed as little of your code as posible, mine is encluded in if() statements burred within yours)</i>
 
What Build version are you using at the moment? Build 13 or Build 14 Alpha?

Did you add any new dialog cases? If so, make sure you also increase the number at the first line of ENGLISH\Prisoned.h:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string DLG_TEXT[53] = { // <-- This number must be as high as the number of added dialog lines
"Mercy! What destiny have I been allotted by thy cruel machinations? You have my life in your hands!",
"You're quite a useless fellow. I think to ransom your maggot infested hide for whatever value it may be worth. Say for about, ",
"You may consider yourself lucky. Thanks to people like you, I don't have enough officers. Would you want to serve as an officer on my ship?",
"Oh, I'm sorry, but the crew longs to see ye as a bloody lump of meat. Well, I guess I'll just have to swab my splintery deck with your face.",
"Shut up.",<!--c2--></div><!--ec2-->

I hope this helps.
 
I’m currently using build 13 update 2. I have heard rumours that the build 14 alpha is none to stable at the minute. (Then again neither was the build 13 alpha, but I have a craving to actually finish the game for once, I either always encounter a bug, or we get a restart required build release).

I thought I had increased that value. But you never know. I may have miscounted the number of new dialog strings. I’ll check later. I currently on a laptop in school, and sadly, POTC is crash heavy on it. Even more so if I install the build. This particular 1.46GHz with half a gig of RAM just ‘aint up to it. The “Mobile Intel® 945GM Express” Graphics card probably lets it down.
 
<!--quoteo(post=182410:date=Feb 8 2007, 03:42 AM:name=fudge dragon)--><div class='quotetop'>QUOTE(fudge dragon @ Feb 8 2007, 03:42 AM) [snapback]182410[/snapback]</div><div class='quotemain'><!--quotec-->
I’m currently using build 13 update 2. I have heard rumours that the build 14 alpha is none to stable at the minute. (Then again neither was the build 13 alpha, but I have a craving to actually finish the game for once, I either always encounter a bug, or we get a restart required build release).

I thought I had increased that value. But you never know. I may have miscounted the number of new dialog strings. I’ll check later. I currently on a laptop in school, and sadly, POTC is crash heavy on it. Even more so if I install the build. This particular 1.46GHz with half a gig of RAM just ‘aint up to it. The “Mobile Intel® 945GM Express” Graphics card probably lets it down.
<!--QuoteEnd--></div><!--QuoteEEnd-->


Fudge Dragon, if you ever get this mod working let me know....I think this is a mod I would like to have....seems an ideal way of lowering your reputation.....hehe....I can see a pirate as dashing...but if a pirate is a hero to the masses then something is drastically wrong LOL
 
I'm not quite sure of myself, but I would try to use ':' rather then ';' at the end of each cases, like this :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        case "exit_ransom_denied":
            dialog.Text = DLG_TEXT[60];
            Link.l1 = DLG_TEXT[61];
            Link.l1.go = "exit_ransom_sharks";
        break;<!--c2--></div><!--ec2-->

and not

<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--> case "exit_ransom_denied";
dialog.Text = DLG_TEXT[60];
Link.l1 = DLG_TEXT[61];
Link.l1.go = "exit_ransom_sharks";
break;<!--QuoteEnd--></div><!--QuoteEEnd-->
 
<!--quoteo(post=182485:date=Feb 8 2007, 08:16 PM:name=a simple virtual sailor)--><div class='quotetop'>QUOTE(a simple virtual sailor @ Feb 8 2007, 08:16 PM) [snapback]182485[/snapback]</div><div class='quotemain'><!--quotec-->
I'm not quite sure of myself, but I would try to use ':' rather then ';' at the end of each cases, like this :

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        case "exit_ransom_denied":
            dialog.Text = DLG_TEXT[60];
            Link.l1 = DLG_TEXT[61];
            Link.l1.go = "exit_ransom_sharks";
        break;<!--c2--></div><!--ec2-->

and not

<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--> case "exit_ransom_denied";
dialog.Text = DLG_TEXT[60];
Link.l1 = DLG_TEXT[61];
Link.l1.go = "exit_ransom_sharks";
break;<!--QuoteEnd--></div><!--QuoteEEnd-->
<!--QuoteEnd--></div><!--QuoteEEnd-->

Thanks for the help there. That worked. Cases are still a part of C im not to good with.

Gotta get the rest of the mod sorted now.

Just out of interest, just how much rep do i need to take off to make it realy bad
 
from best to worse is a 100 points, i think.

if anyone wants me to change hero into legend, just say so and tell me which file should be adjusted.
 
I got the basic mod fuctions done now. I was gonna put what I got so far on the FTP but well I cant get on. Ever moving forward <img src="style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" />
 
Apparently the FTP is still down. If you want to make a file available, put it up for download from somewhere else. Or you can ask Pirate_KK to upload it to my webspace; he should have access there.

<!--quoteo(post=182603:date=Feb 9 2007, 05:08 PM:name=morgan terror)--><div class='quotetop'>QUOTE(morgan terror @ Feb 9 2007, 05:08 PM) [snapback]182603[/snapback]</div><div class='quotemain'><!--quotec-->
if anyone wants me to change hero into legend, just say so and tell me which file should be adjusted.
<!--QuoteEnd--></div><!--QuoteEEnd-->
RESOURCE\INI\ENGLISH\common.ini
 
Could someone check something for me. My prisoners names have all vanished. I have only just realised but I have a feeling its been like it for a while. Problem is I don't know whether it was caused by my additions to the Prisoned_Dialog.c or something in the update as I was working on it when I applied the update (Prisoned_Dialog.c wasn't changed but I'm just wondering if it was something somewhere else)

If someone could check and see if the have the same problem it would be appreciated.
EDIT: Strangely enough my latest batch of prisoners have preserved their names. Must have been a relic from back when I was testing, Still I'd be interested to see if anyone else has encountered this.
 
fudge dragon, your bug is caused by sinking or selling the ship that the prisoners are on. or at least that's what happens with me. with me, i can then also use the prisoners as officers without hireing them. really wierd.

should this:

string = iHero,"Hero"

look like this:

string = iHero,"Legend"

or this:

string = iLegend,"Legend"

? i think that i should leave the first bit as hero, as that could play an important part in programming. but i'm not sure at all sbout this. i'll leave the first bit as it is and only change the second bit to be sure. if that desn't work, i'll change the rest of it.

i have also corrected a few minor spelling mistakes in maximus' tavern games.
 
string = iHero,"Legend" That is the right one. cause in the code hero is referened as HERO and if you change the first HERO to legend, the game doesn`t reconigze it. Let say, everything that is before the = have to stay the same.
 
ok! <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> here's the file:
 
Where's that monkey. I want to shoot something <img src="style_emoticons/<#EMO_DIR#>/guns.gif" style="vertical-align:middle" emoid=":2guns" border="0" alt="guns.gif" />

Fraid this is gonna be on hold for a while. All my memory in my computer has blown. I'm running on an old 256 stick but as my laptop has more than that and refuses to run the build and all its trimmings I've decided to go on hold till I can acquire a new gig or 2.

Oh well. I better just be thankfull I didn't have to reinstall.
 
guess me file ain't so popular! <img src="style_emoticons/<#EMO_DIR#>/huh.gif" style="vertical-align:middle" emoid=":huh" border="0" alt="huh.gif" /> it does work, by the way.
 
I think that it is not very much downloaded, because some people don`t mind that there is such little file changed.
 
well, little things need to be done too. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Could someone check something for me. My prisoners names have all vanished. I have only just realised but I have a feeling its been like it for a while. Problem is I don't know whether it was caused by my additions to the Prisoned_Dialog.c or something in the update as I was working on it when I applied the update (Prisoned_Dialog.c wasn't changed but I'm just wondering if it was something somewhere else)<!--QuoteEnd--></div><!--QuoteEEnd-->I recall seeing nameless characters every now and then. Some of them are nameless because their names aren't in characters_names.txt, but I think it's a different problem for prisoners. Not sure what the problem is though. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Back
Top