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

POTC running on Storm 2.5 engine

Nice find mate, it would take more than changing c files though, character animations for POTC does not work well with AOP engine and NK reinitiate code would need to be rewritten to be compatable AOP engine, <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
<!--quoteo(post=179295:date=Jan 17 2007, 01:10 PM:name=skull)--><div class='quotetop'>QUOTE(skull @ Jan 17 2007, 01:10 PM) [snapback]179295[/snapback]</div><div class='quotemain'><!--quotec-->
Nice find mate, it would take more than changing c files though, character animations for POTC does not work well with AOP engine<!--QuoteEnd--></div><!--QuoteEEnd-->

That I was affraid of, because porting AoP character animations into POTC can be a bit to tricky...
Well, the other way around is to take POTC maps, quests, models and put into AoP. I think that one is impossible indeed ;-)
 
Every now and then, a guy thinks he will get far in trying to adapt the AoP engine to PotC and everytime the attempt fades as he realizes this is not possible. So, I settled with the fact that I am wasting my time here just for the fun of it - with the possible fact in mind, that I might be talking to myself here <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

So, I created a testbed folder, throw in the library of AoP and on top of this, threw in the /resouces/ folder from PotC. True, it worked all the way to the main screen, with some PotC build image I havent seen before ("Ya be warned") in the background and what could be two sets of buttoms to the right. The visible and clickable PotC B13 buttoms and a set of invisible AoP buttoms in a invisible background layer. Clicking the "New game" released a set of images of Blaze Devlin and Beatrice, each choosable but thats it, and a "X" to go back in the top. Other buttons like "save" and options released the AoP credits screen, some weird screen with (null) values on top and a clickable layer beneath that would´nt take me anywhere. Yes, basically everything was a mess, but at least I removed the AoP loading image of the wheel by deleting a section from the AoP engine.ini.

Hungry for more, I started replacing the AoP seadogs.c with the one from PotC, and I started to debug using the error.log and replacing file after file in the /programs/ folder one by one. Had some troubles underway, as there is no /programs/scripts/ folder in PotC, but deleting it made seadogs.c happy.

Now, I have a problem with seadogs.c, as error.log says:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->COMPILE ERROR - file: seadogs.c; line: 110
Invalid Expression
COMPILE ERROR - file: seadogs.c; line: 110
Invalid Expression
COMPILE ERROR - file: seadogs.c; line: 110
Invalid Expression
COMPILE ERROR - file: seadogs.c; line: 110
Invalid Expression
COMPILE ERROR - file: seadogs.c; line: 110
Invalid Expression
COMPILE ERROR - file: seadogs.c; line: 110
Invalid Expression
COMPILE ERROR - file: seadogs.c; line: 110
Invalid Expression
COMPILE ERROR - file: seadogs.c; line: 110
missed ')'<!--c2--></div><!--ec2-->

Line 107-112 in the PotC seadogs.c says:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// added by MAXIMUS -->
void GetInterfaceParameters()
{
    if(bNewInterface) ReinitNewInterface();
    else ReinitOldInterface();
}<!--c2--></div><!--ec2-->

Can anybody help me with this one? Commenting it out only release an errorlog complaining about line 116...
 
Interesting. I wish you the best of luck with this! <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
I'll see what I can do to help.

First of all, which game version are you trying to port to AoP? Build 13 Final?

I think the problem *might* be that "bool bNewInterface = false;" is defined in globals.c, so if you don't have that in there, it will cause an error. Try putting that in and see if that solves it. What's on line 116?
 
Yes, I am using B13 Final. And thank you for helping me out. Of course, bNewInterface was not even defined in globals.c and of course I had no idea about the bNewInterface function was referring to and should be defined in globals.c - thx! <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Probably you'll run into plenty of these kind of things in the future. Just post here if you have a problem. One thing that helps: If you add the PotC folder to your Windows indexing service, you can search for a term in your folder and it will also search IN the files' text. That is incredibly useful when figuring out where what code is used. Not sure if it works in Windows XP; it does in Vista.
 
and why are you sticking your tongue out, mister thomas? <img src="style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> it looks like you are. <img src="style_emoticons/<#EMO_DIR#>/smile2.gif" style="vertical-align:middle" emoid=":))" border="0" alt="smile2.gif" />
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Also works in xp<!--QuoteEnd--></div><!--QuoteEEnd-->
<img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />
 
Great! That makes things a lot easier. <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />
 
Actually, this is the point where things get a little out of perspective.Replacing one file at the time in the AoP /programs/ and subfolders library with those from PotC means, there are now two sets of files, asking for both games´ each defined funtions. Should I incorporate the AoP lines needed by the compiler to the PotC files i replaced them with, or should I just replace everything with the PotC files once and for all? Because the paths has already started to spread out and pretty soon I will not be able to keep track of the many balls in the air (what function is defined in what file and what more functions does it deploy, that also needs declaration). Maybe its not so bad, here is why I am worried, starting with the error.log:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->native function 'XI_MakeNode' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_DeleteNode' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_WindowShow' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_WindowDisable' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_IsWindowEnable' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_WindowAddNode' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_CreateFolder' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_CheckFolder' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_DeleteFolder' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_FindFolders' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'DialogAssembleStr' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'DialogAddParamToStr' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_StoreNodeLocksWithOff' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_RestoreNodeLocks' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_IsKeyPressed' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'XI_RegistryExitKey' not declared
COMPILE ERROR - file: interface\utilite.c; line: 15
native function 'AddControlTreeNode' not declared<!--c2--></div><!--ec2-->
Now, the PotC utilite.c file does not contain these XI-declarations, but the backup folder /interface/utilite.c from AoP does. Should I open the can of coding whoopass: incorporate the definitions from AoP?

