Jump to content
MarkShot

The Plugins Directory - How are files loaded?

6 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

I understand that the last to load in general overrides prior items of the same content.  So, leading 'a____' on something to load early and leading 'z______' on something the load later or last.

But how are files in a directory level processed.  I am assuming as said in computer science, depth first ... this means that everything in the root is processed,  then the lowest sorting directory is found and everything is process by ascending sort, then if there are further subdirectories the lowest sorting one is processed sooner.  This approach continues in a recursive fashion.

Thus, there are two ways to control processing.  The naming (sort order) of files in a single directory as they are read before any deeper subfiles.  The naming (sort order) of directories as all files contained within are first processed.

Correct?

This is why some mods say they must appear in the root of plug ins, as they are trying to guarantee an early load.  I assume some of the things they do, cannot be undone by something which appears later.

Correct?

I am not too sure how plugins work exactly.  All I have read so far says 'install in plug ins directory' and otherwise people suggest grouping the plug ins directory by function, or content type, or by author.  Confused.

Thanks.

  • Like 1

SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

SC4Ckpt: Backup Checkpoint Tool

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Hello, personally as I don't have too much memory, and a bit tired sometimes, to understand the loading order of the files, I check with sc4datanode from Rivit, whose first point: "1. Audit/examine the loading sequence" (there are of course all the other functions of this very useful prog!) effectively ... the last declarative of a same ID takes the hand on the execution of the contained data ... for the subtleties of loading on SC4D: SC4 Folder and File Loading Order

For the organization, each player of SC4 must have his own ;-) and each one will defend his best solution ! I chose to play with a lot of plugins and their dependencies (not even afraid !), so to make it simple (+-) I created repert' : a[a|b|c..]__xxx\ for CAM, Maxis bug fixes, maxis addons, ... then directories by name of authors/teams: big volume of plugins from them (e.g. : SM2, Mattb, PEG, BSC, NAM ...) or simply to ease reading/searching when I consider a Relot/Redo. Then for everything else in functional repert' : y_utilities\, y_RCI\, y_automata\ and a y_ressources\ which contains a lot of small Mods (sub-repert by author) that don't need to be in the "z__" . Then come the famous z__xxx\ : all those plugins/surcharges that must imperatively go last : NAM re-skin street, terrain and lights Mods ..., interface re-skin and other "Controlers, Tuning..." examplars. For the great majority I keep the dir-names as indicate by authors of these. I organize myself taking into account that I datpack my Plugins\ and ... that I noted everything in bloc-note (OneNote for me): type/objective of plugin, name, URL, alteration made by me, relations/compatibility, lists of prop-pack and textures-pack and so on...

  • Like 3

What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

>> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

The most important thing is to be able to tell the difference between those mods that require special load order and those which do not, since the bulk of things you are likely to install fall into the later category and as such there is no right or wrong way to organise them. What matters more is that you understand the system used and that it enables you to find given items should you need to. As Hugues Aroux mentions, this can be quite personal in terms of what system works for you.

Load order gets quite complex (second link in above post), but most users don't need to know all the ins and outs. Generally speaking the Plugins folder inside the Install DIR loads after the game content, then the contents of the Plugins folder in the User DIR (Documents). DLL based mods should always be placed in the root Plugins folder of the Install DIR to ensure they load first, otherwise they may fail to load correctly/reliably. Many mods by default use folder combinations with z's and whatnot, but you'd be surprised how often this isn't necessary, it can easily confuse matters. For example CAM users a___CAM or something similar, but actually since it's only overriding the Maxis content, it makes no difference. Likewise Seaport/Airport controllers tend to default to z___XXX folders, when again this isn't strictly necessary. Some of this relates to a 'Load order arms race', where creators try to avoid support issues by ensuring their mod will load after everything else, just in case. But that actually comes with drawbacks, because let's face it if you did have two or more mods hanging around that essentially do the same thing, you should remove one rather than just shifting the load order. The only time this might be useful is if you wanted parts of both mods to work, but rarely is that as neat as simply loading them in a particular order. Integrating two such mods typically requires editing one or merging the two together somehow using modding tools in order that it actually works as intended.

A basic understanding of what a mod is changing can really help guide load order though, for example if installing a texture or T21 mod that affects NAM content, such a mod surely needs to load after the NAM or Network Addon Mod folder. A simple solution would be to just have one folder named z_Last, which if you don't use single-letter prefixes for other folders, will always be the last folder or content to load. Inside there you can use a system of folder names like 10 - Mod 120 - Mod 2 etc to load everything which changes other content you may have installed. The numbering determines the order to load for everything here, making it very easy to swap things around and add new items, hence I use increments of 10, so you have additional spaces to make use of in future. By simply renumbering the root folders, you can quickly and reliably switch load order too.

  • Like 4
  • Yes 1

Head over to my Lot and Mod Shack to keep abreast of my latest developments.

Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

p.s. - I'm MGB over on SC4D and a member of the NAM team.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
Currently: Viewing Forums Index
 

I confess to skim reading, but I believe one thing not yet mentioned is that a .dat file loads after .sc4lot and .sc4desc files.

Where this is so important to know is if you have, say, zThisHouse.sc4lot and ThisHouse.dat (even in the same folder) then logic says the z one would load last, but because of the .dat rule, that one would still load later and override.

  • Like 1
  • Yes 1

Chance favors the prepared mind. ― Louis Pasteur  
Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

Are you new here? Check out the Introduction and Guide to Simtropolis.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
1 hour ago, CorinaMarie said:

that a .dat file loads after .sc4lot and .sc4desc files

... everything is explained in the link on SC4D ... above !! and/or visible with sc4datanode *;)

  • Thanks 1

What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

>> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Thank you all. I learned quite a bit. 
     

    That whole a____cam thing was kind of confusing when I installed in 2017 as I did not see the point in load first. Although a bit archaic by today’s tools, certainly better than the early days of modding and altering vendor files in place. 

    • Like 2

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections