Take On Mars

Take On Mars

View Stats:
INFIDEL Jan 6, 2017 @ 8:40am
Addons for Beginners [Needing Help Getting Started]
I can't seem to figure out Addons once their data is extracted. My limited understanding of Mods is that you are building out the folder structure to replicate that of the game itself. Then in the target folder you are either putting your file in this location or putting your file and all of the files from the Extrated game data mirrored folder (I'm not sure which is the case).

With Addons, I'm trying to compare two .cfg files one extracted from a workshop addon and one from the extracted game data.

More precisely:
-Game Data-
    scripts\entities\configs\vehicles\supplymodule\skeletons\supplymodule_1.cfg
-Vehicle Resource Storage Tanks - W.I.P.-
    data\configs\vehicles\supplymodule\skeletons\res_supplymodule_full.cfg

First question, why are the "scripts\entities" folders omitted in the path to "res_supplymodule_full.cfg". There is a scripts folder with an entities folder within it in this Addon. Is this simply a short cut that the engine is able to read? Or is this a critical pathing?

Second, when comparing the two .cfg's in a text editor the first instance of a difference between the files I found was not intuitive (to my little brain):
-Game Data-

// Scripts
SCRIPT Path "scripts/Entities/Controllers/TakeMeToMars/SupplyModule/Script_SupplyModule.h"

-Vehicle Resource Storage Tanks - W.I.P.-

// Scripts
//SCRIPT Path
"data/scripts/Entities/SupplyModule/script_supplymodule_res.h"
SCRIPT Path
"scripts/Entities/Controllers/TakeMeToMars/SupplyModule/Script_SupplyModule.h"
SCRIPT Path
"data/scripts/entities/controllers/takemetomars/resources/vehicle_restank_handler.h"

I noticed that the first path has a // before SCRIPT Path, which makes me think it has something to do with the fact that there are two controller paths following (just a guess).

Where I am really confused is that I cannot find any instance of "script_supplymodule_res.h" anywhere within the extracted addon data.

The second script path appears to be located only in the extracted game data; I assume this is normal (addon using the vanilla controller for whatever function it performs)

Finally the third script paths to a location to the extracted Addon data; it's located there... so no real confusion there either.

You might ask what my aim is with all of this.... I'd like to build a quad stack supply drop Addon using the single resource supply drop from Enigma's Addon "Vehicle Resource Storage Tanks - W.I.P." as my starting point.

Any help is truely appreciated!
Last edited by INFIDEL; Jan 6, 2017 @ 11:41am
< >
Showing 1-3 of 3 comments
dariusz1983 Jan 6, 2017 @ 10:32am 
Hey there. I hope I can answer all of your questions.

You are right, a mod mirrors the game's data structure to make it possible to mod existing files. An addon doesn't, to actually prevent you from changing vanilla files. But to your actual questions:

1.)
The paths aren't equal or rather some parts are omitted because it doesn't matter where you place your vehicle's config files in your addon. You could invent a folder: "crappydoodle/mystuff/somefunkyvehicle.cfg" and it would still work...given one thing:
The game needs to know where that config file is, you tell the game by creating a special configlist. Those lists are being read by the scenario editor, so the vehicle shows up for you to place in the scene. Look at the addons configlist folder. You'll find a config list for this addon. Inside are entries containing of two parts:
NAME PATH

The NAME is the name you wish to appear in the scenario editor, the PATH is the path (in your addon) pointing towards the config file of that vehicle. So the engine doesn't have any magic path powers so to speak, it simply reads what's in this config list. Having said that, the configlist file isn't at a random location. That is actually "fixed" and you have to obide by it.

The same thing IN the vehicle's config file. There can be several other files in there as a path reference. One or more controller scripts, models for the parts etc. All those things can be at random locations, as long as they are there and are correctly referenced in the config file. The engine doesn't care. Of course there's some sort of understanding and to make it easier for others to "read" your addon, we all should try to maintain a certain standard, otherwise there would be chaos.

2.)
The "// SCRIPT path ......" is a line the author "commented out" meaning, it's just a comment. A comment is initiated by writing "//" and the entire line will be ignored by the parser. It's a single line comment. He might as well have deleted the line, same effect.
A multi line comment starts like this:
/*
you can write anything in between, your name, email address...
and to end your comment your write:
*/

That's probably the reason you can't find the file. It doesn't exist. And it's not referenced in any way (it's commented out).

Hope that helps.
INFIDEL Jan 6, 2017 @ 11:56am 
Thanks for the detailed reply... the configlists were definitely the piece I was missing to have any chance of understanding the pathing.

Also appreciate the explanation of commenting... this really helps understand what is being read by the parser.
dariusz1983 Jan 6, 2017 @ 1:57pm 
Sure thing. Glas to help. If you open/edit those config files with gvim it will display the comments in a different color.
< >
Showing 1-3 of 3 comments
Per page: 1530 50