• 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 More stuff about loyalty

Croaker

Landlubber
I found some interesting code in "C:\Program Files\Playlogic\Age of Pirates 2\Program\scripts\officers.c:

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->if (sti(Npchar.reputation) > 41)
{Npchar.alignment = "good";}
else
{Npchar.alignment = "bad";}<!--QuoteEnd--></div><!--QuoteEEnd-->

and

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->if (CheckAttribute(characters[iPassenger], "loyality"))
{if (characters[iPassenger].alignment == alignment)
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;}
else
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) - 1;}<!--QuoteEnd--></div><!--QuoteEEnd-->

I don't know anything about writing code, but what I get from this is that while your officers have many different levels of reputation; assassin, shark, hero, ect, the game sets their alignment as either "good" or "bad" when it comes to determining their loyalty changes based upon your actions.

This does shed some light on why quest NPC, which are "neutral" reputation, consistently gain or lose loyalty with those of hero "reputation"; they are both defined as "good". While it would be very nice for "neutral" reputation to be undefined as "good" or "bad" and unaffected by your actions, I don't know how to phrase that line of code.

However, It does seem logical that redefining "good" as >51 or >61, would put the neutral quest characters in the "bad" camp and make them much easier to deal with (for us evil pirates). I might also suggest that reducting the change from +/- 1 to some fraction like 0.5 or 0.1 would give the officers a much slower progression towards the extremes. I might just leave the matching actions (alignment=alignment) as +1 and reduce the (else) actions to -0.5 on the basis that loyalty should grow over time.

Ideally the plus and minus are modified by charisma. Ok, Im going to make an attempt at this..... <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + (GetCharacterSPECIAL(_chref, SPECIAL_c)*0.1);}
else
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + ((GetCharacterSPECIAL(_chref, SPECIAL_c)-11)/10);}

This might just blow up in my face, but I will give it a try and see what happens.

If it works then high charisma (10) makes pluses=1 and minues=0.1, while low charisma (1) makes pluses=0.1 and minues=1. This would make it extremely easy for high charisma characters to keeps their officers, but very difficult for low charisma characters
 
<b>Bad news:</b> My chr code didn't work, game wouldn't even start. It will take someone with more programming knowledge to do that.

<b>Good news:</b> I have confirmed that this is indeed the code that controls changes to loyalty. I set the +/- both at 50 so changes would be very obvious. I started a new game and hired a shark officer and a hero officer. I then talked to the smuggler and sold some goods to him. After doing this my Shark went from about 40% to 100% and my hero went from about 20% to 0%. For playtesting this should make it a lot easier to determine which actions are "bad" and which are "good".

I attached a copy of my officers.c file.

Changed "good" to be >61, so neutral officers will be "bad" insead of "good".
Changed actions not-aligned with officer to be -0.2 and left aligned action at +1.

*Use this file or tweak you own values. You don't need to restart your game for the +/- modifiers to work. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
** you do need to restart your game for the "good"/"bad" definition to work.
***I highly recommend getting JSGME, so you don't have to mess with your origional files. <a href="http://www.users.on.net/~jscones/software/" target="_blank">http://www.users.on.net/~jscones/software/</a>, Thank you Captain Hawk for the link to this program!
 

Attachments

  • officers.c
    15.3 KB · Views: 443
<!--quoteo(post=334097:date=Jun 30 2009, 05:34 AM:name=Croaker)--><div class='quotetop'>QUOTE (Croaker @ Jun 30 2009, 05:34 AM) <a href="index.php?act=findpost&pid=334097"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->This does shed some light on why quest NPC, which are "neutral" reputation, consistently gain or lose loyalty with those of hero "reputation"; they are both defined as "good".<!--QuoteEnd--></div><!--QuoteEEnd-->
They do? I haven't noticed that in my game, my quest guys all eventually go to 0 loyalty even though my good aligned officers are fanatically loyal.
 
<!--quoteo(post=334154:date=Jun 30 2009, 11:11 AM:name=Sordid)--><div class='quotetop'>QUOTE (Sordid @ Jun 30 2009, 11:11 AM) <a href="index.php?act=findpost&pid=334154"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->They do? I haven't noticed that in my game, my quest guys all eventually go to 0 loyalty even though my good aligned officers are fanatically loyal.<!--QuoteEnd--></div><!--QuoteEEnd-->

Very strange. Every game I have played I get the opposite results.

I did a new test last night that added a neutral "trusted sailor". The test used alignment modifiers of +/- 50 and defined "good" as <b>>41</b>. After doing a smuggling run I had the following results...

Hero --> min. loyalty
Trusted Sailor --> <b>min.</b> loyalty
Shark --> max. loyalty

*neutral loyalty defined as good and tracking with the good officer

Then I started a new game with "good" defined as <b>>61</b>, (while you can change the +/- modifiers on the fly, the "good" definition requires a restart), I hired the three heroes (this time finding an assassin instead of a shark) and went on a smuggling mission again with the following results...

Hero --> min. loyalty
Trusted Sailor --> <b>max.</b> loyalty
Assassin --> max. loyalty

*neutral loyalty defined as bad and tracking with the bad officer
 
<b>Update:</b> While modding this code works wonderfully with any officer you find in a bar or 'competitor' captains who join you, it is not working with officers which are added during a quest, such as Workman from CoAS.

I just learned this last night when I finnaly did CoAS with my new game. I was having lots of fun terrorizing the carribean with my officers who were 100% loyal, but then I decided having the Dog of War again would be cool.

Apparently quest officers are defined in the quest script, so its time to go digging again.
 
I found some interesting code in "C:\Program Files\Playlogic\Age of Pirates 2\Program\scripts\officers.c:

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->if (sti(Npchar.reputation) > 41)
{Npchar.alignment = "good";}
else
{Npchar.alignment = "bad";}<!--QuoteEnd--></div><!--QuoteEEnd-->

and

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->if (CheckAttribute(characters[iPassenger], "loyality"))
{if (characters[iPassenger].alignment == alignment)
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;}
else
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) - 1;}
<!--QuoteEnd--></div><!--QuoteEEnd-->

I don't know anything about writing code, but what I get from this is that while your officers have many different levels of reputation; assassin, shark, hero, ect, the game sets their alignment as either "good" or "bad" when it comes to determining their loyalty changes based upon your actions.

This does shed some light on why quest NPC, which are "neutral" reputation, consistently gain or lose loyalty with those of hero "reputation"; they are both defined as "good". While it would be very nice for "neutral" reputation to be undefined as "good" or "bad" and unaffected by your actions, I don't know how to phrase that line of code.

However, It does seem logical that redefining "good" as >51 or >61, would put the neutral quest characters in the "bad" camp and make them much easier to deal with (for us evil pirates). I might also suggest that reducting the change from +/- 1 to some fraction like 0.5 or 0.1 would give the officers a much slower progression towards the extremes. I might just leave the matching actions (alignment=alignment) as +1 and reduce the (else) actions to -0.5 on the basis that loyalty should grow over time.

Ideally the plus and minus are modified by charisma. Ok, Im going to make an attempt at this..... <img src="http://forum.piratesahoy.net//public/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + (GetCharacterSPECIAL(_chref, SPECIAL_c)*0.1);}
else
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + ((GetCharacterSPECIAL(_chref, SPECIAL_c)-11)/10);}

This might just blow up in my face, but I will give it a try and see what happens.

If it works then high charisma (10) makes pluses=1 and minues=0.1, while low charisma (1) makes pluses=0.1 and minues=1. This would make it extremely easy for high charisma characters to keeps their officers, but very difficult for low charisma characters

Well, you could turn around this and improve the loyalty, but its cheating :dance
If you change to:

