Login  Register
 



Post new topicReply to topic
 
Author Message
 PostPosted: 23 Feb, 2007 
 
User avatar

Joined: 15 Feb, 2007
Posts: 1439
Offline
- Data search paths

SupCom allows you to specify arbitrary paths to find data, and gives you complete control over what paths to look for data and in what order they are to be searched. This is especially useful for total conversions of the game where you want to use the executable, but provide all your own assets. For the time being, until the mod manager is overhauled, it's also the best way to do directory shadowing (much cleaner than adding directories to the installed game path.) There are two methods you can specify search paths.

Command line switch /data [directories split by semicolons]
The data command line switch allows you to specify all the directories that will get searched for data. It's important to note that if you specify a data command line that it will NOT append the original game directories. You need to add them yourself. The directories are specified as either fully qualified paths or paths relative to the executable. The directories are read in order that they are listed, so if you want to shadow a file, make sure you include its path first.

So for example, you have your mod in a directory c:\mymod, and you want to shadow the aitypes.lua file (found in
c:\mymod\lua\modules\ui\lobby), but use the rest of the SupCom data you could use a command line like this:

SupremeCommander.exe /data c:/mymod;../gamedata/*.scd;..

- The first path is just the direct path to our mod. The disk system will expect to find directories and files that correspond to the locations of different data file types.
- The second path shows how to map the scd files. When the disk systems sees *.scd it now knows that there will be files named for the top level directory structure of the data and that they are zip files containing the rest of the directory structure in them. For example, in your script, when you specify a path "/lua/modules/ui/lobby" and it's in an scd file, it would expect to find it in a file called lua.scd, and in the zip archive it would be in /modules/ui/lobby.
- The third path shows how we magically read in files when you extract them to the tld.

Command line switch /init [lua file]
Another way to specify data directories is with the /init command line. All that you need to provide is a fully qualified path and file name for a lua file which contains the table of paths. The default file is the SupComDataPath.lua which is found in the bin directory of your game install. The file itself should just be a simple table called "path" and will be structured as follows. Note that the array index denotes in what order the path will be sarched (smallest first.)

Code:
path = {
    "c:/mymod",
    "../gamedata.*.scd",
    "..",
}


This will have exactly the same effect as the /data example.


Top
 Profile  
 PostPosted: 26 Feb, 2007 
 

Joined: 15 Feb, 2007
Posts: 392
Location: email III_Demon at yahoo
Offline
in the beta, i was unpacking to the root folder, and then renaming the .scd files so supcom wouldnt find them. this data path stuff seemed like i cleaner way to do this, so i tried this:

unpacked lua.scd to root supcom folder. then:

Supreme Commander\bin\AlternateSupComDataPath.lua =
Code:
path = {
    '..',
    '../gamedata/*.scd',
}

which is just the original, swapped. then i pointed to it with /init in the shortcut.

it just breaks. my commander never shows up. any idea why?


Top
 Profile  
 PostPosted: 26 Feb, 2007 
 
User avatar

Joined: 15 Feb, 2007
Posts: 1439
Offline
Did you give init a fully qualified path? It needs it, it won't just look in bin.


Top
 Profile  
 PostPosted: 26 Feb, 2007 
 

Joined: 15 Feb, 2007
Posts: 392
Location: email III_Demon at yahoo
Offline
hm. ok.. i tried just giving it the file, i figured it would look in the same place as the default file. i tried
/Init C:\SupCom\Supreme Commander\bin\AlternateSupComDataPath.lua

and

/Init bin\AlternateSupComDataPath.lua

both of these get me this error:

Failed to setup initial search path.
Module : C:\SupCom\Supreme Commander\bin\SupremeCommander.exe

so i tried
/Init "C:\SupCom\Supreme Commander\bin\AlternateSupComDataPath.lua"

that breaks it too, just like /Init AlternateSupComDataPath.lua.
whats the syntax?


Top
 Profile  
 PostPosted: 27 Feb, 2007 
 
User avatar

Joined: 19 Feb, 2007
Posts: 84
Offline
My alternate path file:
Code:
path = {
    '../shadow',
    '../gamedata/*.scd',
    '..',
}


This way I can place files in shadow, without messing with the original dirs.


Top
 Profile  
 PostPosted: 27 Feb, 2007 
 

Joined: 22 Feb, 2007
Posts: 978
Location: Gas Powered Games Office, Redmond, WA
Offline
This is a good interim solution until we get shadowing fixed.


Top
 Profile  
 PostPosted: 27 Feb, 2007 
 

Joined: 15 Feb, 2007
Posts: 392
Location: email III_Demon at yahoo
Offline
yeah, i had tried that too, and that works nicely. i just wanted to figure out why the other way wasnt working, because it seemed like it should, and i like to try to understand things sometimes. =]

guess i'll go with the extra shadow folder then.


Top
 Profile  
 PostPosted: 27 Feb, 2007 
 
User avatar

Joined: 18 Feb, 2007
Posts: 55
Offline
stanhebben wrote:
My alternate path file:
Code:
path = {
    '../shadow',
    '../gamedata/*.scd',
    '..',
}


This way I can place files in shadow, without messing with the original dirs.
Funnily enough this is exactly how I have my local stuff set up. :)


Top
 Profile  
 PostPosted: 17 Sep, 2007 
 

Joined: 17 Sep, 2007
Posts: 2
Offline
i see nobody has posted in this thread since february, so maybe its just me having trouble now.
Im just starting up modding and have looked at various tutorials on how to set up the datapath.
if i use the /data c:/mymod;../gamedata/*.scd;.. method (adding the info to the target in a shortcut to SupremeCommander.exe) it just runs as normal (ie dosnt pick up modded files)
and if i try use /init C:/mymod/DataPath.lua i get an error saying:

Unhandled exception:

attempt to index a string value

my DataPath file is the same as described here
Code:
path = {

    "C:/mymod",
    "../gamedata.*.scd",
    "..",
}


so i really dont know whats going on.
probably something simple, but i am quite new to this so any help is appreciated.

cheers

_________________
peas


Top
 Profile  
 PostPosted: 18 Sep, 2007 
 
User avatar

Joined: 15 Feb, 2007
Posts: 1439
Offline
The format of SupComDataPath.lua has changed substantially. Search paths are no longer used, instead, directories are mounted. Take a look at the new one in your install directory to see what it should look like.

_________________
==}O->

"Primary function completed."


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic



Quick Tools

Search for:
Jump to:  

© 2002-2010 Gas Powered Games Corp. All Rights Reserved. Gas Powered Games is the exclusive trademark of Gas Powered Games Corp.
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
 
Home| Games | Company | News & Press | Support
  Terms of Use   |    Copyright Information   |    Privacy Policy