General SOC Information
From SRB2 Wiki
| | To Do |
| | This article is badly written and in dire need of a rewrite. You can help SRB2 Wiki by fixing this article to meet with the standards described by the Manual of Style. |
This is where just about everything in SOC is covered. SOC stands for Sonic Object Configuration. It is a basic "language" for addons and such to SRB2 that allow the modder to change many things from objects, to behaviors, to visuals and such like that. A large modification is incomplete without one normally.
Contents |
.soc Files
One common method to load SOCs is to use the commands ADDFILE or RUNSOC in the console once SRB2 has been started. Another method is to add the SOC using the SRB2 Launcher. Since SOCs are just text files, they may be created by simply loading Notepad or a similar text editor, and saving the file with the extension .soc.
MAINCFG & OBJCTCFG
- Main article: MAINCFG
MAINCFG and OBJCTCFG are WAD file lumps that can both contain SOCs, including map headers.. These are put into WAD files and once those wads are loaded, the SOC inside these lumps are automatically run.
The difference between MAINCFG and OBJCTCFG is that the former takes effect across the entire game, while the latter applies only to character WADs, and it further affects only the individual character WAD that it's located in.
You can import a SOC file using a lump editor like XWE. Once you import the SOC, you would rename the imported lump into MAINCFG. If the lump doesn't look right, you can rename the MAINCFG SOC to MAINCFG.TXT.
MAINCFG CATEGORY
- Main article: MAINCFG > MAINCFG CATEGORY
While MAINCFG can contain any and all SOCs, it also has certain parameters under the MAINCFG CATEGORY that are exclusive to the MAINCFG. These parameters include SpStage_Start, IntroToPlay, and InvulnTics, which all modify major game settings, and as a result, don't fit under any other SOC type.
Emblems
A game mod can contain special Emblems for the player to collect. These work much like the 20 emblems found in SRB2.
Individual emblems can apply to specific players. Sonic is 0; Tails is 1; Knuckles is 2; and "all players" is 255. Also, their coordinates (map editor coordinates, not game coordinates) must also be defined, such as "X = ####", "Y = ####", and "Z = ####". These tell the game where the emblems are positioned.
NumEmblems
Number of emblems in the mod.
Emblem #
Sets the emblem's number.
MapNum
Sets the map the emblem appears on.
PlayerNum
Sets what player(s) can obtain the emblem.
Things
- Main article: Thing (SOC)
Things, or more accurately Objects, are SOC modifications that change in-game Things. Each object has its own set of properties, states, sounds, and in some cases, hard coded properties (such as being a hazard object.)
States
States control the activity of an object through a set of parameters in each state. The parameters include sprites, frames, Duration, Action to call, Variables 1 and 2, and nextstate. Note that more than one object can use the same states.
Sprites
This determines the set of sprites used.
Frames
Out of the selected sprite set, this chooses which sprite to use. Also contains the information for transparency.
Duration
Sets how long the frame lasts. Set 0 for instant, and -1 for infinite. Note that if you set the duration to 0 on the spawn state of an object, the object will not spawn.
Actions
- Main article: Actions (SOC)
Actions determine what an object does during the given state. Each state can have one action, but through use of either A_DualAction or duration 0, you can perform multiple actions instantly. Objects will not perform actions on spawn unless 2147483648 is added to the flags value of said object.
Var1 and Var2
Variables for use with the Actions. The function for these changes with each Action, and is usually documented in the SOC Editor.
Upper and Lower Bits
In order to allow for more flexible control, for certain actions SRB2 makes use of the upper and lower bits of the vars. This allows for four parameters, as opposed to two. To determine what number to put into the var box, multiply the desired upper byte value by 65536, then add the desired lower byte.
Next State
Sets which state to go to after the current state is finished.
Sounds
Priority
This just lets you decide what sounds will play over what sounds. For example, if the enemy pop sound was played at the same time as the water ambiance sound, it would be more noticeable because it has a higher priority. This value can range from 0 to 127.
Lights
"Lights" are special graphical light effects in OpenGL. There are two kinds. A Corona is a "ball" of light that glows around an object. A Dynamic Light is a light's reflection on a wall or floor. A way of editing these is actually not found in the SOC editor. You must manually do this. A tutorial can be found here.

