• 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 Some minor issues

jsv

Freebooter
Storm Modder
A couple of minor issues I've come across during my first week of playing the game.
  • Directsail spoilers:
    • When you encounter floating stuff, RandomShipEvent() gives you a compass direction towards that stuff. Probably it should give ship-relative bearing instead.
    • Messages "Captain, we are approaching some Island" and announcements of island names on Land-Ho seem inappropriate for the Iron Man mode. They are kind of spoiling the fun of being totally lost at sea. :) Maybe there should be an option for Land-Ho info level, similar to Sail-Ho info?
  • Quest cargo gets loaded and unloaded instantly. I'd expect it to be hauled by the crew just like normal cargo. I think that's one of the places where a bit of realism can be added without hurting gameplay.
 
For which quests is the cargo directly loaded and unloaded? I believe for the fetch and shop quests it does take time.

The land ho sounds like a good idea.
 
When you encounter floating stuff, RandomShipEvent() gives you a compass direction towards that stuff. Probably it should give ship-relative bearing instead.
You're right, that would be more commonly used. :yes

Extract attached to your PROGRAM folder to change it. I haven't tested it, but I think it should work.

Messages "Captain, we are approaching some Island" and announcements of island names on Land-Ho seem inappropriate for the Iron Man mode. They are kind of spoiling the fun of being totally lost at sea. :) Maybe there should be an option for Land-Ho info level, similar to Sail-Ho info?
We can just do away with that text altogether, which I have done in attached file. The reason for adding it in the first place was so you could anticipate on the reload by changing flags early.
But since the false flag detection chance is not instant any-more when you reload, but is based on the distance to other ships, there is no longer any need for that.

Quest cargo gets loaded and unloaded instantly. I'd expect it to be hauled by the crew just like normal cargo. I think that's one of the places where a bit of realism can be added without hurting gameplay.
Unfortunately the RemoveCharacterGoods line is in the individual storekeeper dialogs. So we'd have to edit all of those.
The time-calculating code doesn't look so simple either:
Code:
// TIH --> proper time spent loading/unloading cargo Jul20'06
// divide by zero fix, time calc adjustment, prevents months (even a year) lost buying ammo or unloading whole ships
// first function logs their starting cargo numbers - called in interface initialization
// second function figures out how much time it will take after you are done dealing with all cargo - called when exiting interface
// changed to base it off WEIGHT not UNITS (imagine buying 15000 gunpowder (only 50 weight), you could lose 100 days with a small crew!!!)
void CreateStartingCargo()
{
   if( CheckAttribute(refCharacter,"startingCargo") ) DeleteAttribute(refCharacter,"startingCargo");
   int i;
   string sfstr;
   for(i=0;i<GOODS_QUANTITY;i++)
   {
     sfstr = "good" + i;
     refCharacter.startingCargo.(sfstr) = GetCargoGoods(refCharacter,i);
   }

}
void CargoTransferTimelapse()
{
   ref mainRef = GetMainCharacter();   // LDH 26Nov06 added

   if( TIME_MOVEGOOD < 1 )                    {return;} // no need to bother if the mod has been disabled
   if( CheckAttribute(GetMainCharacter(),"skipstoretime") )    {return;} // tutorial has no time spendature
   if( !CheckAttribute(refCharacter,"startingCargo") )      {return;} // no attribute? no execute

   int goodsTransfer = 0;
   int newQty = 0;
   int oldQty = 0;
   string attrGood = "";

   // go through their hold, and see what changed
   // if no quantities changed for a good, then OBVIOUSLY you dont spend time transfering it !!!
   int i;
   string sfstr;
   for(i=0;i<GOODS_QUANTITY;i++)
   {
     sfstr = "good" + i;
     newQty = GetCargoGoods(refCharacter,i);
     oldQty = refCharacter.startingCargo.(sfstr);
    
     // if a change in quantity, add it to transfer
     if ( newQty != oldQty ) {
       goodsTransfer += makeint( ( abs(newQty - oldQty) / sti( Goods[i].Units ) ) * sti( Goods[i].Weight ) );
     }
   }
   DeleteAttribute(refCharacter,"startingCargo");

   if ( goodsTransfer <= 0 ) return; // dont do anything if no goods to move about

   int tmpLangFileID = LanguageOpenFile("interface_strings.txt");// MAXIMUS

   LogIt(LanguageConvertString(tmpLangFileID,"Crew begins transfer of") + " " + goodsTransfer + " " + LanguageConvertString(tmpLangFileID,"cwt of cargo."));

   // now figure out the calculation of how long your crew will take
//   int crewNum = GetCrewQuantity(refCharacter);
   int crewNum = GetSquadronCrewQuantity(mainRef);   // LDH 26Nov06
   if (crewNum < 1) crewNum = 1;// if no crew, then captain alone has to transfer the goods

   float leaderDivisor = makefloat( GetSummonSkillFromName(mainRef, SKILL_LEADERSHIP) * 0.05 );// leadership reduces time wasted
   if (leaderDivisor <= 0) leaderDivisor = 0.01;// if a seriously poor leader (skill 0), then set to lowest

   int timeToAdd = 60 + makeint(((TIME_MOVEGOOD * goodsTransfer) / crewNum) / leaderDivisor);// takes at least one hour
   if ( timeToAdd > 10080 ) timeToAdd = 10080;// never go above 7 days for ANY transfer

   // LDH 16Oct06 changed rounding to more accurately reflect time passed
   if ( timeToAdd > 1440 ) {
//     if ( makeint(round(timeToAdd/1440)) < 2 )    LogIt(LanguageConvertString(tmpLangFileID,"Transfer takes roughly a day"));// MAXIMUS
     if ( round(timeToAdd/1440) < 1.5 )        LogIt(LanguageConvertString(tmpLangFileID,"Transfer takes roughly a day"));// MAXIMUS
     else                      LogIt(LanguageConvertString(tmpLangFileID,"Transfer takes roughly") + " " + makeint(round(timeToAdd/1440)) + " " + XI_ConvertString("days"));// MAXIMUS
   } else {
//     if ( makeint(round(timeToAdd/60)) < 2 )    LogIt(LanguageConvertString(tmpLangFileID,"Transfer takes roughly an hour"));// MAXIMUS
     if ( round(timeToAdd/60) < 1.5 )        LogIt(LanguageConvertString(tmpLangFileID,"Transfer takes roughly an hour"));// MAXIMUS
     else                      LogIt(LanguageConvertString(tmpLangFileID,"Transfer takes roughly") + " " + makeint(round(timeToAdd/60)) + " " + XI_ConvertString("hours"));// MAXIMUS
   }

   AddTimeToCurrent(0, timeToAdd );
   LogIt("Time: " + GetStringTime(GetTime()));     // LDH 15Oct06 added time display
   LanguageCloseFile(tmpLangFileID);
}
// TIH <--
:facepalm

For which quests is the cargo directly loaded and unloaded? I believe for the fetch and shop quests it does take time.
Regular storekeeper cargo quests.
 

Attachments

  • CCCdirectsail.zip
    14.9 KB · Views: 105
hmmm...tought those quest cargos did take time. I will look into that while doing the sidequests because I probally need to look at it anyhow.
 
They don't take time. In fact, they used to not even take the cargo until I fixed that. :facepalm
 
With the attached CCCdirectsail.c:
  • bearings to flotsam are ok now;
  • "We are approaching... " messages are still there (line 530 and below). As for Land-Ho messages you've commented out, I don't think it's a good idea to remove them completely; I'd rather just removed the island name from them. At this point you often can't see the land yourself, so it's just natural to ask your lookouts "where away?".
I can make the changes myself and attach the result if you prefer. Although I don't trust my English very much when message texts are concerned. Should that be "Captain, land in sight..." or something else? And, in general, how does one contribute to a project without a VCS? :8q
 
You'd be very welcome to make the changes yourself. You can ZIP up the modified file and attach it to your forum post with the "Upload a File" button.
If there is anything wrong with the spelling, I'll fix it for you. "Land in sight" sounds just fine to me anyway. :doff

We don't have a Version Control System in use at the moment anyway; we either use forum attachments, e-mail or the FTPs.
Not the most professional method, I agree, but it is simple and works if only a few people work on the game.
We are thinking about setting up a VCS again some time though.
 
Back
Top