if (sti(Npchar.reputation) > 41)
{Npchar.alignment = "good";}
else
{Npchar.alignment = "good";}

[iPassenger], "loyality"))
{if (characters[iPassenger].alignment == alignment)
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;}
else
{characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;}

Whatever you do then will always have a positive impact on your officers. :will
 
Modification of quest chars loyality and other famous captains is in the same folder in PsHero.c. And if u want to make neutral captains really neutral you have to find file witch decides from what value it is neutral and then set that neutral is only 50 and in file officers.c and PsHero.c you have to change the code that it recognizes 3rd value which will be 50 as neutral and don't do anything with it. I know how to do that but i'm one lazy bastard ;P



One more thing. I don't know why but editing PsHero.c works for some quest officers and for some NPC heroes but not all of them. For example after editing it i start the game open debuger put Exp info on and go to a brothel. When I talk with a girl i paid i get info that musketeer gets loyality rise but Jeremy Pitt don't and they both are neutral chars.
 
Edit: attachment removed. It was buggy. You can find the new, tested COAS Loyalty Mod within the Mini Mods thread


Modification of quest chars loyality and other famous captains is in the same folder in PsHero.c. And if u want to make neutral captains really neutral you have to find file witch decides from what value it is neutral and then set that neutral is only 50 and in file officers.c and PsHero.c you have to change the code that it recognizes 3rd value which will be 50 as neutral and don't do anything with it. I know how to do that but i'm one lazy bastard ;P



One more thing. I don't know why but editing PsHero.c works for some quest officers and for some NPC heroes but not all of them. For example after editing it i start the game open debuger put Exp info on and go to a brothel. When I talk with a girl i paid i get info that musketeer gets loyality rise but Jeremy Pitt don't and they both are neutral chars.

I provide a code fix for loyalty here. I haven't tested it all through and I don't intend to make this into a Mod, because there are already so many out there (@Modders: feel free to include this into your own Mods). But so far I was able to keep Pitt and Ogle happy. It seems to work for quest officers and other regular sailors. So, no matter what action you take (good or bad), the neutral officers will have an increase in loyalty. This may look a bit like cheating, but let's say the neutral officers are just indifferent about your actions ;)

This is the altered top section of officers.c file:
Code:
// BOAL ïîëíîñòüþ ïåðåäåëàíî ïîä íóæíû ÂÌË

/// boal -->
void OfficersReaction(string alignment)
{
int iPassenger;
int i, cn;
ref sld;

for (int io = 0; io<GetPassengersQuantity(pchar); io++)
{   // ëþáîé ïàññàæèð ó êîãî åñòü ïðèñòðàñòèå ìîæåò ñâàëèòü åñëè íàøè äåëà åìó íå ïî äóøå
iPassenger = GetPassenger(pchar, io);
if (iPassenger != -1)
{
if (CheckAttribute(characters[iPassenger], "loyality"))
{
if (characters[iPassenger].alignment == alignment || isOfficerNeutral(characters[iPassenger]))
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;
}
else
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) - 1;
}
}
}
}
for (i=1; i<COMPANION_MAX; i++)
{
cn = GetCompanionIndex(pchar, i);
if(cn!=-1)
{
sld = GetCharacter(cn);
if (CheckAttribute(sld, "loyality"))
{
if (sld.alignment == alignment || isOfficerNeutral(sld))
{
sld.loyality = makeint(sld.loyality) + 1;
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, 1); //navy
}
else
{
sld.loyality = makeint(sld.loyality) - 1;
// ñïåöèàëüíî íå äàëåþ ïðèâåäåíèå ê 0 è ìàõ. ïîòîìó ÷òîá áûë çàïàñ ìèíóñîâ äëÿ ïðîâåðîê
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, -1); //navy
}
}
}
}
}

