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

Age of Pirates II ... only for the original version ... from de Zee Roovers « german Team »

That is not right.
Linking Boolean expressions
if (5<=a && a<=10) .... this is a " and" function
if (5>a || a>10) .... this is a "or" function
I know. That is my point.

Look at this line:
Code:
if (GetTime() >= 22.00000 && GetTime() <= 5.59999) Islands[iCurLocation].QuestlockWeather = "Storm04";
You want "Storm04" to be used during night, right? So for example, at 03:00 when GetTime() would return 3.0 .
You then check:
Code:
if (3.0 >= 22.00000 && 3.0 <= 5.59999) Islands[iCurLocation].QuestlockWeather = "Storm04";
3.0 is NOT greater than 22, so the first half is false.
But 3.0 IS smaller than 5.59999, so the second half is true.

That means:
Code:
if (false && true) Islands[iCurLocation].QuestlockWeather = "Storm04";
Which returns 'false' and therefore this will never happen.

As far as I can tell, what you want is:
Code:
if (GetTime() >= 22.00000 || GetTime() <= 5.59999) Islands[iCurLocation].QuestlockWeather = "Storm04";

Or you could do:
Code:
Islands[iCurLocation].QuestlockWeather = "Storm04";
if (GetTime() >= 6.00000 && GetTime() < 10.00000) Islands[iCurLocation].QuestlockWeather = "Storm01";
if (GetTime() >= 10.00000 && GetTime() < 18.00000) Islands[iCurLocation].QuestlockWeather = "Storm02";
if (GetTime() >= 18.00000 && GetTime() < 20.00000) Islands[iCurLocation].QuestlockWeather = "Storm03";

And if you want it REALLY safe:
Code:
Islands[iCurLocation].QuestlockWeather = "Storm04"; // default for night time, e.g. between 22:00 and 06:00
if (GetTime() > 6.0) // Time is after 06:00
{
   if (GetTime() < 10.0) // Time is between 06:00 and 10:00
   {
     Islands[iCurLocation].QuestlockWeather = "Storm01";
   }
   else // Time is after 10:00
   {
     if (GetTime() <  18.0) // Time is between 10:00 and 18:00
     {
       Islands[iCurLocation].QuestlockWeather = "Storm02";
     }
     else // Time is after 18:00
     {
       if (GetTime() <  22.0) // Time is between 18:00 and 22:00
       {
         Islands[iCurLocation].QuestlockWeather = "Storm03";
       }
     }
   }
}

Anyway, if you believe me to be wrong, then go right ahead. I don't actually care, so have fun! :rolleyes:
 
:rolleyes: Pieter a very one-sided way of looking at things. :cheeky
This is just one element. But I have the entire game on a stand set.
Therefore, further changes in the time system come.
The time system is very flawed.

Day.c ... 11 hours
... that is not right
Code:
  Weathers[n].Hour.Min = 11;
  Weathers[n].Hour.Max = 11;

correct would be
Code:
    Weathers[n].Hour.Min = 11.00000;
    Weathers[n].Hour.Max = 11.59999;
 
Day.c ... 11 hours
... that is not right
Code:
  Weathers[n].Hour.Min = 11;
  Weathers[n].Hour.Max = 11;

correct would be
Code:
    Weathers[n].Hour.Min = 11.00000;
    Weathers[n].Hour.Max = 11.59999;

I don't know why, but after I changed the code in day.c, my game freezes just a minute or two after loading the game and I get a crash to desktop. I don't know if this has anything to do with it, but it started after changing the codes in weather...
 
It must be carried out changes in the files
Day.c
DayStorm.c
Evening.c
Morning.c
Night.c
Special.c

Reference / Example

Do they fit the time exactly .... for each hour

Weathers[n].Hour.Min

Code:
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(8):    Weathers[n].Hour.Min = 11.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(199):    Weathers[n].Hour.Min = 12.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(384):    Weathers[n].Hour.Min = 13.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(570):    Weathers[n].Hour.Min = 14.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(756):    Weathers[n].Hour.Min = 15.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(940):    Weathers[n].Hour.Min = 16.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(1124):    Weathers[n].Hour.Min = 17.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(1307):    Weathers[n].Hour.Min = 18.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(7):    Weathers[n].Hour.Min = 6.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(195):    Weathers[n].Hour.Min = 10.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(384):    Weathers[n].Hour.Min = 18.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(579):    Weathers[n].Hour.Min = 22.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(774):    Weathers[n].Hour.Min = 6.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(969):    Weathers[n].Hour.Min = 10.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(1165):    Weathers[n].Hour.Min = 18.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(1361):    Weathers[n].Hour.Min = 22.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(7):    Weathers[n].Hour.Min = 19.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(193):    Weathers[n].Hour.Min = 20.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(377):    Weathers[n].Hour.Min = 21.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(562):    Weathers[n].Hour.Min = 22.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(748):    Weathers[n].Hour.Min = 23.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(8):    Weathers[n].Hour.Min = 6.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(194):    Weathers[n].Hour.Min = 7.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(380):    Weathers[n].Hour.Min = 8.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(564):    Weathers[n].Hour.Min = 9.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(748):    Weathers[n].Hour.Min = 10.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(11):    Weathers[n].Hour.Min = 0.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(191):    Weathers[n].Hour.Min = 1.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(371):    Weathers[n].Hour.Min = 2.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(551):    Weathers[n].Hour.Min = 3.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(731):    Weathers[n].Hour.Min = 4.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(911):    Weathers[n].Hour.Min = 5.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Special.c(7):    Weathers[n].Hour.Min = 0.00000;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Special.c(157):    Weathers[n].Hour.Min = 0.00000;

Weathers[n].Hour.Max
Code:
 E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(9):    Weathers[n].Hour.Max = 11.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(200):    Weathers[n].Hour.Max = 12.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(385):    Weathers[n].Hour.Max = 13.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(571):    Weathers[n].Hour.Max = 14.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(757):    Weathers[n].Hour.Max = 15.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(941):    Weathers[n].Hour.Max = 16.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(1125):    Weathers[n].Hour.Max = 17.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Day.c(1308):    Weathers[n].Hour.Max = 18.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(8):    Weathers[n].Hour.Max = 9.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(196):    Weathers[n].Hour.Max = 17.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(385):    Weathers[n].Hour.Max = 21.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(580):    Weathers[n].Hour.Max = 5.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(775):    Weathers[n].Hour.Max = 9.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(970):    Weathers[n].Hour.Max = 17.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(1166):    Weathers[n].Hour.Max = 21.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\DayStorm.c(1362):    Weathers[n].Hour.Max = 5.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(8):    Weathers[n].Hour.Max = 19.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(194):    Weathers[n].Hour.Max = 20.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(378):    Weathers[n].Hour.Max = 21.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(563):    Weathers[n].Hour.Max = 22.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Evening.c(749):    Weathers[n].Hour.Max = 23.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(9):    Weathers[n].Hour.Max = 6.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(195):    Weathers[n].Hour.Max = 7.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(381):    Weathers[n].Hour.Max = 8.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(565):    Weathers[n].Hour.Max = 9.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Morning.c(749):    Weathers[n].Hour.Max = 10.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(12):    Weathers[n].Hour.Max = 0.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(192):    Weathers[n].Hour.Max = 1.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(372):    Weathers[n].Hour.Max = 2.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(552):    Weathers[n].Hour.Max = 3.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(732):    Weathers[n].Hour.Max = 4.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Night.c(912):    Weathers[n].Hour.Max = 5.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Special.c(8):    Weathers[n].Hour.Max = 23.59999;
  E:\Age of Pirates 2 - Test\Age of Pirates 2\program\weather\init\Special.c(158):    Weathers[n].Hour.Max = 23.59999;
 
@Jan Marten: Are there any large differences in the PROGRAM and RESOURCE\INI code between the original German and English versions of CoAS?
The only differences should be related to language and translation, right?
Maybe you would consider making all corrections to your own game and uploading the files themselves?
That way people are certain to get the correct versions.
 
@Jan Marten: Are there any large differences in the PROGRAM and RESOURCE\INI code between the original German and English versions of CoAS?
The only differences should be related to language and translation, right?
Maybe you would consider making all corrections to your own game and uploading the files themselves?
That way people are certain to get the correct versions.

There's a lot different. We went based on the fact the entire game as a unit to modernize.
We make almost a year almost only debugging.
 
I want to say that I only a debugging for the original game. No Fine Tunning.
I have the whole in a project folder ... otherwise would not be possible all.
 
I also think that uploading the modified files as one patch would make things easier. I didn't do the changes for other files, sorry Jan, I thought that I was supposed to change Day.c. Now that you added more changes, I think it will work.
 
I also think that uploading the modified files as one patch would make things easier. I didn't do the changes for other files, sorry Jan, I thought that I was supposed to change Day.c. Now that you added more changes, I think it will work.
In the German version it is running. The weather changes going after to the eye almost not visible in front to himself.
 
Jan, thank you very much for your contribution on improving original COAS! Danke schöne! :) I hope that I'm not the only one on this forum who has been able to use the benefits of your work.

Cheers!
 
Jan, thank you very much for your contribution on improving original COAS! Danke schöne! :) I hope that I'm not the only one on this forum who has been able to use the benefits of your work.

Cheers!

:rofl For them it is not over yet. See you in the database.

And now something new. The first try. See it on the waves ...

380.jpg
 
Back
Top