Skip to content

Creating addon track categories

Deyan Dobromirov edited this page Feb 5, 2019 · 5 revisions

How can I use track piece categories when I add my stuff externally?

You can do that by creating personal DSV categories linked to a given external database identifier. More information about this you can find in creating an external database via DSV section paragraph (5).

Could you make the tool so there will be categories for my addon?

Well, yeah, technically I can map any path given. However, these with properly ordered folders are easier to handle. Here are some good and bad practices for folder alignment. Legend of the path elements used in a model:

/            --> Slash represents directory divider ( Like in D:/Steam/common/Garry's mod )
#            --> Any kind of delimiter valid for a file name( Like dashes, underscores etc.)
%addonname%  --> Name of your addon (For example: SPros)
%category%   --> Category, which you want your pieces to be divided by ( Like straight, curves, ramps, bridges etc.)
%piecename%  --> The file name of the piece created in the addon ( Ending with *.mdl of course)

The good practices ( The category should be bordered by delimiters ):

   models/%addonname%/tracks/%category%/%piecename%.mdl
   models/%addonname%/%category%/%piecename%.mdl
   models/%addonname%/%category%#%piecename%.mdl

Examples: (#="_", %addonname%="ron/2ft", %category%="tram", %piecename%="%category%_32_grass.mdl")

   models/ron/2ft/tram/tram_32_grass.mdl ( The "tram" is taken right after "models/ron/2ft/" )

The the bad practices ( The category is missing or not strongly defined. There is not enough information given):

   models/%addonname%/tracks/%piecename%.mdl
   models/%addonname%/%piecename%#255#down.mdl
   models/%addonname%/03#1#asd#%piecename%#90.mdl

Examples: (#="_", %addonname%="props_phx", %piecename%="track_128.mdl")

   models/props_phx/trains/track_128.mdl ( Here, the category "straight" is not present at all )