// return true in case officer is considered regular sailor
bool isOfficerNeutral(ref _officer) 
{
int rep = REPUTATION_NEUTRAL;  // 45 = neutral as default setting in case officer has no rep
if (CheckAttribute(_officer, "reputation")) rep = sti(_officer.reputation); // retrieve value if officer has rep
return (rep > 40 && rep < 51); // neutral range 41 - 50; TODO not sure if this is correct range for neutral
}

I've attached my officers.c file (vanilla version plus the fix above) in case you're having problems tinkering with your file manually. Backup your officers.c file first, then replace it with my file. The path is ..\Playlogic\Age of Pirates 2\Program\scripts

Here a short rundown of what the fix does:

The isOfficerNeutral() function determines if an officer has neutral reputation (i.e. regular sailors).
The alignment check in OfficersReaction() is ignored if your officers are neutral. It always increases loyalty by one point, regardless of your action.

For none neutral officers it's still the same as before. Your actions will be judged and reacted upon accordingly. :urgh or :bow

As written before. I haven't tested it in all situations, but encountered no problems so far.

Anyway, have fun roaming the Archipelago with your never unhappy neutral officers :cheers
 
Would it be possible to have Neutral officers change their loyalty in the direction of the "popular held feeling"? Eg. if most officers' loyalty decreases due to your action, the neutrals will follow?
 
Would it be possible to have Neutral officers change their loyalty in the direction of the "popular held feeling"? Eg. if most officers' loyalty decreases due to your action, the neutrals will follow?

Hi Pieter, good point! So, you suggest that neutral officers are going to follow the majority vote. Sounds good to me. I think it can be done, but needs a bit more coding. In coding terms it would mean: loop once through officers and companion list, ignoring neutrals. Counting officers reaction results. Determine result (more bad, more good, or on par). Loop through the list a second time and apply result to neutral officers.

I will try that.
 
Yep; that sounds like it makes sense to me. I just thought that might add more gameplay value than just increasing neutral officers' loyalty whatever you do.
 
Edit: problem solved. Bug fixed, see follow up posting.

I need help.

The following piece of code crashes the game when it compiles at start of the game. Unfortunately I don't find a log file although I enabled logging in the engine.ini file.

Perhaps someone with good coding skills and a good logging setup of COAS can help?

Top section of officers.c file:
Code:
// BOAL ïîëíîñòüþ ïåðåäåëàíî ïîä íóæíû ÂÌË

/// boal -->
void OfficersReaction(string alignment)
{
int iPassenger;
int i, cn, majorityResult;
ref sld;

majorityResult = DetermineMajorityReaction(alignment);

for (int io = 0; io<GetPassengersQuantity(pchar); io++)
{   // ëþáîé ïàññàæèð ó êîãî åñòü ïðèñòðàñòèå ìîæåò ñâàëèòü åñëè íàøè äåëà åìó íå ïî äóøå
iPassenger = GetPassenger(pchar, io);
if (iPassenger != -1)
{
if (CheckAttribute(characters[iPassenger], "loyality"))
{
if (isOfficerNeutral(characters[iPassenger]))
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + majorityResult;
}
else if (characters[iPassenger].alignment == alignment)
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;
}
else
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) - 1;
}
}
}
}
for (i=1; i<COMPANION_MAX; i++)
{
cn = GetCompanionIndex(pchar, i);
if(cn!=-1)
{
sld = GetCharacter(cn);
if (CheckAttribute(sld, "loyality"))
{
if (isOfficerNeutral(sld))
{
sld.loyality = makeint(sld.loyality) + majorityResult;
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, majorityResult); //navy
}
else if (sld.alignment == alignment)
{
sld.loyality = makeint(sld.loyality) + 1;
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, 1); //navy
}
else
{
sld.loyality = makeint(sld.loyality) - 1;
// ñïåöèàëüíî íå äàëåþ ïðèâåäåíèå ê 0 è ìàõ. ïîòîìó ÷òîá áûë çàïàñ ìèíóñîâ äëÿ ïðîâåðîê
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, -1); //navy
}
}
}
}
}

