| | 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. |
A SOC, or Sonic Object Configuration, is a basic "language" for addons and such to SRB2 that allows the modder to change many things from objects, to behaviors, to visuals and such. A large modification is incomplete without one normally. SOC files can be created with the SRB2 SOC Editor.
Contents |
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 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.
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.
A game mod can contain special Emblems for the player to collect. These work much like the 40 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 be defined, such as "X = ####", "Y = ####", and "Z = ####". These tell the game where the emblems are positioned.
Number of emblems in the mod.
Sets the emblem's number.
Sets the map the emblem appears on.
Sets what player(s) can obtain the emblem.
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 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.
This determines the set of sprites used.
Out of the selected sprite set, this chooses which sprite to use. Also contains the information for transparency.
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 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.
Variables for use with the Actions. The function for these changes with each Action, and is usually documented in the SOC Editor.
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.
Sets which state to go to after the current state is finished.
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.