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

Solved The Building Set for PotC

The Buildingset has reached a new stage. Thanks to the cooperation of people from all over the world we have now Buildingmodels that can really change the looks of locations for good, so that it will be hard to recognize that e.g. Marigot on St Martin is made from the FdF model. Simply use these itemnames in the Buildingset commands:

"keep"
"bastion"
beautiful 17th century fortifications made by Captain Caceres (converted to GM by Chocolate Bill)

"tower"
"townwalls"
not so beautiful fortifications by me <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

"jungle"
An idea by Screwface: a large stretch of forest that can be used to change the looks of outside locations (turns a rocky shore into a lush mangrove swamp).

"college"
"church"
"barracks"
"warehouse"
"shipyard"
"windmill"
Some very nice CR3 buildings that Maximus kindly submitted. They are big and distinct, ideal to change the looks of entire townquarters. The shipyard actually provides all shipyardservices if you talk to the shipwright in front of it.

"windmillfan"
is a furnishing for the "windmill" building(which is a milltower withOUT fan). Both must be built in one command like:

Build_at("Antigua_outskirts", "windmill", "windmillfan", -3.0, 6.0, 43.0, -3.0, "building");


Maximus was so kind to provide even more models: the DESTROYED ruin versions of the buildings above. Those are not yet in the Buildingset, but I put them in Maximus_buildings.zip on the FTP so that you can have a look at them. If you have a use for them we can add them to the Buildingset as well.

Too bad that I can't post screenshots here anymore, but I put some .jpgs onto the FTP, into the "ccc_Buildingset" folder, where you'll find the whole update Buildingset_upd23Feb.zip as well.
 
CCC

Fantastic job on the mod!! Thank you for spending your time to make it, I really enjoy the spice it adds. I do have one small problem tho. In the latest update this code causes me to crash.

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
// ccc Feb06  use fixed date at gamestart
    if( !CheckAttribute(Environment,"date") )
    {    
        lcn.building.(nr).taxDay = 15;
        lcn.building.(nr).taxMonth = 4;
        lcn.building.(nr).taxyear = 1690;
    }else{
        lcn.building.(nr).taxDay = GetDataDay();
        lcn.building.(nr).taxMonth = GetDataMonth();
        lcn.building.(nr).taxyear = GetDataYear();
    }
// Feb06 end
<!--c2--></div><!--ec2-->

its good code, but including that means my game won't even start. I'm assuming im missing some file where that 'Environment' parameter is defined. any ideas? Thanks again.
 
I hate to bug you with more stuff but i have another small bug/glitch.

First off in regards to the above, it got fixed while i was trying to determine the cause of the below.

The observatory and the mansion are not working for me. With the mansion it doesn't matter whether I make it an HQ or a brothel. Trying to figure out if some of my files were messed up, I uninstalled PotC completely (deleted the program files folder too), reinstalled, reapplied all the mods and still no luck.

Whenever I speak to the NPC for either the mansion or the obs my game goes into what seems like an infinite loop. Its still running, but the screen no longer updates and controls don't work. If I alt-tab to task manager PotC is only using about 60-70% cpu cycles. This even happens when I use the sidestep to hack through the wall in greater oxbay and talk to the mansion npc there, exact same freeze. No crash just total lock of PotC, I have to end task and restart the game.

The only thing I thought of is that there is a conflict between the building set and one of the other build mods in my particular configuration. This is not the case however. I started a new game with the default buildsettings.h and everything worked fine. So one by one I put all me settings changes back in and still everything is green. Reproducing this error has really been a time sink for me. Anyway I finally found the combo I think.

Eureka! I did find it, tho its not what I orignally thought. The problem is Portugal! I haven't tested with all flags yet, but if your last 'at sea' flag was portugal then you cannot talk to her without causing the freeze! 'at sea' meaning the last flag you were displaying when you were out actually sailing your ship. Tho this kinda sucks for me cause I like to play as a pirate hunter, friendly to all save them, at least now i can work around it. I loaded my old save and tested this successfully also. So far it works fine if your last 'at sea' flag was pirate, britain, france, or spain. I even tried building and using it as spain, then switching to portugal setting sail and returning. Lock up! I can however build it as spain, then switch to portugal and use it ok. If i go out to sea as portugal and return tho kaboom!

So, summary. Building Set dos not work completely (mansion and observatory) if your last 'at sea' flag was portugal. Something to do with a 'GetHostileNation' or something returning a NULL maybe? I dunno if that function even exists but thats my guess. I'll take a look now that I have an idea of whats going on.

P.S. My apologies for the lengthy rambling nature of this post. I started writing it, would think of something else to test. Go test it, come back write some more, test again, etc etc. this post was written over several hours.
 
So my guess was maybe pretty close but I dont know the game well enough to say.
from this code in CCCFunctions.c

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
int RandomEnemyNation(ref chr)
{
  // check if there are any enemy nations at all
  for(int i = 0; i < MAX_NATIONS; i++)
    {
        if(GetRMRelation(chr, i) <= REL_WAR && iNation != PIRATE)
        {
          // then get ANY random enemynation
        int iNation = makeint(Rand(MAX_NATIONS));
        while(GetRMRelation(chr, iNation) > REL_WAR  || iNation == PIRATE)
        {
             iNation = makeint(Rand(MAX_NATIONS));
        }
         return iNation;
      }
  }
  return -1;
}
<!--c2--></div><!--ec2-->

How does this even compile? your using iNation in your if check prior to its declaration. Unless PotC has some weird syntax I'm unaware of. I'm guessing this function got butchered during a find & replace or copy paste job. I think this is more along the lines of what you meant to do.

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
int RandomEnemyNation(ref chr)
{
    int iNationID;

    // check all the nations
    for ( iNationID = 0; iNationID < MAX_NATIONS; iNationID++ )
    {
        // but skip the bloody pirates!    
        if ( iNationID == PIRATE )
            continue;

        // is this one hostile?
        if ( GetRMRelation(chr, iNationID) <= REL_WAR )
            return iNationID;
    }

    // couldn't find a hostile so pick a random one
    iNationID = rand(MAX_NATIONS);

    // keep choosing 'til we get one that is not a pirate
    while ( iNationID == PIRATE )
    {
        iNationID = rand(MAX_NATIONS);
    }
    return iNationID;
}
<!--c2--></div><!--ec2-->

I think it would be cooler to return the most hostile nation that isn't a pirate. Like if I'm at 0 with everyone except spain where my relation is -1, then we want to return spain. This is how im doing it now, and its working with no problems.

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
int RandomEnemyNation(ref chr)
{
    // the current nations ID and relation value
    int iCurrID, iCurrRel;

    // the Least friendly nations ID and relation value
    int iLeastRel, iLeastID;

    // the Most friendly nations ID and relation value
    int iMostRel, iMostID;



    // assume id 0 (england) 'til we run the sort
    iLeastID = iMostID = 0;

    // set both least and most to id 0's relation
    iLeastRel = iMostRel = GetRMRelation(chr, 0);

    // run through all the nations to find the real least and most friendly
    for (iCurrID = 0; iCurrID < MAX_NATIONS; iCurrID++ )
    {
        // but skip the bloody pirates!
        if ( iCurrID == PIRATE )
            continue;

        // get the current nations relation
        iCurrRel = GetRMRelation(chr, iCurrID);

        // is the current nation less friendly then the least?
        if ( iCurrRel < iLeastRel )
        {
            // yup it is, save it as the new least
            iLeastID  = iCurrID;        
            iLeastRel = iCurrRel;
        }

        // or is the current relation more friendly than the most?
        if ( iCurrRel > iMostRel )
        {
            // Curr becomes the new most
            iMostID  = iCurrID;
            iMostRel = iCurrRel;
        }
    }

    // now we have the most and least friendly nations. If they are different
    //     than the Least friendly has the greatest hostility so return that one
    if ( iLeastRel != iMostRel )
        return iLeastID;

    // if we fall here then all relations are equal so we'll choose a random one
    iLeastID = rand(MAX_NATIONS);

    // keep choosing 'til we get one that is not a pirate
    while(iLeastID == PIRATE)
    {
        iLeastID = rand(MAX_NATIONS);
    }
    return iLeastID;
}
<!--c2--></div><!--ec2-->

this is assuming of course im reading your code correctly in that a smaller number is more hostile. Like -20 is more hostile then -12. Obviously my way is a lot more bloated and complicated, but i like it better <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

I hope this helps. Cheers!


edit:
I changed what the variable names meant a little cause this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
     if ( Current < Most )
          Most = Current
<!--c2--></div><!--ec2-->
just looked funny to me.
 
<!--quoteo(post=140561:date=Feb 24 2006, 11:32 PM:name=rags707)--><div class='quotetop'>QUOTE(rags707 @ Feb 24 2006, 11:32 PM) [snapback]140561[/snapback]</div><div class='quotemain'><!--quotec-->
... My apologies for the lengthy rambling nature of this post. ...
<!--QuoteEnd--></div><!--QuoteEEnd-->
Posts of that kind can't be lenghty enough <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> After all you have not only reported a bug but also already cause and solution <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />

RandomEnemyNation looks indeed wrong. Strange thing is, why hasn't this popped up before? FAIK PotC wouldn't even start with an undeclared variable <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" /> Anyway, your version looks good, and if it works I'll put yours in the updated update. Thanks a lot in advance <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

Do I understand you right, the stuff concerning the starting date works now for you? No changes necessary there?
 
When I placed every map in his right directory, i tried to start POTC, but I got an error log. I mean i got an error log by the storm engine screen.
 
To CCC : Why did you initialise the SaintMartin locations in the Antigua file ? Does it work for you? How did you make the connection between the sea anchor locators and the land without updating the islands_init.c file for stMartin ?

Your new jungle model is very good but it is no textured for me <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
Thanx Couch cap'n Charles! I appreciate the appreciation! I spent a considerable amount of time hunting this down.

Yes your reading right, the first problem was solved when I reinstalled all the mods from scratch. The first time I put your latest update on, I manually edited each file. Obviously I missed something so thats why it was crashing.

But I'm happy to report that everything is running smooth now and my bitches are making me mad cash!

<img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

As to why this hasn't popped up before, There is only one possible explanation. YOUR ALL A BUNCH OF FILTHY PIRATES!!! or at least you don't sail for portugal which is the same thing in my book :p . I like flying thiers 'cos it leaves you neutral with everyone but the pirates. anyway.....

PotC's syntax is a little weird in some respects. As a c++ guy i sometimes forget what I can and cannot do in straight c, Plus the constraints are tighter with PotC i think. my first version of the function was like this for the for loop:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
for (iCurrID = 0; iCurrID < MAX_NATIONS; iCurrRel = GetRMRelation(chr, ++iCurrID) )
{
        // code here
}
<!--c2--></div><!--ec2-->

I like doing multiple updates in one line if i can (get the relation and increment with the prefix op), but PotC apprently does not!!! Actually PotC would not allow me to use the prefix ++ operator at all which i find strange as its slightly faster than the postfix since the cpu doesn't have to preserve the original value, it can just update the value it has immediately. Is this a PotC thing or just a C thing that I've forgotten?? I dunno. Took me another 20 minutes or so tho to figure out why the new function was crashing, but whatever. As I said its running great now, and I didn't have to abandon my save game and start from scratch which makes me happy.

Thanks again man, keep up the good work!

P.S. if i can help out with any other area's code wise or bug hunting in your mod or the build overall let me know. I don't normally have the large blocks of freetime I did today to devote to it, but when I do its available if you care to utilize it.
 
<!--quoteo(post=140515:date=Feb 24 2006, 03:07 AM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Feb 24 2006, 03:07 AM) [snapback]140515[/snapback]</div><div class='quotemain'><!--quotec-->
Too bad that I can't post screenshots here anymore, <!--QuoteEnd--></div><!--QuoteEEnd-->

CCC and Petros,a little off topic but just to let you all know,file attachments has been fixed by Keith,so you can now upload pictures using file attachments function <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Could these bugs be caused because CCC's code isn't entirely based on the latest modpack version? When I had a look at CCC's code, I saw some differences with the latest Post Build 12 mods, so that might've been the cause...? <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
I have looked through the code of this mod, but have not found any Build_at() codes that add buildings to Philipsburg and Marigot. Did you forget to add that into the update? <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
I hope you can still send the files including this code; the pictures of those ports look very nice indeed! <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />
 