// return true in case officer is considered regular sailor
bool isOfficerNeutral(ref _officer) 
{
int rep = REPUTATION_NEUTRAL;  // 45 = neutral as default setting in case officer has no rep
if (CheckAttribute(_officer, "reputation")) rep = sti(_officer.reputation); // retrieve value if officer has rep
return (rep > 40 && rep < 51); // neutral range 41 - 50; TODO not sure if this is correct range for neutral
}

// determine how majority of your officers react on your last action
// return 0 = officers opinion on par, -1 = majority against captain, +1 = majority for captain 
int DetermineMajorityReaction(string _action) 
{
int i, iPassenger, _vote, _result, cn;
ref sld;

// loop through passenger list
for (int io = 0; io<GetPassengersQuantity(pchar); io++)
{
iPassenger = GetPassenger(pchar, io);
if (iPassenger != -1)
{
if (CheckAttribute(characters[iPassenger], "loyality"))
{
if (!isOfficerNeutral(characters[iPassenger]))
{
if (characters[iPassenger].alignment == _action)
{
_vote++;
}
else
{
_vote--;
}
}
}
}
}

// loop through companion list
for (i=1; i<COMPANION_MAX; i++)
{
cn = GetCompanionIndex(pchar, i);
if(cn!=-1)
{
sld = GetCharacter(cn);
if (CheckAttribute(sld, "loyality"))
{
if (!isOfficerNeutral(sld)) 
{
if (sld.alignment == _action)
{
_vote++;
}
else
{
_vote--;
}
}
}
}
}

// determine result: 0 = officers opinion on par, -1 = majority against captain, +1 = majority for captain
if (_vote < 0)
{
_result = -1;
}
else if (_vote > 0)
{
_result = 1;
}
return _result;
}

I'm sure it's some stupid coding bug or some other thing I have overseen. I am used to programming in java and not very familiar with C or whatever Akella is using for COAS.

Any help would be appreciated.

To anyone else: don't use the attached file! It is bugged!
 
Edit: removed attachment. It wasn't working correctly. Didn't want to spoil your fun. There will soon be a new delivery...

ok, I found the bug and fixed it. It was a nested if-else-if problem. I didn't know, that such a thing is not allowed :modding

As per Pieters suggestion, neutral officers (regular sailor reputation) follow now the general held feeling for the captain. If most none neutral officers are offended by your action, the neutral officers will be too and vice versa. If the general opinion is neither good nor bad, the neutral officers will not have a change in loyalty. Needless to say, if you only have neutral officers on board (and companions) there will never be a change in loyalty!

Please note that this is in testing phase now. I can't currently test all possible situations. So if you'd like to help me (and the community) you're more than welcome :)

The attached file goes into ..\Playlogic\Age of Pirates 2\Program\scripts (backup original file pls).

Suggestions and bug reports are welcome.


It is the vanilla file plus the altered code shown below:

Code:
// BOAL ïîëíîñòüþ ïåðåäåëàíî ïîä íóæíû ÂÌË

