TGEA 1.7.0 Mission Lighting fail for connecting client
by Helk · in Torque Game Engine Advanced · 04/09/2008 (8:44 pm) · 11 replies
Another issue with connecting clients, the mission lighting always fails, unless you have it installed to the same path on both the server and the client, the $Client::MissionFile is being transmitted and set as the full path on the server, if this doesnt match up on the client then the lighting will fail....
About the author
#2
04/15/2008 (3:17 pm)
I had this issue too. For some odd reason it fixed itself.
#3
04/15/2008 (11:01 pm)
This should probably be done on the server side before it's sent across
#4
04/20/2008 (6:54 pm)
Same problem, the level (one large dif) is entirely black when a client connects but looks just fine for me.
#5
near the top of function createServer() in common\serverScripts\server.cs. Should accomplish the same thing as the code snippet above but do it on the server before it is sent to the client.
05/13/2008 (4:10 pm)
The fix that I went with for the next version of TGEA is to add the line:%mission = makeRelativePath(%mission, getWorkingDirectory());
near the top of function createServer() in common\serverScripts\server.cs. Should accomplish the same thing as the code snippet above but do it on the server before it is sent to the client.
#6
05/13/2008 (5:01 pm)
Yeah I knew that would be the proper way, thanks for looking into this, I'm still new to the inner workings of torque.
#7
05/17/2008 (11:47 pm)
This change actually broke mission loading on our build, because the path would end up getting cut off a bit...
#8
I mean even overwriting material errors and missing texture errors are using full pathnames which just look odd
05/18/2008 (12:41 am)
I ended up doing this in a different place for some of the changes we use with mission lists and it fixed our problem, but the full pathnames are just messy looking.I mean even overwriting material errors and missing texture errors are using full pathnames which just look odd
#9
The above fix breaks the entire game if the mission is passed as ~/Data blah blah or Core/Data blah blah
Core/Data/Missions/Stronghold.mis becomes:
../ore/Data/Missions/Stronghold.mis
~/Data/Missions/Stronghold.mis becomes:
..//Data/Missions/Stronghold.mis
This isn't an issue for Hosting thru the GUI, but in a dedicated server situation, the pathing is a bit different initially. Why was pathing changed so much to use full paths and not relative
05/18/2008 (1:40 pm)
Well, I experimented some more, but in a dedicated server situation -The above fix breaks the entire game if the mission is passed as ~/Data blah blah or Core/Data blah blah
Core/Data/Missions/Stronghold.mis becomes:
../ore/Data/Missions/Stronghold.mis
~/Data/Missions/Stronghold.mis becomes:
..//Data/Missions/Stronghold.mis
This isn't an issue for Hosting thru the GUI, but in a dedicated server situation, the pathing is a bit different initially. Why was pathing changed so much to use full paths and not relative
#10
Most of the changes with pathing occurred because of the merge with TGB's code. Tools need to be able to reference full system paths for assets that aren't a part of the editor/game folder structures (like adding a new sprite texture). Unfortunately, this did have some unforeseen sideeffects which are working our way through.
I'll check out the dedicated server thing...definitely looks like a bug.
05/19/2008 (11:49 am)
Quote:
Why was pathing changed so much to use full paths and not relative
Most of the changes with pathing occurred because of the merge with TGB's code. Tools need to be able to reference full system paths for assets that aren't a part of the editor/game folder structures (like adding a new sprite texture). Unfortunately, this did have some unforeseen sideeffects which are working our way through.
I'll check out the dedicated server thing...definitely looks like a bug.
#11
Just an annoyance right now :)
I did get it all working within dedicated server scenario, but you have to pass the full path to the -mission command, so it might not be an issue for some, but then for others it might be.
I suspect we will just set the path as a pref somewhere and reassemble the proper mission path, at some point in the script
05/19/2008 (5:29 pm)
Makes sense as there some moving to allowing access to more than just what the "Resource Manager" currently sees, so to speak..Just an annoyance right now :)
I did get it all working within dedicated server scenario, but you have to pass the full path to the -mission command, so it might not be an issue for some, but then for others it might be.
I suspect we will just set the path as a pref somewhere and reassemble the proper mission path, at some point in the script
Torque 3D Owner Helk
function correctMissionFile( %missionFile ) { %myTokens = %missionFile; %final = "scriptsAndAssets"; %continue = false; while( "" !$= %myTokens ) { %myTokens = nextToken( %myTokens , "theToken" , "/" ); if(%theToken $= "data" || %continue) { %final = %final @ "/" @ %theToken; %continue = true; } } echo("final path:" SPC %final ); return %final; }then change the $client::missionfile line of function clientCmdMissionStartPhase3(%seq,%missionName) to this
function clientCmdMissionStartPhase3(%seq,%missionName) { //... $Client::MissionFile = correctMissionFile(%missionName); //... }