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

WIP Improve the Crewmembers on Shore Mod

So if GetChanceDetectFalseFlag() = 1, you got seen, right?

it returns a value between 0 and 0.99
this is the chance you will have to get caught. So you could use it like this:

if(GetChanceDetectFalseFlag()*100 > rand(100))
{
logit("I'm caught");
}
else
{
logit("HA! They dont spot my false flag");
}
 
So if GetChanceDetectFalseFlag() = 1, you got seen, right?
No, it returns only a chance value. If it returns 1.0, you'll ALWAYS be seen. Immediately. All the time.
That isn't meant to happen.

If this returns true, then you indeed got seen:
Code:
if (frnd() < GetChanceDetectFalseFlag())
There is a random element there in the frnd()
GetChanceDetectFalseFlag()
always returns the same value if the input is also the same. That one isn't random.
 
Understood. I think i know how i'm gonna rebuild this dialogue. How do i remove the random element from this?
Code:
if(rand(CalcCharacterSkill(pchar, SKILL_LEADERSHIP))>5)

I just want it to check if the player has a leadership higher than 5, no randomness involved. I'm going to make the randomness be decided by the false flag detection.
 
Understood. I think i know how i'm gonna rebuild this dialogue. How do i remove the random element from this?
Code:
if(rand(CalcCharacterSkill(pchar, SKILL_LEADERSHIP))>5)

I just want it to check if the player has a leadership higher than 5, no randomness involved. I'm going to make the randomness be decided by the false flag detection.
Code:
if(CalcCharacterSkill(pchar, SKILL_LEADERSHIP)>5)
 
Okay, here's the dialogue as it is now, for the pirate patrols. I feel like i understand it a bit better, but there's also something missing: there's dialogue for when you're a pirate, and there's dialogue for when you're using a false flag (either detected or undetected), but there's nothing for when you're neither a pirate nor using a false flag. How do we add that? Do we even need to? Maybe it's taken care of somewhere else.

Code:
// ccc jul05 corpse
// This pseudo dialog only opens the itemexchange interface for looting corpses
// one could also add dialogchoices for reawakening or burial


