Map and/or sessions going awry

HiBaller

19 Years of Trainz
I hope someone can help me with a strange thing happening to me. We are passing around various maps & sessions while working on the DHR. The last map I created was sent to Narrowgauge, which he modified with four sessions and sent it back. I absolutely cannot open any of the sessions without getting a black screen in both Driver and Surveyor. I try to open the map in Surveyor and get a black screen also.

I have run TO against it and come up with no problems at all, but the map will still not load. The black screen appears immediately upon releasing the mouse after a double-click.

Now, here is the strange part. I open the map anyway, delete "missing" assets and save it under a new KUID (mine). The next time I go to open it, black screen again - and this one is MY own map. A comparison between the original and my map using TO will show absolutely NO difference between maps in content.

I seem to remember a while back, on the old forum, a post like this having to do with sessions giving a black screen instead of running properly. Does anyone remember this?

Bill
 
TO does not show all the faults in an asset. This may be a texture thats the wrong size or a wrong or old kuid number being used in the config and not deleted. CMP in 06 is less tolerant and shows these errors but 04 is more tolerant of them and will still allow them to work. The reason that delete missing assets wont do anything is that an unused asset has been named in the config but not used so it is not there to be deleted. This could be in any piece of content thats been added.
 
Thanks Stagecoach. Looks like I will have to go looking for something that isn't used in the map, but is in the config file. Not an easy task in a 40MB map.

Bill
 
Hi Bill,

Another possibility is you are missing a sub-dependency. TO's initial analysis of the map wont find it, but if you load the map in TO then right-click anywhere on the field there is an option in the pop-up menu something like "Search for 3rd party content missing dependencies". That might turn something up....

Andy :)
 
Thanks, Dermmy. That certainly is a possibility. I finally was able to load the map's session (after accepting a black screen) and just changed a green tick mark in one of the session rules. I then saved the session and map as a new map and session. Now, both of them load just fine. What remains to be seen is if anyone else can run my map/session. If they can, then the glitch was temporary, but if they can't then I have something that causing the glitch and I have to root it out.

The popup that appears is actually: Selection -> check for missing dependencies. It appears to work well, but doesn't show anything that points to my problem.

EDIT: Started up this morning and the same problem appeared on my own map/session. I got a black screen. How the heck can this happen? Both the map and session loaded just fine last night. I saved them; and this morning it fails. How can I HAVE content one day and NOT have it the next?

Bill
 
Last edited:
'Caus you didn't have it yesterday either! It's all in the way Trainz saves the map config....

If the problem has only reared its head since a session was created, the black screen is almost always a missing sub-dependency: most likely a 'product' missing from either an industry or a piece of rolling stock. A missing product won't stop the rs from appearing, but will cause the black screen.

To find the product fire up TO and...

(a) select 'Rolling Stock', then from the 'Menu' button near the bottom right hand corner of the screen select 'Check for missing RS parts'

If that draws a blank...

(b) select 'Maps', let TO analyse the map in question, then as suggested above, right-click and select 'Check Custom Objects for Missing Dependencies' from the pop-up menu. I just checked, that is the exact menu option. If you get 'check for missing dependencies' you are in the wrong menu.....

Andy :)
 
Ah. Gotcha. I'll give that a try. I'm basically grasping at straws now. This is really one weird problem.

Bill
 
According to TO, I am missing a BUILT-IN called "Max Permitted Speed", and the KUID is -3:10197. My version is TRS2004, V2.4, build 2365. Is that not the latest? If so, then why don't I have it? I don't think I've missed an update or service pack.

Bill
 
Lynxfan: That is probably what is doing it. We are all using TRS2004, but somehow that built-in got inserted into either a session or one of the maps. I am just going to delete it as I have already downloaded and installed the one from Bloodnok.

Bill
 
I have found the problem. Apparently, the KUID of kuid2:60850:89000:4 has a dependency on the KUID -3:10197. TO tells me this when I highlight the rule and right-click to the popup menu and 'Check Dependencies'.

I guess this rule is for TRS2006 then as that particular built-in isn't present in TRS2004.


Bill
 
I think the rule started out as 04 but was adapted for 06. Ive a feeling that if you use the 06 way of the rule it fails in 04. ive got several wagons with this rule but only the older version seems to work in 04. Might be wrong but thats how mine seem to work.
 
stagecoach

This is where things get a bit twisted. The rule states that it is for 2.1 and despite the missing item, which I don't have either, on my machine running 2004 it works fine. I sent Bill my complete, properly working, world folder, he swapped it into his machine and it gave the same problems.

What would you make of that?

Further discoveries.

The file that MaxPermittedSpeed is looking for is in 2004, it is 'SessionVariablesLibrary.gs and .gsl. The contents seem to be precisely the same as in the files in 2006 and TC. The make date on the file is 17/07/2004. The DLS only shows one version of the rule and that is labelled for 2.4. There have been over 15000 downloads, if the dependency was a problem, 15000 people would make a lot of noise.

In 2006 there is a stub file that calls up the .gs file and that is what seems to be missing and this explains why TO could not find the file. If a gs file is listed in an 'Include' statement does the program find it anyway because it is in the libraries folder, which makes the stub file redundant. The fact that the rule woked for me seems to indicate that the required .gsl file is being found and used.

This is what the config.txt says

kuid-table {
sessionvariableslibrary <kuid:-3:10197>
scripthudlibrary <kuid:-18:1200>
0 <kuid:60850:88000>
}


That thickens the plot a little.

Cheers

Peter
 
Last edited:
"Included" source files are only found if they exist in the scripts directory (which should only be Auran's script code that is distributed with the game) or if they are located in the same directory as the .gs file that's including them. There are no libraries per say like in c unfortunately. Library assets can't be included using an include statement. They have to be accesed in the script by getting a reference from the game engine to the library asset itself.

So if the included file isn't one of Auran's supplied scripts then a copy of it has to be supplied in the same directory with the .gs file.

Bob Pearson
 
Bob

TheSessionVariablesLibrary.gs file is an Auran supplied file and it is in the TRS2004\scripts\ folder. So my surmise was correct. Because it is in the 'Official' scripts folder it would be found by any script having its name as an 'Include' entry. Therefore, it has been working for me all the time and the stub file from which it gets the kuid-3:10197 is not really needed for the rule to work. I can do something about the stub file and that would be one more missing content removed

That points the bone away from the rule as being the upsetting factor that is bugging Bill. This is good because I wanted to use that rule.

Thanks for the information.

Cheers

Peter
 
Something doesn't make sense because script files in the script folder don't have kuid numbers. I looked at a copy of the rule source code and it does use the sessionvariableslibrary tag in the kuid-table to get the kuid for this library asset and gets a reference to the asset from the game. So kuid:-3:10197 is required.

Maybe this will cear it up as it appears you need both for the library to work. This is taken from the SessionsVariables.gs file which is included by the rule:

// NOTE:
// Because Library.gs support is not complete as of writing this class,
// this script is present in the core Scripts folder, and will be included
// using the 'include "SessionVariables.gs"' syntax. Support for this usage
// will be maintained in future versions of Trainz.
//
// HOWEVER:
// You must still use World.GetLibrary(..) to access this library object.
// The asset for this SessionVariables.gs script is <KUID:-3:10197>.
//

As I see it looking at this and the rule code itself you must have kuid:-3:10197 in order for the script to be able to use the library. This is due to the odd way the script language handles libraries.

Bob Pearson
 
Bob

Thanks, that does make it clearer. It seems that for some reason the actual -3:10197 file was omitted from TRS2004 although the .gs file it referred to was included. The required file is in 2006, does anyone see any reason why I should not copy that file back into TRS2004. Obviously, it should be in one of the .ja files but if it is present in the downloads folder it should serve the same purpose. We are going to have to distribute the DHR with a zip file to cater for the non-DHR assets we are using, including this file would take care of the distribution.

I'm still puzzled by the fact that the rule appeared to do precisely what it was intended to do, and all this discussion arose, not because the rule failed to work, but because an intermediate file was missing.

As Bloodnok is still part of the Trainz team, I will contact him about this.

Cheers

Peter
 
Back
Top