• 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 Random loading screens

Status
Not open for further replies.
Hello Pieter,

Well I tried to make this work, but alas the game won't even start. By deleting one of the brackets in the reload.c code the game runs, but the location in question simply opens with no screen at all. Its as if it doesn't know which image to select I suspect because it doesn't know which image to select (1 to 5) and no instruction is given for it to select one specifically or default to rand or switch, so it selects a black screen.

Rather than listing them like this...
Locations[n].image.1 = "loading\Tavern7.tga";
Locations[n].image.2 = "loading\Tavern11.tga";
Locations[n].image.3 = "loading\Party4.tga";
Locations[n].image.4 = "loading\SpanishTavern2.tga";
Locations[n].image.5 = "loading\SpanishTavern5.tga";


...in each locations init file, I wonder if it might be better to have a switch right before the list directing it to the list???
Was I supposed to insert my list in some centralized location like locations_init? POTC's file and COAS's files are totally different. My understanding is that I would list then in each individual locations file where I wanted the variety to change each time your character visits.

I was wondering if there could be a file where I could enter a "pict_index" and list the illustrations named in order so that it could point there to know what to do.

I am at a loss.

MK
 
POTC's file and COAS's files are totally different. My understanding is that I would list then in each individual locations file where I wanted the variety to change each time your character visits.
They are hardly different at all in this case. I checked it before making my previous post and the loading screen system between both games is virtually identical.
I only tested it in PotC, where it does exactly what you want. There is no reason why it shouldn't work in CoAS. So it must be a small code error somewhere.

When the game refused to start, did you get any notes in error.log that could indicate what is wrong?
And when you got the black loading screens, was there anything related to loading screens in system.log?

Could you post your copy of reload.c and your Locations\init folder, as well as the unmodified versions of those files.
I'm away from home at the moment, so I don't have access to any CoAS game code to compare or test with.
But if you post the unmodified files as well, I can use WinMerge to see if I can spot any potential issues.

...in each locations init file, I wonder if it might be better to have a switch right before the list directing it to the list???
The code I posted goes in the location init entries, exactly where the current loading screens are already defined.
No need for it to go anywhere else.

Its as if it doesn't know which image to select I suspect because it doesn't know which image to select (1 to 5) and no instruction is given for it to select one specifically or default to rand or switch, so it selects a black screen.
The code knows what image to select from the switch(1+rand(GetAttributesNum(LoadingScreens)-1)) line.
It may look complicated, but it just means "select a random loading screen between image 1 and the maximum number of images defined for that location".
 
No I meant the Locations_init file itself is way different Pieter. I'm sure the way it works is the same as you say.

I scrapped everything and went back to what I had before. Didn't save any of it. I will try one more time. Maybe I did something wrong. I checked and double checked all my spacing and found it odd that it ran when I took one of the brackets away. I basically pasted exactly what you coded above and deleted the old section. Thanks for having a look.

I will post my files when I rewrite them for you to look at. I would really love to get at least this one thing done. It would really make the boarding sequences more interesting because I have over a dozen really good transition screens for boarding, but as it stands now you will only see three because once it selects the screen for small, medium, and large ship boarding encounters, they stay the same the whole game.

MK
 
You mean PROGRAM\Locations\location_init.c? You don't need to touch that file anyway.
The files in PROGRAM\Locations\init are similar enough. They do have the Locations[n].image line for each location in any case, which is what you need to change.

If you can send me your reload.c file at least, I can make sure that one is correct.
Please check your error.log, system.log and post your modified files here so I can check.
I'm sure we can sort this out.
 
Still crashes - game won't start. Here's the files I changed.
 

Attachments

  • reload.c
    20.1 KB · Views: 272
  • SentMartin.c
    51.7 KB · Views: 289
Do you have the unmodified ones too? Also, please post your .log files.
 
There's no log file Pieter because the game won't even start.

Here's the originals
 

Attachments

  • reload.c
    20.1 KB · Views: 281
  • SentMartin.c
    51.6 KB · Views: 281
Turns out there was a bracket missing. Attached should work fine. :yes

Your SentMartin.c looks exactly like it should. :onya
 

Attachments

  • reload.c
    20 KB · Views: 279
IT WORKS NOW!!! :bow

You my friend are once again --- THE MAN! :cheers

I am glad I waited one more day. I found some badly written historical references to what is happening with each country in the game and I just had to rewrite them. It took hours. I was hoping you would find the missing piece. I knew it had to be something simple like that. I tried to tweak it myself but wasted way to much time on it. Everyone will have to wait one more day now that I need to rewrite all the locations files to work with this method now. I told my family I would not be working on the game anymore for a few months after yesterday...they will have to wait one more day also. xD

MK
 
Glad to hear it works for real this time.
I don't know how long you've been trying to get this one working, but you won't have to waste much time on it anymore. :wp
But please tell me you didn't rewrite all location files before and have to do it again, right? :shock
 
Glad to hear it works for real this time.
I don't know how long you've been trying to get this one working, but you won't have to waste much time on it anymore. :wp
But please tell me you didn't rewrite all location files before and have to do it again, right? :shock

No Pieter, I only wasted a day on it and I only rewrote Saint Martin, Puerto Rico and Curacao.

I like to test with the Dutch colonies because there are only two that you will show up in at the beginning of the game - so you know you will always show up in the place you want to test out.

Now that it works though I will rewrite them all and much more expansively. Before when I rewrote them I only rewrote the port image for the test. Now that it works I will rewrite the taverns, brothels, shores, and then of course I have to rewrite the cabin and boarding files which will really add some excellent content to the game. Those are the ones I really wanted to work.

Thanks again!

MK
 
How many loading screens do you need per location? At the moment, the code is set up for a maximum of 5, but you can easily increase that to whatever you want.
All you need to do is add some more of those case lines in the reload.c switch statement.
 
Well its mostly finished and all of the towns and land locations are working perfectly....but something interesting happened at the end of the work which has made more work...:no

Five images per location was generally good until I finished with the conventional locations and moved on to the Boarding and cabin locations. For some reason they were not working and I looked at each deck ( small, medium and large) as different locations and so thought I could just restart 1 through 5 for each. Well I got nothing but black screens so I went ahead and rewrote the reload.c file for 15 images. Then because the Locator ID for all of those locations was simply Boarding_deck, I gave 1-5 to small, 5-10 to medium and 11-15 to large. The game runs fine but it still generated black screens. I noticed that aboard my own ship that the cabins, decks and hold images all worked fine, so it was a mystery to me.

This just gets more interesting......I finally decided I should check the ships_init.c and see what the IDs and deck names were in the ships entries and made some interesting discoveries. I am as guilty as anyone for this being this way because I have rewritten and cut and pasted many of the ships entries when I ported in new ships. However, what I discovered was a total and complete inconsistency in both the deck and cabin names, IDs and locators for most of the ships in the file. I immediately knew what my problem was. It had always been a mystery to me why occasionally with the old method I would still sometimes get black screens. Now I know. In some cases the information is completely missing for maybe a quarter of the ships or so.

I know this is where the problem is and am now completely rewriting the ship_init file with all 147 ships. I am specifically inserting the correct AbordageLocation into each ship's information.

Now as an aside and additional discovery.....I had never considered this to be part of the solution to getting the lower boarding decks to work before and Jan had said that the solution was getting all the right GMs and locators correctly named and in the right places. I had done all of that and am sure I had it right. The game even ran - just no lower boarding decks. Now I think I know why....the ships init file did not have those decks ID's in the locator instructions. :modding

I am not going to try to fix this today for this release. I am already delayed another day rewriting the ships_init file.

However, I think there is a very good likelihood that I will have the lower decks working for boarding in my first patch release for the mod. I plan to really mess around with that during the holidays. Maybe I will have a Christmas present for the few COAS players still kicking around. One can only hope!

:pirateraft

MK
 
Glad to hear you're still making progress! :cheers

Just so you know, once you ZIP up your work and post it, last-minute fixes can still be made in the Installer EXE.
So you could upload what you've got now and still make changes until the end of the month or so if necessary. :doff
 
Well it didn't work.

The work wasn't for nothing. I can use it in the future but I have all but given up. Something makes the boarding deck locations different than the town locations even thought they are all listed in the locations init.

I'm going back to RandPhraseSimple for boarding because at least it works. It's a shame though because you end up with the same three screens the whole game for small, medium, large after your first encounters.

As a last ditch hope maybe someone (Pieter) can see something I'm missing.

Here's the relevant code and what I attempted to get working with the new method. Attached is the file of what was there before that actually works but not how I want. If this isn't solved then this is what I'm using. MK

Edit: I actually have more images than those listed for variety, but for testing purposes didn't put them in. If we get it to work I will add more.


// ïàëóáû äëÿ âñåõ ïî òèïàì boal 03.01.05 ------------------------------------------------------->
//ID
Locations[n].id = "BOARDING_SMALL_DECK";
locations[n].id.label = "Boarding Deck";
//Info
Locations[n].type = "deck_fight";
Locations[n].filespath.models = "locations\decks\deckLowVSMedium";
Locations[n].image.1 = "loading\boarding3.tga";
Locations[n].image.2 = "loading\boarding11.tga";
Locations[n].image.3 = "loading\boarding8.tga";
Locations[n].image.4 = "loading\boarding12.tga";

Locations[n].lockCamAngle = 0.4;
Locations[n].camshuttle = 1;
//Models
//Always
Locations[n].models.always.deckLowVSMedium = "deckLowVSMedium";
Locations[n].models.always.locators = "deckLowVSMedium_locators";
//Day
locations[n].models.day.charactersPatch = "deckLowVSMedium_patch";
Locations[n].models.day.deckBigFonarsDay = "deckLowVSMedium_fd";
//Night
locations[n].models.night.charactersPatch = "deckLowVSMedium_patch";
Locations[n].models.night.deckMediumBigNight= "deckLowVSMedium_fn";
//Environment
locations[n].environment.weather = "true";
locations[n].environment.sea = "true";

Locations[n].boarding = "true";
Locations[n].boarding.locatorNum = 11;
Locations[n].boarding.nextdeck = "";
Locations[n].UpDeckType = true;

n = n + 1;

//ID
Locations[n].id = "BOARDING_MEDIUM_DECK";
locations[n].id.label = "Boarding Deck";
//Info
Locations[n].type = "deck_fight";
Locations[n].filespath.models = "locations\decks\deckLowVSBig";
Locations[n].image.1 = "loading\boarding1.tga";
Locations[n].image.2 = "loading\boarding6.tga";
Locations[n].image.3 = "loading\boarding8.tga";

Locations[n].lockCamAngle = 0.4;
Locations[n].camshuttle = 1;
//Models
//Always
Locations[n].models.always.deckLowVSBig = "deckLowVSBig";
Locations[n].models.always.locators = "deckLowVSBig_locators";
//Day
locations[n].models.day.charactersPatch = "deckLowVSBig_patch";
Locations[n].models.day.deckBigFonarsDay = "deckLowVSBig_fd";
//Night
locations[n].models.night.charactersPatch = "deckLowVSBig_patch";
Locations[n].models.night.deckMediumBigNigh = "deckLowVSBig_fn";
//Environment
locations[n].environment.weather = "true";
locations[n].environment.sea = "true";

Locations[n].boarding = "true";
Locations[n].boarding.locatorNum = 12;
Locations[n].boarding.nextdeck = "";
Locations[n].UpDeckType = true;

n = n + 1;

//ID
Locations[n].id = "BOARDING_BIG_DECK";
locations[n].id.label = "Boarding Deck";
//Info
Locations[n].type = "deck_fight";
Locations[n].filespath.models = "locations\decks\deckMediumVSBig";
Locations[n].image.1 = "loading\boarding.tga";
Locations[n].image.2 = "loading\boarding2.tga";
Locations[n].image.3 = "loading\boarding7.tga";

Locations[n].lockCamAngle = 0.4;
Locations[n].camshuttle = 1;
//Models
//Always
Locations[n].models.always.deckMediumVSBig = "deckMediumVSBig";
Locations[n].models.always.locators = "deckMediumVSBig_locators";
//Day
locations[n].models.day.charactersPatch = "deckMediumVSBig_patch";
Locations[n].models.day.deckFonarsDay = "deckMediumVSBig_fd";
//Night
locations[n].models.night.charactersPatch = "deckMediumVSBig_patch";
Locations[n].models.night.deckFonarsNigh = "deckMediumVSBig_fn";
//Environment
locations[n].environment.weather = "true";
locations[n].environment.sea = "true";

Locations[n].boarding = "true";
Locations[n].boarding.locatorNum = 13;
Locations[n].boarding.nextdeck = "";
Locations[n].UpDeckType = true;

n = n + 1;

////////////////////
return n;
}
 

Attachments

  • boarding.c
    102.8 KB · Views: 297
Looks like the boarding system doesn't use that code in reload.c at all. However, I have found what it does use.
Extract attached to Program\loc_ai . That should enable this mod for boarding as well. :doff
 

Attachments

  • LAi_boarding.zip
    11.7 KB · Views: 244
Status
Not open for further replies.
Back
Top