Welcome, Guest. Please login or register. Did you miss your activation email?

* TUTORIAL SECTION RULES

This section is for SMOD TUTORIALS & GUIDES ONLY.
You may create a new topic in the appropriate area to share your tutorial. If you post anything off-topic here you will be temp-banned. This is so we don't hassle the moderators too much, they are volunteers.

If you need help with a tutorial, post a reply in its thread . Do not start a new topic for help here!

Author Topic: [ANY] Addcontents.txt Tutorial  (Read 6573 times)

0 Members and 1 Guest are viewing this topic.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
[ANY] Addcontents.txt Tutorial
« on: October 12, 2009, 05:31:19 AM »
The SMOD author included a very nifty system where-in you can load other source games on-top of SMOD and enjoy their maps/materials/sounds/etc. However it seems that people always have problems with the script. So here is a quick rundown of how it works.

2020 UPDATE: This no longer works if you are using SMOD Standalone.

Mounting Source Games into SMOD (addcontents.txt)



I. THE SCRIPT



Alright so here is the basic SMOD addcontents script. As it is shown above this would also load the contents of the following games into SMOD: Half-Life 2 Deathmatch, Half-Life: Source, Counter-Strike: Source, Day of Defeat: Source, and Half Life 2: Lost Coast.

An important thing to know is that you need to own all these games for this to work. You also need to have each game fully installed and up-to-date, as well as having ran each game once (to allow resource caches to be built). If you try to load the contents of a game that you do not own or have installed SMOD will crash on start-up.



II. ENTRIES & VALUES

A quick overview of what each entry in this script does.


OPENING TAGS

These two tags go begin the addcontents script they must always be present and must have an opening and closing brace.

"Additional contents list" - This opens the file. I'm sure it tells SMOD what this script does. Everything in this script goes between the opening and closing braces of this entry. NEVER COMMENT THIS OUT!

"Contents" - Place all games between the opening and closing braces of this entry. NEVER COMMENT THIS OUT!


GAME TAGS
Game tags go between the opening and closing braces of the "Contents" tag. They have a few values themselves.



"path" - this is the name of the folder where the GameInfo.txt is located for your game. for example, CS:S should belocated at SteamApps\user_name\counter-strike source\cstrike
So we would put "cstrike".

"id" - This is the engine app id that the game uses. It can be found in the GameInfo.txt file.



III. BRACES, BRACES, BRACES

Before going any farther, I would recommend downloading a simple Notepad replacement called Notepad++ (http://notepad-plus.sourceforge.net/uk/site.htm). Among all the other nice little features of the program it tends to highlight brace in red when they are closed, like so:



Which is super helpful because this is the part that most tend to mess up.

With any of SMOD's scripts everytime you open a value with a brace you need to also close it. Remember one closing brace for every open one.



So now lets run through the SMOD addcontents script and number our braces:



Note that if you forget a brace, everything below that point in the script will pretty much cease to function and you may get errors or random crashes. So pay attention to your braces, they are important.



IV. COMMENTS

Ok, so the last thing to touch on is commenting. A comment consits of two forward slashes ( // ) right next to each other. The way commenting works is that once the engine gets to the two forward slashes it will disregard any text that comes after them for that line. for example:



So why do we need to comment? Well lets say that you don't own Day of Defeat: Source, and you don't want SMOD to load it into the game and crash. Well we can just simply comment it out so that the engine will skip its entry. Like so:



Just remember to make sure you don't comment out one of the wrong braces! Use Notepad++ to help you decide which braces belong to which entry.

One final example, lets say that you only want SMOD to load Counter-Strike: Source. Simply comment out all of the other game entries. Just be sure not to comment out any of the closing braces for "Contents" etc...

« Last Edit: July 20, 2020, 04:11:43 AM by BIZ »

Offline Onemanshow

  • *
  • *
  • +67% chance to make useful post
  • Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!
Re: Addcontents.txt Tutorial
« Reply #1 on: December 23, 2009, 05:13:13 PM »
One thing many don't know about the Addcontents.txt file is that you can also specify folders and directories to load as well. Not just GCFs. For example, if you want to load a HL2 mod's folder, just put a line like this in:
Code: [Select]
"DayHard" { "path" "c:\program files\steam\SteamApps\SourceMods\DayHard" }

Of course you will have to change it depending on where you have it installed, but it works and is very useful to load other mods/map packs without manually needing to add them.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: Addcontents.txt Tutorial
« Reply #2 on: December 24, 2009, 10:01:53 PM »
thanks for lending your knowledge, that is very useful indeed!

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal