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

More officer Models

Aconcagua

Sailor Apprentice
Storm Modder
Was disappointed by the little number of officer models, so I had a look at the resources to see, if I could make the pirates models available for the officers, too, but then discovered, that obviously not all officer models were used (I play with AoP super mod + all five updates).

To correct this, open the file <AoP-Folder>/Program/Scripts/utils.c and find the method

void CreateModel(int iChar, string sType, int iSex)

I found it like this:

void CreateModel(int iChar, string sType, int iSex)
{
int iNation = sti(characters[iChar].nation);

string sBody = "";
string sPrefix = "";
int iNumber = -1;

switch (sType)
{
case "pofficer":
sBody = "officer";
iNumber =<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--> rand(11)<!--colorc--></span><!--/colorc-->+1;
break;
case "officer":
// [...]
}
}

[Edit: Had some officers without model! rand(int n) seems to deliver values from 0 to n (normally this is 0 to n-1). Values below are already corrected.]

I found 20 officer models in the resources, so this must be 'rand(19)' instead.

If any of the modders likes texturing: It would be nice to have even more models.

For the interested non-programmers: Using e. g. the pirate models as officers, too, should work with this piece of code:

case "pofficer":
iNumber = rand(29)+1;
if(iNumber <= 20)
{
sBody = "officer";
}
else
{
sBody = "pirate";
iNumber = iNumber - 20;
}
break;

case "officer":
// [...]

Just replace the part between the first 'case' and 'break'.
 
Yes, there are 20 officer´s models but only 11 used. The GM Viewer from PotC FTP files is very handy to see all models. It´s a pity that the random way they are created usually fills the taverns with clones, while there are enough to make an interesting pool to start with.

Let´s say that every officer had it´s own particular perks, as well as particular model, face and name. That would make him a unique and interesting character, like in Seadogs where there was a blind master gunner with coordination +3 but accuracy -1 (i think). That would make the game more rich in RPG style. About using pirate models as officers is not a good idea when you are fighting pirates and can´t say which ones are your crew and which ones are enemies. Every pool of characters should be specific to a team. Englishsoldiers for english NPC, Pirates for pirates NPC and so on. Although some cool models could be exchanged with some of the officers pool to be used as your officers.

I´ve also been thinking in removing the "oficial fighter officers", and make all 6 officers take part in combat, in land and boardings. A fight with 6 officers and 20 crew per side would be more exciting. The officers could be armed and armored in detail by you, while the crew should have weapons stored aboard like in PotC.

If you are interested in modding the C files, i´ve found this topic very interesting <a href="http://www.piratesahoy.com/forum/index.php?showtopic=318" target="_blank">http://www.piratesahoy.com/forum/index.php?showtopic=318</a> , and the file Keywords.c "Keywords used in POTC but defined in engine" which is included in PotC Build has all that is known by the community about the engine. The AoP engine is very similar and can use most of the info. Well that´s my guessing because i´am not an expert at all.
 
Well, the fix officers in Seadogs were a weakness, somehow. Playing another time, you knew already where to find which officer with which abilities. So there lacks the surprise, what you might get...

Another issue:
Can it be that this rand(int n) method does not distribute the values equally? What is your impression about this? Some officer models seem to appear much more often than others (at least now, that I'm using all the 20 models). So having a better rand method could already help to reduce those duplicates (and more models, of course...).

I could not find the location of the implementation - does anybody know?
 
About the rand function, AFAIK works OK. It´s used in how many officers per colony (1-3), in officertype (1-6), and in choosing models as you found before. I've probably started a new game about 5-6 time and there are always 1-3 officers per colony, there are officers of every type, and of every model, although as should be expected in a random series of dice throws, some models and some types appear more often, and sometimes wouldn´t be strange if some values doesn´t appear at all.

The role the officers play in the game as it is now, is just a complement to your character skills. I raise fencing skill and tactics, while every officer raise his speciality skill. The only surprise that could be expected is the alignment GOOD-EVIL of the character (random too), but i disabled it, because i didn´t like to spend 20 hours playing with an officer only to be abandoned when he is skilled because he is suppoused to be evil.

<!--quoteo(post=208475:date=Jul 21 2007, 11:09 PM:name=Aconcagua)--><div class='quotetop'>QUOTE(Aconcagua @ Jul 21 2007, 11:09 PM) [snapback]208475[/snapback]</div><div class='quotemain'><!--quotec-->I could not find the location of the implementation - does anybody know?<!--QuoteEnd--></div><!--QuoteEEnd-->
Sorry, don´t understand the question.
 
<!--quoteo(post=208532:date=Jul 22 2007, 12:19 PM:name=Mumbala)--><div class='quotetop'>QUOTE(Mumbala @ Jul 22 2007, 12:19 PM) [snapback]208532[/snapback]</div><div class='quotemain'><!--quotec--><!--quoteo(post=208475:date=Jul 21 2007, 11:09 PM:name=Aconcagua)--><div class='quotetop'>QUOTE(Aconcagua @ Jul 21 2007, 11:09 PM) [snapback]208475[/snapback]</div><div class='quotemain'><!--quotec-->I could not find the location of the implementation - does anybody know?<!--QuoteEnd--></div><!--QuoteEEnd-->
Sorry, don´t understand the question.
<!--QuoteEnd--></div><!--QuoteEEnd-->

In which file the implementation can be found...

Now, my curiosity has grown, and I'd like to analyze the function.

<!--quoteo(post=208532:date=Jul 22 2007, 12:19 PM:name=Mumbala)--><div class='quotetop'>QUOTE(Mumbala @ Jul 22 2007, 12:19 PM) [snapback]208532[/snapback]</div><div class='quotemain'><!--quotec-->About the rand function, AFAIK works OK. It´s used in how many officers per colony (1-3), in officertype (1-6), and in choosing models as you found before. I've probably started a new game about 5-6 time and there are always 1-3 officers per colony, there are officers of every type, and of every model, although as should be expected in a random series of dice throws, some models and some types appear more often, and sometimes wouldn´t be strange if some values doesn´t appear at all.<!--QuoteEnd--></div><!--QuoteEEnd-->

A good random function shall distribute the values equally! If some values appear more ofen than others and some don't appear at all, this is everything else than a good random function. Well, a series of 5 to 6 is far to short to tell anything about the quality of the function, but always starting a new game obviously isn't the apropriate way to get larger series...

My impression might result from a too short series, too, perhaps I just haven't played long enough. Anyway, I've modified the code (only for the officers), instead of
<!--coloro:#FFFF00--><span style="color:#FFFF00"><!--/coloro--><!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->int rnd = rand(n);<!--fontc--></span><!--/fontc--><!--colorc--></span><!--/colorc-->
I tried
<!--coloro:#FFFF00--><span style="color:#FFFF00"><!--/coloro--><!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->int rnd = rand(<large prime number>) % n;<!--fontc--></span><!--/fontc--><!--colorc--></span><!--/colorc-->

My impression is that this works better, but as I admitted already, my impression might result from too short series. So now it would be really interesting to see the implementation - Mathematically, my modification could be complete nonsense or really fine, but an answer I only could get if I knew the algorithm for calculating the random number.
 
Back
Top