<!--quoteo(post=140603:date=Feb 25 2006, 05:15 AM:name=rags707)--><div class='quotetop'>QUOTE(rags707 @ Feb 25 2006, 05:15 AM) [snapback]140603[/snapback]</div><div class='quotemain'><!--quotec-->
... There is only one possible explanation. YOUR ALL A BUNCH OF FILTHY PIRATES!!! or at least you don't sail for portugal .....<!--QuoteEnd--></div><!--QuoteEEnd-->
<img src="style_emoticons/<#EMO_DIR#>/24.gif" style="vertical-align:middle" emoid=":rofl" border="0" alt="24.gif" />
Aye that Matey
Welcome aboard! <img src="style_emoticons/<#EMO_DIR#>/sailr.gif" style="vertical-align:middle" emoid=":sail" border="0" alt="sailr.gif" />
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->
P.S. if i can help out with any other area's code wise or bug hunting in your mod or the build overall let me know. I don't normally have the large blocks of freetime I did today to devote to it, but when I do its available if you care to utilize it.
<!--QuoteEnd--></div><!--QuoteEEnd-->
Your help is needed and is greatly appreciated <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />


<!--quoteo(post=140630:date=Feb 25 2006, 08:43 AM:name=skull)--><div class='quotetop'>QUOTE(skull @ Feb 25 2006, 08:43 AM) [snapback]140630[/snapback]</div><div class='quotemain'><!--quotec-->
<!--quoteo(post=140515:date=Feb 24 2006, 03:07 AM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Feb 24 2006, 03:07 AM) [snapback]140515[/snapback]</div><div class='quotemain'><!--quotec-->
Too bad that I can't post screenshots here anymore, <!--QuoteEnd--></div><!--QuoteEEnd-->

CCC and Petros,a little off topic but just to let you all know,file attachments has been fixed by Keith,so you can now upload pictures using file attachments function <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
<!--QuoteEnd--></div><!--QuoteEEnd-->

Allriiiiiiiight! <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />

Life get's simple again ... well almost. <img src="style_emoticons/<#EMO_DIR#>/smile2.gif" style="vertical-align:middle" emoid=":))" border="0" alt="smile2.gif" />
 
I just noticed another small glitch. When you dismantle buildings its possible to go over your max crew.
If you use the 'AddCharacterCrew' function from characterutilite.c that should take care of it.
 
Sry if I'm wrong but I don't see your folder in the FTP. Although I might be typing in the FTP wrong. If someone could give me the corrct ftp that would be great. <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Chunk, the FTP info is stickied here on the forums

<a href="http://forum.piratesahoy.net/index.php?showtopic=978" target="_blank">http://forum.piratesahoy.net/index.php?showtopic=978</a>
 
<!--quoteo(post=140687:date=Feb 25 2006, 07:59 PM:name=rags707)--><div class='quotetop'>QUOTE(rags707 @ Feb 25 2006, 07:59 PM) [snapback]140687[/snapback]</div><div class='quotemain'><!--quotec-->
Chunk, the FTP info is stickied here on the forums

<a href="http://forum.piratesahoy.net/index.php?showtopic=978" target="_blank">http://forum.piratesahoy.net/index.php?showtopic=978</a>
<!--QuoteEnd--></div><!--QuoteEEnd-->

Probably shudda checked there first.... <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />

thanks
 
Thanks for your feedback everybody <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> Unfortunately I am hardly at home these days to take care of your reports, so I'd suggest that you use this update only with utmost care or not at all for the time being.

I hope I can make an update next week, this time including all files for the St Martin locations(not finished yet) and the missing jungle textures <img src="style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid=":wp" border="0" alt="whistling.gif" />
 
CCC,

"b_fortifications.c"

missing 4 semi colons.

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
// first 2 missing semi's on line 45
if ( NPChar.chr_ai.group==LAI_GROUP_PLAYER ){adress = " Commander, Sir, "}else{adress = ""}

  ///////////////
// change to //
if ( NPChar.chr_ai.group==LAI_GROUP_PLAYER ){adress = " Commander, Sir, ";}else{adress = "";}



// other 2 missing line 67 + 68
if(rand(100)>50) {Link.l1.go = "attack1"}
else{Link.l1.go = "attack2"}


  ///////////////
// change to //
if(rand(100)>50) {Link.l1.go = "attack1";}
else{Link.l1.go = "attack2";}
<!--c2--></div><!--ec2-->

l8r!
 
Thanks a lot. I'll add that into the next update. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
Back
Top