PS: Actually, I have replaced most files in the programs library with PotC files by now. I dont know WHAT is calling for the XI-functions, that is not incorporated in the PotC files.

PPS: Runtime-wise, I have reached the point AFTER the initialization screen and the loading screen changes the screen solution. Maybe its good, maybe its bad. But further that I hoped for, actually.
 
If the code is asking for unexisting functions, the solution would be to add these functions to the code. So I'd say: Add the AoP functions into the PotC code. If, in the end, these functions are no longer used, they won't be called and it won't hurt to have them in there. What you can also do is to add your PROGRAM folder to the Windows Indexing Service and search in your PROGRAM folder for "XI_MakeNode" to see where this functions is called.
 
Hi,

I merged the AoP and PotC files /interface/utilite.c completely into one, it was very timeconsuming but it did the trick. Of course, it only leads on to another problem, which is the AoP folder /program/scripts/, that does not appear in stock or build PotC. In this folder, the file officers.c appear, for which i need a function declaration in the utilite.c file, this function (..and probably all of them in the future)

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->int GetHireOfficersQuantity(aref BeginOfficer)
{        
    string sIsland = Locations[FindLocation(pchar.location)].fastreload;
            
    int iResult = 0;
    for(int i =0; i<MAX_OFFICERS; i++)
    {
        if (officers.colony == sIsland)// && officers.hired == "0")
        {
            if(iResult == 0)
            {
                BeginOfficer = i;
            }
            iResult++;
        }
    }
    return iResult;
}<!--c2--></div><!--ec2-->

I put the function into the utilite.c file where the declaration was needed:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> if(fillCode==3) // officer for hire
    {
        int BeginOfficer;
        int GetHireOfficersQuantity(aref BeginOfficer)
        {
            
            string sIsland = Locations[FindLocation(pchar.location)].fastreload;
            
            int iResult = 0;
            for(int i =0; i<MAX_OFFICERS; i++)
            {
                if (officers.colony == sIsland)// && officers.hired == "0")
                {
                    if(iResult == 0)
                    {
                        BeginOfficer = i;
                    }
                    iResult++;
                }
            }
            return iResult;
        }

        q = GetHireOfficersQuantity(&BeginOfficer);
        for(n=BeginOfficer; n<(BeginOfficer+q); n++)
        {
            cn = Officers[n].character;
            if( cn>=0 && sti(Officers[n].hired) == 0)
            {
                AddFaceGroup(strAccess,"FACE128_"+Characters[cn].faceID);
            }
        }
    }<!--c2--></div><!--ec2-->

My problem is now, that error.log says
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->COMPILE ERROR - file: interface\utilite.c; line: 489
Duplicate variable name: BeginOfficer<!--c2--></div><!--ec2-->
and if i comment the "int BeginOfficer;" out in the above, this happens
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->COMPILE ERROR - file: interface\utilite.c; line: 492
Invalid Expression<!--c2--></div><!--ec2-->
Multiple times written, of course.

After the last compiling, my notepad++ didnt work anymore and it needs reinstallation. But since your site is down, could you please send the installation file to:
riveost@gmail.com

Thx in advance <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Wow thats fast?! Thx Thomas <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Hmm; you lost me, Peter. <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />
You could try to PM Pirate_KK. Also it might help if you post the full file zipped here so that we can have a look at it. <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />
 
Thank you. I zipped the officers.c (from /scripts/) and the utilite.c (from /interface/) into the file AoP_to_PotC.zip on the Files FTP. I dont know how to link directly to the ftp (yet <img src="style_emoticons/<#EMO_DIR#>/blush.gif" style="vertical-align:middle" emoid=":eek:ops" border="0" alt="blush.gif" /> )

But please don´t sit up late looking at it, its newyears eve tomorrow and I know for my part, that I wont be looking at this until next year <img src="style_emoticons/<#EMO_DIR#>/boom.gif" style="vertical-align:middle" emoid=":boom" border="0" alt="boom.gif" />
 
You can link to the FTPs with www.pafiles.com/potc and www.pafiles.com/build . I'll have a look at those files tomorrow if I don't forget. It's already past midnight here. Time to quit.
 
<!--quoteo(post=229255:date=Dec 31 2007, 12:49 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE(Pieter Boelen @ Dec 31 2007, 12:49 AM) [snapback]229255[/snapback]</div><div class='quotemain'><!--quotec-->You can link to the FTPs with www.pafiles.com/potc and www.pafiles.com/build . I'll have a look at those files tomorrow if I don't forget. It's already past midnight here. Time to quit.<!--QuoteEnd--></div><!--QuoteEEnd-->
Now, I am past that point and new problems are of course coming up. I just finished dealing with globals.c and of course seadogs.c (for the time being) and its been a couple of days since utilite.c also stopped complaining. But now a new file is just coming up...

This way of porting it is an excessive workload, that you just dont start doing if you dont know exactly what you are doing.

It was actually really exciting, how you can just put the PotC /resources/ folder on top of the AoP game, let it compile and see that at least SOMETHING is showing up on the screen, but I am afraid I miss the "exactly" part of the above mentioned sentence. And as such, I am going to have to give up. But I am still glad I tried <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> And who knows, maybe someone else might continue this some day? Anyway, thanks a lot for your help, Pieter and Thomas.
 
Back
Top