void ProcessDialogEvent()
{
   ref NPChar;
   aref Link, Diag;

   DeleteAttribute(&Dialog,"Links");

   makeref(NPChar,CharacterRef);
   makearef(Link, Dialog.Links);
   makearef(Diag, NPChar.Dialog);

   ref PChar;
   PChar = GetMainCharacter();
   int loc_id = FindLocation(PChar.location);

   switch(Dialog.CurrentNode)
   {
     case "exit":
       Diag.CurrentNode = Diag.TempNode;
       DialogExit();
       if(Npchar.middlename!=""){LAi_tmpl_SetFollow(Npchar, CharacterFromId(Npchar.middlename), 120000);}
     break;

     case "first time":
       Dialog.defAni = "dialog_stay1";
       Dialog.defCam = "1";
       Dialog.defSnd = "dialogs\0\017";
       Dialog.defLinkAni = "dialog_1";
       Dialog.defLinkCam = "1";
       Dialog.defLinkSnd = "dialogs\woman\024";
       Dialog.ani = "dialog_stay2";
       Dialog.cam = "1";
       Dialog.snd = "voice\PADI\PADI001";
       // ccc Dec 05 You are recognized for your pirating actions
       if(GetServedNation() != PIRATE || GetCurrentLocationNation() == PIRATE)   // PB: Link this to acting as a pirate
       {
         Dialog.Text = DLG_TEXT[0] + GetMySimpleName(PChar) + DLG_TEXT[1];
         Link.l1 = DLG_TEXT[2];
         Link.l1.go = "exit";
       }
       else
       {
         if (frnd() < GetChanceDetectFalseFlag()) // MT: If your false flag gets detected, then:
         {
           int MyNation = PERSONAL_NATION;
           int MyFlag = GetCurrentFlag();
           string nationme, nationhim;
           if(GetRMRelation(PChar, sti(Npchar.nation)) <= REL_WAR) //MT: If you, personally, are at war with the pirates
           {
             if(MyFlag == PIRATE) //MT: found out as a fake pirate
             {
               Dialog.Text = DLG_TEXT[3];
               Link.l1 = DLG_TEXT[4];
               Link.l1.go = "exit";
               LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
             }
             else
             {
               if(CalcCharacterSkill(pchar, SKILL_LEADERSHIP)>5) //MT: Found out as dangerous intruder
               {
                 Dialog.Text = DLG_TEXT[5];
                 Link.l1 = DLG_TEXT[6];
                 Link.l1.go = "exit";
                 LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
               }
               else // MT: Found out as ordinary intruder
               {
                 Dialog.Text = DLG_TEXT[7] + GetMySimpleName(PChar) + DLG_TEXT[8];
                 Link.l1 = DLG_TEXT[9];
                 Link.l1.go = "exit";
                 LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
               }
             }
           }
           else //MT: If you, personally, are NOT at war with the pirates
           {
             if(MyFlag == PIRATE && (CalcCharacterSkill(pchar, SKILL_LEADERSHIP)>5) // MT: If you're famous and using the pirate flag as a false one
             {
               Dialog.Text = DLG_TEXT[12];
               Link.l1 = DLG_TEXT[13];
               Link.l1.go = "exit";
             }
             else // MT: If average Joe and they don't care about your false flag
             {
               Dialog.Text = DLG_TEXT[14];
               Link.l1 = DLG_TEXT[15];
               Link.l1.go = "exit";
             }
           }
         }
         else // MT: If your false flag did not get detected, then:
         {
           MyFlag = GetCurrentFlag();
           if(GetFlagRMRelation(sti(Npchar.nation)) <= REL_WAR && rand(10)>8) // MT: 20% chance of being attacked when being here under hostile flag
           {
             Dialog.Text = DLG_TEXT[7] + GetMySimpleName(PChar) + DLG_TEXT[8];
             Link.l1 = DLG_TEXT[9];
             Link.l1.go = "exit";
             LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
           }
           else
           {
             if(myflag == MakeInt(Npchar.nation)) // MT: If using the pirate flag, which is a false flag, but they think you're for real
             {
               Dialog.Text = DLG_TEXT[16];
               Link.l1 = DLG_TEXT[17];
               Link.l1.go = "exit";
             }
             else
             {
               Dialog.Text = DLG_TEXT[18]; // MT: Ordinary non-detection
               Link.l1 = DLG_TEXT[19];
               Link.l1.go = "exit";
             }
           }
         }
       }
       Diag.TempNode = "first time";
     break;

   }
}

I've also taken the liberty of adding my own comments to clarify what's going on. I've had to remove two lines of dialogue, but that's it.
 
Last edited:
I'd need to think that through a bit more thoroughly, but have no time left today.
 
I just remembered something was supposed to be done here, so here are a random assortment of thoughts on it...

For starters, this:
Code:
if(CalcCharacterSkill(pchar, SKILL_LEADERSHIP)>5) //MT: Found out as dangerous intruder
{
Dialog.Text = DLG_TEXT[5];
Link.l1 = DLG_TEXT[6];
Link.l1.go = "exit";
LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
}
else // MT: Found out as ordinary intruder
{
Dialog.Text = DLG_TEXT[7] + GetMySimpleName(PChar) + DLG_TEXT[8];
Link.l1 = DLG_TEXT[9];
Link.l1.go = "exit";
LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
}
Can be replaced with this:
Code:
if(CalcCharacterSkill(pchar, SKILL_LEADERSHIP)>5) //MT: Found out as dangerous intruder
{
Dialog.Text = DLG_TEXT[5];
Link.l1 = DLG_TEXT[6];
}
else // MT: Found out as ordinary intruder
{
Dialog.Text = DLG_TEXT[7] + GetMySimpleName(PChar) + DLG_TEXT[8];
Link.l1 = DLG_TEXT[9];
}
Link.l1.go = "exit";
LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
Should do the same, but it's less code.

Normally I'd only check the "false flag detection chance" IF you are actually flying a false flag.
If not, then they KNOW if you're friendly and hostile and there probably need to be no further random elements.
So I'd check
Code:
if(GetRMRelation(PChar, sti(Npchar.nation)) <= REL_WAR)
BEFORE
Code:
if (frnd() < GetChanceDetectFalseFlag())

"If you're famous and using the pirate flag as a false one"
^ What kind of dialog do you have linked to that?
Also, note that Leadership isn't the same as Fame. If you REALLY want to check fame, use GetFame(ref pchar, int iNation) instead.
That is already factored in the false flag detection too.

Does any of that help?
 
I just remembered something was supposed to be done here, so here are a random assortment of thoughts on it...

For starters, this:
Code:
if(CalcCharacterSkill(pchar, SKILL_LEADERSHIP)>5) //MT: Found out as dangerous intruder
{
Dialog.Text = DLG_TEXT[5];
Link.l1 = DLG_TEXT[6];
Link.l1.go = "exit";
LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
}
else // MT: Found out as ordinary intruder
{
Dialog.Text = DLG_TEXT[7] + GetMySimpleName(PChar) + DLG_TEXT[8];
Link.l1 = DLG_TEXT[9];
Link.l1.go = "exit";
LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
}
Can be replaced with this:
Code:
if(CalcCharacterSkill(pchar, SKILL_LEADERSHIP)>5) //MT: Found out as dangerous intruder
{
Dialog.Text = DLG_TEXT[5];
Link.l1 = DLG_TEXT[6];
}
else // MT: Found out as ordinary intruder
{
Dialog.Text = DLG_TEXT[7] + GetMySimpleName(PChar) + DLG_TEXT[8];
Link.l1 = DLG_TEXT[9];
}
Link.l1.go = "exit";
LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
Should do the same, but it's less code.

I see what you mean. Done.

Normally I'd only check the "false flag detection chance" IF you are actually flying a false flag.
If not, then they KNOW if you're friendly and hostile and there probably need to be no further random elements.
So I'd check
Code:
if(GetRMRelation(PChar, sti(Npchar.nation)) <= REL_WAR)
BEFORE
Code:
if (frnd() < GetChanceDetectFalseFlag())

You've actually given me a bit of a thought here. I'll be doing some serious rewriting, but this should look pretty good afterwards.

"If you're famous and using the pirate flag as a false one"
^ What kind of dialog do you have linked to that?
Also, note that Leadership isn't the same as Fame. If you REALLY want to check fame, use GetFame(ref pchar, int iNation) instead.
That is already factored in the false flag detection too.

Does any of that help?

I had another look at those lines, and adjusted them. They didn't quite make it clear enough what was going on. This is what they are now:

"Well, fancy that. A hardy seadog, playin' at bein' pirate. How about we drop by the tavern for a mug an' a gamble, see if yer for real?",
"Not today gents, I haven't the time. Fair winds, and keep out of my hold.",

Funnily enough, i'm not sure if this situation would occur all the much. Why would you be pretending to be a pirate when you're not hostile with them? It's a fun little easter egg though.

Also, 'fame' is actually the wrong word here. Charismatic, maybe? It would make more sense to use actual fame though, in some circumstances. I'll do that. This refers to titles such as 'unknown freebooter', right? What kind of number should i compare it to then? Right now i'm comparing leadership to the mediocre value of 5, but what should i compare fame to?
 
Funnily enough, i'm not sure if this situation would occur all the much. Why would you be pretending to be a pirate when you're not hostile with them? It's a fun little easter egg though.
I'm not entirely sure what situation we're talking about here.
You're flying a pirate flag while being friendly to the pirates? Or while being hostile to them?
Both make sense at certain times, mainly if you're trying to get into a pirate port.

Also, 'fame' is actually the wrong word here. Charismatic, maybe? It would make more sense to use actual fame though, in some circumstances. I'll do that. This refers to titles such as 'unknown freebooter', right?
Actually, the "Unknown Freebooter" text is now a "Pirate Rank" and there is now a separate set of fame levels independent from that.
See here: New Horizons National ranks | PiratesAhoy!

What kind of number should i compare it to then? Right now i'm comparing leadership to the mediocre value of 5, but what should i compare fame to?
Good question. Maybe check if your fame-based rank is "Famous" or higher?
 
I'm not entirely sure what situation we're talking about here.
You're flying a pirate flag while being friendly to the pirates? Or while being hostile to them?
Both make sense at certain times, mainly if you're trying to get into a pirate port.

After my reworking of the dialogue, it doesn't really apply anymore. It might still need some work, but what it's used for now is a situation where you're not hostile with the pirates, yet chose to fly the pirate flag as a false flag anyway. Which actually makes me think: When is a false flag false, exactly? Is it only when you used a flag to change your hostile relation to a nation into a non-hostile one, or is it any time you're not using your personal flag?

Actually, the "Unknown Freebooter" text is now a "Pirate Rank" and there is now a separate set of fame levels independent from that.
See here: New Horizons National ranks | PiratesAhoy!

Good question. Maybe check if your fame-based rank is "Famous" or higher?

Right. So the replacement code should be if(GetFame(ref pchar, int iNation)>rank.6) or something, right? (since it needs to be at 7 to be recognised) I want this to be referring to generic fame, not your rank amongst pirates. On the other hand, what about this:

if(rand<(GetFame(ref pchar, int iNation))

This would mean that the more famous you are, the easier you are to recognise. Much more dynamic.
 
It might still need some work, but what it's used for now is a situation where you're not hostile with the pirates, yet chose to fly the pirate flag as a false flag anyway.
If you are not hostile to the pirates, your pirate flag isn't false.

Right. So the replacement code should be if(GetFame(ref pchar, int iNation)>rank.6) or something, right? (since it needs to be at 7 to be recognised) I want this to be referring to generic fame, not your rank amongst pirates.
I'd have to check the exact functions you need. It should be whatever is used in the F2>Nations Relations as well.

if(rand<(GetFame(ref pchar, int iNation))

This would mean that the more famous you are, the easier you are to recognise. Much more dynamic.
That is pretty much exactly what this does:
Code:
if (frnd() < GetChanceDetectFalseFlag())
With some extra stuff, such as difficulty and skills, factored in of course.
 
If you are not hostile to the pirates, your pirate flag isn't false.

So the ONLY time pirates can detect a flag as false is when you're using the pirate flag, but you're hostile to them? It doesn't matter if you're pretending to be french while hostile to france? Or does that still fulfill the GetChanceDetectFalseFlag() condition for pirates? This is a very important distinction.

I'd have to check the exact functions you need. It should be whatever is used in the F2>Nations Relations as well.

Please do. There's so much code to dig through, and this is difficult enough as it is.

That is pretty much exactly what this does:
Code:
if (frnd() < GetChanceDetectFalseFlag())
With some extra stuff, such as difficulty and skills, factored in of course.

Allright, but i need to check for fame regardless of wether you're using a false flag sometimes as well, so i do actually need to use if(rand<(GetFame(ref pchar, int iNation)), if that's the right code to use.
 
Last edited:
So the ONLY time pirates can detect a flag as false is when you're using the pirate flag, but you're hostile to them? It doesn't matter if you're pretending to be french while hostile to france? Or does that still fulfill the GetChanceDetectFalseFlag() condition for pirates? This is a very important distinction.
A flag considered 'false' by a nation is one that IS friendly to them, while you yourself are not.
So if you're hostile to France, but are flying a Portuguese flag (with France and Portugal being friendly), that would be a false flag and you can be recognized for it.
If you're hostile to France, but you are flying an English flag (with France and England being hostile), that isn't a false flag because you are hostile and so is the nation whose flag you're flying.

The Pirates are, by definition, always friendly to themselves and hostile to every other nation.
So if you're friendly to the pirates and are flying a pirate flag, then it isn't a false flag and they KNOW you're OK.
If you're hostile to the pirates and are flying a non-pirate flag, then it isn't a false flag either as they KNOW you're an enemy.
Only if you're hostile to the pirates, but ARE flying a pirate flag, they might think that you're friendly, but you're really not.
That is therefore a false flag and you may be recognized for that.

If you're pretending to be French, while being hostile to France, the French would consider that a false flag.
But as far as the pirates are concerned, you ARE hostile and your pretend flag is ALSO hostile.
So they don't need to care about any false flag detection, since you claim to be hostile to them and you are.

Does that make sense?

Allright, but i need to check for fame regardless of wether you're using a false flag sometimes as well, so i do actually need to use if(rand<(GetFame(ref pchar, int iNation)), if that's the right code to use.
In what situation would you need to do that? That may affect the type of functionality you need.
GetFame returns a number between 0 and (technically) infinity, so that may not work very well in a "random context".
 
A flag considered 'false' by a nation is one that IS friendly to them, while you yourself are not.
So if you're hostile to France, but are flying a Portuguese flag (with France and Portugal being friendly), that would be a false flag and you can be recognized for it.
If you're hostile to France, but you are flying an English flag (with France and England being hostile), that isn't a false flag because you are hostile and so is the nation whose flag you're flying.

The Pirates are, by definition, always friendly to themselves and hostile to every other nation.
So if you're friendly to the pirates and are flying a pirate flag, then it isn't a false flag and they KNOW you're OK.
If you're hostile to the pirates and are flying a non-pirate flag, then it isn't a false flag either as they KNOW you're an enemy.
Only if you're hostile to the pirates, but ARE flying a pirate flag, they might think that you're friendly, but you're really not.
That is therefore a false flag and you may be recognized for that.

If you're pretending to be French, while being hostile to France, the French would consider that a false flag.
But as far as the pirates are concerned, you ARE hostile and your pretend flag is ALSO hostile.
So they don't need to care about any false flag detection, since you claim to be hostile to them and you are.

Does that make sense?

Right. I'll remove some dialogue. I had this idea with pirates noticing that you were being sneaky without actually being hostile to them, but that doesn't seem to be possible then.

In what situation would you need to do that? That may affect the type of functionality you need.
GetFame returns a number between 0 and (technically) infinity, so that may not work very well in a "random context".

I've reworked the code again, and it turns out most of the stuff could be thrown out. Here's what's left:

Code:
// ccc jul05 corpse
// This pseudo dialog only opens the itemexchange interface for looting corpses
// one could also add dialogchoices for reawakening or burial


void ProcessDialogEvent()
{
   ref NPChar;
   aref Link, Diag;

   DeleteAttribute(&Dialog,"Links");

   makeref(NPChar,CharacterRef);
   makearef(Link, Dialog.Links);
   makearef(Diag, NPChar.Dialog);

   ref PChar;
   PChar = GetMainCharacter();
   int loc_id = FindLocation(PChar.location);

   switch(Dialog.CurrentNode)
   {
     case "exit":
       Diag.CurrentNode = Diag.TempNode;
       DialogExit();
       if(Npchar.middlename!=""){LAi_tmpl_SetFollow(Npchar, CharacterFromId(Npchar.middlename), 120000);}
     break;

     case "first time":
       Dialog.defAni = "dialog_stay1";
       Dialog.defCam = "1";
       Dialog.defSnd = "dialogs\0\017";
       Dialog.defLinkAni = "dialog_1";
       Dialog.defLinkCam = "1";
       Dialog.defLinkSnd = "dialogs\woman\024";
       Dialog.ani = "dialog_stay2";
       Dialog.cam = "1";
       Dialog.snd = "voice\PADI\PADI001";
       // ccc Dec 05 You are recognized for your pirating actions
       if(GetServedNation() != PIRATE || GetCurrentLocationNation() == PIRATE)   // PB: Link this to acting as a pirate
       {
         Dialog.Text = DLG_TEXT[0] + GetMySimpleName(PChar) + DLG_TEXT[1];
         Link.l1 = DLG_TEXT[2];
         Link.l1.go = "exit";
       }
       else
       {
         int MyNation = PERSONAL_NATION;
         int MyFlag = GetCurrentFlag();
         string nationme, nationhim;
         if(GetRMRelation(PChar, sti(Npchar.nation)) <= REL_WAR) //MT: At war with pirates
         {
           if (frnd() < GetChanceDetectFalseFlag()) // MT: If your false flag gets detected, then:
           {
             Dialog.Text = DLG_TEXT[3];
             Link.l1 = DLG_TEXT[4];
             Link.l1.go = "exit";
             LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
           }
           else // MT: If your false flag did not get detected, then:
           {
             if(rand<(GetFame(ref pchar, int iNation)) //MT: You've made quite a name for yourself, and are an attractive target for a mugging
             {
               Dialog.Text = DLG_TEXT[20] + GetMySimpleName(PChar) + DLG_TEXT[21];
               Link.l1 = DLG_TEXT[22];
               Link.l1.go = "exit";
               LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
             }
             else //MT: You're not worth the trouble
             {
               Dialog.Text = DLG_TEXT[10];
               Link.l1 = DLG_TEXT[11];
               Link.l1.go = "exit";
             }
           }
         }
         else // MT: You're not at war with the pirates, therefore aren't targeted by them
         {
           if(rand<(GetFame(ref pchar, int iNation)) //MT: recognised as famous individual
           {
             Dialog.Text = DLG_TEXT[12];
             Link.l1 = DLG_TEXT[13];             
           }
           else           
           {
             Dialog.Text = DLG_TEXT[18];
             Link.l1 = DLG_TEXT[19];             
           }
           Link.l1.go = "exit";
         }
       }
       Diag.TempNode = "first time";
     break;
   }
}

There's two instances of fame-checking in there. The comments in the code should clarify what's going on.
 
Last edited:
This function may help you for checking fame:
Code:
GetRankFromPoints(GetScore(PChar))
GetScore gives you a number between 0 and infinity.
GetRankFromPoints converts that to a number between 0 and 12 that matches with the ranks shown on the Wiki.

Was this code always like that?
Code:
if(GetServedNation() != PIRATE || GetCurrentLocationNation() == PIRATE) // PB: Link this to acting as a pirate
{
Dialog.Text = DLG_TEXT[0] + GetMySimpleName(PChar) + DLG_TEXT[1];
Link.l1 = DLG_TEXT[2];
Link.l1.go = "exit";
}
Because that makes no sense at all. Basically that would mean you only ever get ANY other dialog if you ARE a pirate in a NON-pirate location.
Otherwise, you'll get whatever is at the top of that dialog file.

Here's the logical version from Enc_Walker.c:
Code:
          // ccc Dec 05 You are recognized for your pirating actions
           if(GetServedNation() == PIRATE && GetCurrentLocationNation() != PIRATE)   // PB: Link this to acting as a pirate
           {
             d.Text = DLG_TEXT[294];
             Link.l1 = RandSwear() + DLG_TEXT[295];
             Link.l1.go = "alarm";
           }
It is meant to be the dialog that turns people ashore hostile because you are a pirate.
Obviously that shouldn't happen in pirate towns. ;)

The "random_pirates_group_dialog.c" is only used as part of the Random_pirates_group function.
And that is only ever triggered here:
Code:
    if(location.type=="town" || location.type=="Port")//MAXIMUS
     {
       //SCREWFACE : RANDOM NIGHT PIRATES RAID IN TOWNS AND PORTS
       if (LANDCREWMEMBERS && ivcskip == 0)
       {
         if (makeint(environment.time) > 22.0 || makeint(environment.time) < 8.0 && GettownNation(location.townsack)!=3)
         {
           if(rand(20)==0){Random_Raid("smugglers", 20, PIRATE,"friend","enemy","ALERT !! PIRATES RAID !!!!");}
         }
         if (makeint(GetLocationNation(location))!=PIRATE) //(GettownNation(location.townsack)!=3)
         {
           if(rand(10)>3){Random_Patrol("soldiers", RAND(7), GetLocationNation(location),"SOLDIERS PATROL !");}
           if(makeint(environment.time) > 8.0 && makeint(environment.time) < 22.0)
           {
             Random_sailors_group(RAND(6), GetLocationNation(location));
             Random_item_traders(GetLocationNation(location));
             //Random_citizens_group(RAND(4), GetLocationNation(location));
           }
           if(rand(10)>4){Random_pirates_group(RAND(5));}
         }
         else
         {
           if(rand(10)>1){Random_pirates_group(RAND(5));}
           if(makeint(environment.time) > 8.0 && makeint(environment.time) < 22.0)
           {
             Random_sailors_group(RAND(8), GetLocationNation(location));
             Random_item_traders(GetLocationNation(location));
             //Random_citizens_group(RAND(4), GetLocationNation(location));
           }
           if(rand(10)>2){Random_pirates_group(RAND(4));}
         }
       }
That's to give you some context for when to expect it.
And maybe that code needs some tweaking too....

I had this idea with pirates noticing that you were being sneaky without actually being hostile to them, but that doesn't seem to be possible then.
Technically may be possible. But probably not necessary. And unless your flag is personal or of your "served nation", it'll always be hostile to someone.
Or are you considering that these are guys who may show up in non-pirate ports and they actually comment on you having a flag false to the nation of that port?
 
Allright, but i need to check for fame regardless of wether you're using a false flag sometimes as well, so i do actually need to use if(rand<(GetFame(ref pchar, int iNation)), if that's the right code to use.
That code is not correct. Meaning it will be rejected by the engine.
rand is a function. You call it like rand(N), N being some integer number, and it returns a random integer between 0 and N. It's like rolling N-sided die.
"rand < something" makes no sense in Storm engine's language and it will give you a bunch of complains in error.log
 
Was this code always like that?
Code:
if(GetServedNation() != PIRATE || GetCurrentLocationNation() == PIRATE) // PB: Link this to acting as a pirate
{
Dialog.Text = DLG_TEXT[0] + GetMySimpleName(PChar) + DLG_TEXT[1];
Link.l1 = DLG_TEXT[2];
Link.l1.go = "exit";
}
Because that makes no sense at all. Basically that would mean you only ever get ANY other dialog if you ARE a pirate in a NON-pirate location.
Otherwise, you'll get whatever is at the top of that dialog file.

That may be intentional. What the dialogue there does is the pirates welcoming you into the pirate nation (according to lines 0, 1 and 2, anyway). It's one of the few bits of that file that i haven't changed. I've been getting the dialogue below that section all the time in-game, so it's at least partially working.

The "random_pirates_group_dialog.c" is only used as part of the Random_pirates_group function.

That i know. I've seen my old version of this dialogue in action many times, since i tend to use my crew on shore quite a lot. The fact that the dialogue was so badly written was the reason i started modding it in the first place. :p

Technically may be possible. But probably not necessary. And unless your flag is personal or of your "served nation", it'll always be hostile to someone.
Or are you considering that these are guys who may show up in non-pirate ports and they actually comment on you having a flag false to the nation of that port?

Could do that. Wouldn't know how though.
 
That code is not correct. Meaning it will be rejected by the engine.
rand is a function. You call it like rand(N), N being some integer number, and it returns a random integer between 0 and N. It's like rolling N-sided die.
"rand < something" makes no sense in Storm engine's language and it will give you a bunch of complains in error.log

Is this better?

Code:
if(rand(GetRankFromPoints(GetScore(PChar)))>6)
 
That may be intentional. What the dialogue there does is the pirates welcoming you into the pirate nation (according to lines 0, 1 and 2, anyway). It's one of the few bits of that file that i haven't changed. I've been getting the dialogue below that section all the time in-game, so it's at least partially working.
Then I think this check makes more sense:
Code:
if (IsInServiceOf(PIRATE))
That one checks if you officially joined the pirates.

That i know. I've seen my old version of this dialogue in action many times, since i tend to use my crew on shore quite a lot. The fact that the dialogue was so badly written was the reason i started modding it in the first place. :p
Ah, gotcha. :doff

Could do that. Wouldn't know how though.
I'd say it's not worth the effort. :shrug

Is this better?

Code:
if(rand(GetRankFromPoints(GetScore(PChar)))>6)
I do believe so. That should NEVER return true until you're Famous; after that, it gets up to around 50% chance by the time you've reached the maximum fame level.
 
Back
Top