/// boal -->
void OfficersReaction(string alignment)
{
int iPassenger;
int i, cn, majorityResult;
ref sld;

majorityResult = DetermineMajorityReaction(alignment);

for (int io = 0; io<GetPassengersQuantity(pchar); io++)
{   // ëþáîé ïàññàæèð ó êîãî åñòü ïðèñòðàñòèå ìîæåò ñâàëèòü åñëè íàøè äåëà åìó íå ïî äóøå
iPassenger = GetPassenger(pchar, io);
if (iPassenger != -1)
{
if (CheckAttribute(characters[iPassenger], "loyality"))
{
if (isOfficerNeutral(&characters[iPassenger]))
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + majorityResult;
}
else 
{
if (characters[iPassenger].alignment == alignment)
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;
}
else
{
characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) - 1;
}
}
}
}
}
for (i=1; i<COMPANION_MAX; i++)
{
cn = GetCompanionIndex(pchar, i);
if(cn!=-1)
{
sld = GetCharacter(cn);
if (CheckAttribute(sld, "loyality"))
{

if (isOfficerNeutral(&sld))
{
sld.loyality = makeint(sld.loyality) + majorityResult;
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, majorityResult); //navy
}
else
{
if (sld.alignment == alignment)
{
sld.loyality = makeint(sld.loyality) + 1;
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, 1); //navy
}
else
{
sld.loyality = makeint(sld.loyality) - 1;
// ñïåöèàëüíî íå äàëåþ ïðèâåäåíèå ê 0 è ìàõ. ïîòîìó ÷òîá áûë çàïàñ ìèíóñîâ äëÿ ïðîâåðîê
if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, -1); //navy
}
}
}
}
}
}

// return true in case officer is considered regular sailor
bool isOfficerNeutral(ref _officer) 
{
int rep = REPUTATION_NEUTRAL;  // 45 = neutral as default setting in case officer has no rep
if (CheckAttribute(_officer, "reputation")) rep = sti(_officer.reputation); // retrieve value if officer has rep
return (rep > 40 && rep < 51); // neutral range 41 - 50; TODO not sure if this is correct range for neutral
}

// determine how majority of your officers react on your last action
// return 0 = officers opinion on par, -1 = majority against captain, +1 = majority for captain 
int DetermineMajorityReaction(string action) 
{
int iPassenger, _vote, _result, cn;
ref sld;

// loop through passenger list
for (int io = 0; io<GetPassengersQuantity(pchar); io++)
{
iPassenger = GetPassenger(pchar, io);
if (iPassenger != -1)
{
if (CheckAttribute(characters[iPassenger], "loyality"))
{
if (!isOfficerNeutral(&characters[iPassenger]))
{
if (characters[iPassenger].alignment == action)
{
_vote++;
}
else
{
_vote--;
}
}
}
}
}

// loop through companion list
for (int i=1; i<COMPANION_MAX; i++)
{
cn = GetCompanionIndex(pchar, i);
if(cn!=-1)
{
sld = GetCharacter(cn);
if (CheckAttribute(sld, "loyality"))
{
if (!isOfficerNeutral(&sld)) 
{
if (sld.alignment == action)
{
_vote++;
}
else
{
_vote--;
}
}
}
}
}

// determine result: 0 = officers opinion on par, -1 = majority against captain, +1 = majority for captain
if (_vote < 0)
{
_result = -1;
}
else if (_vote > 0)
{
_result = 1;
}
return _result;
}
 
So hang on, is the second version (your last post) hopefully the code that takes Pieters suggestion into account?

From the look of it the theory is solidly based, but of course does need testing :yes
 
Harumph, it's not as easy as it seemed. Currently I see no change in loyalty at all. I also found a design flaw. I think I need to exclude prisoners for the voting. They've got no right to vote ;)
 
Harumph, it's not as easy as it seemed. Currently I see no change in loyalty at all. I also found a design flaw. I think I need to exclude prisoners for the voting. They've got no right to vote ;)

I had to overcome some peculiarities of this programming language and learned a lot on the way. For instance, not pre-initialised int variables behave strange sometimes (e.g. int x; versus int x = 0;). I assumed them to be 0 (zero), but had some strange results.

Anyway. I'm making good progress and hope to deliver soon. But first it needs some more testing.

BTW: I made some findings: 1st: quest officers don't have attribute alignment set. Hence every alignment check went bad for Ogle, Pitt and the like! That's the reason why they constantly loose loyalty :modding 2nd: prisoners don't have attribute loyalty set, hence it's not changed and they can't vote for or against the captain in my code xD: I hope the same is true for passengers you pick up on the way. I will have to test that...
 
Back
Top