JTE
Member
For SRB2 2.1, the unlockables and emblems system has been totally revamped. Your mod wad can now specify exactly how, when, and what, gets unlocked. It's a little complex, so bare with me here as I go over the details of how to implement this useful new feature for you.
The first thing you have to do, of course, is set your gamedata file in the maincfg section. Unlockables can not be modified unless the gamedata is separate from vanilla SRB2.
Now that that's out of the way, our wad is officially its own mod, complete with a time attack folder and unique savegames and such. Congratulations, we're ready to make some fun secrets and unlockables!
First things first, though: You might want to remove every trace of SRB2's own Unlockables, Emblems, Level Headers, etc. This can easily be done by inserting "CLEAR" commands after the MainCFG category (not inside it!), like so:
Additionally, the current Emblem structure is the same as it was in 2.0.6; however, this is subject to change in the near future. Expect to see an addendum to this message later on if that is the case.
Extra Emblems
Now, the easiest thing to add is extra emblems, which are unlocked instead of found. Extra emblem sections looks like this:
The objective is written on the statistics page as a description of how to unlock it, and the name is used when the emblem is awarded, on a CECHO which reads something like GOT "ULTIMATIM" EMBLEM!
The condition set refers to another section of the SOC which determines how the emblem is achieved, and is the most complex new area of sOC editing, so I'll get to that last.
Unlockables
The next thing you'll want to write up is an unlockable, a reward that actually does something. Unlockable sections can look like this:
The order in which you define unlockables determines their location in the Secrets Checklist, and their position on the menu is defined by the "Height" attribute. As with old unlockables, you may define a custom warp and a custom level select that can be selected in this menu. However, in 2.1, you may also define a custom sound test entry that will show up on this menu, if you so desire. Additionally, the "Var" attribute is now used for the Level Select entries -- It determines which maps to show on the list. If you use "Var = 2" on a level select unlockable, it will look for all maps that have "LevelSelect = 2" in their map headers. You can define multiple unlockable level selects in this manner.
Notice Unlockable 10 -- doesn't it look a little empty? An unlockable without a type is treated as a "Header" type; this allows you to place a bit of text on the menu before a set of menu options -- for example, "Bonus Levels".
Also notice Unlockable 20. In addition to the previous types, there are a few other additional types that enable hardcoded menu options, such as Pandora's Box, NiGHTS Mode, and Record Attack. These display in the Secrets Checklist (unless you disable that by using NoChecklist), but never in the Secrets menu itself. Additionally, note that it uses a Condition Set value of -1; this means that it is automatically unlocked from the start, without the player needing to do anything.
Condition Sets
Finally, now that we have things which need unlocking, we make a condition set to specify exactly how to unlock them. Examples of condition sets:
Condition sets define exactly what you need to do to earn your unlockables and extra emblems. You can specify up to 128 of them if you wish, but you should never need that many.
Each condition set can have as many conditions as you desire, defined by the "Condition# = " sections. The # indicated the ID of the condition -- this is used to group specific conditions together to create a more complex one. Basically, two conditions with different IDs are treated as "Either one of these can be done for this to be true" (See ConditionSet 20); while two conditions with the same ID are treated as "Both of these must be done for this to be true" (See ConditionSet 21). There's no real limit to the complexity of the condition sets you define -- use as many different conditions with different or identical IDs to get the effect that you desire.
Below is a list of all the conditions, their syntax, and what they mean. [Brackets] designate a required parameter, and <angled brackets> designate an optional parameter.
Review
A complete secrets and unlockables SOC includes the following:
A complete (although simple) example follows:
We hope you will use this to create entertaining and long-lasting adventures in your future projects.
The first thing you have to do, of course, is set your gamedata file in the maincfg section. Unlockables can not be modified unless the gamedata is separate from vanilla SRB2.
Code:
MainCFG Category
GameData = supergame.dat
Now that that's out of the way, our wad is officially its own mod, complete with a time attack folder and unique savegames and such. Congratulations, we're ready to make some fun secrets and unlockables!
First things first, though: You might want to remove every trace of SRB2's own Unlockables, Emblems, Level Headers, etc. This can easily be done by inserting "CLEAR" commands after the MainCFG category (not inside it!), like so:
Code:
CLEAR Levels
CLEAR Unlockables
CLEAR Emblems
CLEAR ExtraEmblems
CLEAR ConditionSets
#This does all of the previous actions
CLEAR ALL
Additionally, the current Emblem structure is the same as it was in 2.0.6; however, this is subject to change in the near future. Expect to see an addendum to this message later on if that is the case.
Extra Emblems
Now, the easiest thing to add is extra emblems, which are unlocked instead of found. Extra emblem sections looks like this:
Code:
ExtraEmblem 1
Name = Perfect
Objective = Perfect Test Map A
ConditionSet = 11
ExtraEmblem 2
Name = Ultimatim
Objective = Beat Test Map A on Ultimate
ConditionSet = 12
[...]
The objective is written on the statistics page as a description of how to unlock it, and the name is used when the emblem is awarded, on a CECHO which reads something like GOT "ULTIMATIM" EMBLEM!
The condition set refers to another section of the SOC which determines how the emblem is achieved, and is the most complex new area of sOC editing, so I'll get to that last.
Unlockables
The next thing you'll want to write up is an unlockable, a reward that actually does something. Unlockable sections can look like this:
Code:
Unlockable 1
Name = Custom Sound Test
Objective = Beat Test Map A with All Emeralds
Type = SoundTest
Height = 20
ConditionSet = 1
Unlockable 2
Name = Custom Warp 1
Objective = Earn an Emblem
Type = Warp
Var = 2
Height = 110
ConditionSet = 2
[...]
Unlockable 10
Name = Custom Header
Height = 100
[...]
Unlockable 20
Type = RecordAttack
NoCecho = true
NoChecklist = true
ConditionSet = -1
The order in which you define unlockables determines their location in the Secrets Checklist, and their position on the menu is defined by the "Height" attribute. As with old unlockables, you may define a custom warp and a custom level select that can be selected in this menu. However, in 2.1, you may also define a custom sound test entry that will show up on this menu, if you so desire. Additionally, the "Var" attribute is now used for the Level Select entries -- It determines which maps to show on the list. If you use "Var = 2" on a level select unlockable, it will look for all maps that have "LevelSelect = 2" in their map headers. You can define multiple unlockable level selects in this manner.
Notice Unlockable 10 -- doesn't it look a little empty? An unlockable without a type is treated as a "Header" type; this allows you to place a bit of text on the menu before a set of menu options -- for example, "Bonus Levels".
Also notice Unlockable 20. In addition to the previous types, there are a few other additional types that enable hardcoded menu options, such as Pandora's Box, NiGHTS Mode, and Record Attack. These display in the Secrets Checklist (unless you disable that by using NoChecklist), but never in the Secrets menu itself. Additionally, note that it uses a Condition Set value of -1; this means that it is automatically unlocked from the start, without the player needing to do anything.
Condition Sets
Finally, now that we have things which need unlocking, we make a condition set to specify exactly how to unlock them. Examples of condition sets:
Code:
ConditionSet 1
Condition1 = MapAllEmeralds 1
ConditionSet 2
Condition1 = TotalEmblems 1
[...]
ConditionSet 11
Condition1 = MapPerfect 1
ConditionSet 12
Condition1 = MapUltimate 1
[...]
ConditionSet 20
Condition1 = GameClear
Condition2 = PlayTime 126000
ConditionSet 21
Condition1 = ConditionSet 1
Condition1 = ConditionSet 2
Condition sets define exactly what you need to do to earn your unlockables and extra emblems. You can specify up to 128 of them if you wish, but you should never need that many.
Each condition set can have as many conditions as you desire, defined by the "Condition# = " sections. The # indicated the ID of the condition -- this is used to group specific conditions together to create a more complex one. Basically, two conditions with different IDs are treated as "Either one of these can be done for this to be true" (See ConditionSet 20); while two conditions with the same ID are treated as "Both of these must be done for this to be true" (See ConditionSet 21). There's no real limit to the complexity of the condition sets you define -- use as many different conditions with different or identical IDs to get the effect that you desire.
Below is a list of all the conditions, their syntax, and what they mean. [Brackets] designate a required parameter, and <angled brackets> designate an optional parameter.
- PLAYTIME [tics]
Requires the player to accumulate a set amount of play time to unlock.
- - GAMECLEAR <x times>
Requires the player to clear the game a set number of times. Defaults to 1 if the parameter is omitted.
- - ALLEMERALDS <x times>
Requires the player to clear the game with all emeralds a set number of times. Defaults to 1 if the parameter is omitted.
- - ULTIMATECLEAR <x times>
Requires the player to clear the game on Ultimate skill a set number of times. Defaults to 1 if the parameter is omitted. This is a really good way to drive people insane; it's included just in case any modders wish to hide things behind Ultimate mode.
- - OVERALLSCORE [score to beat]
Requires the player's total score in all Record Attack maps to be above a target score.
- - OVERALLTIME [time to beat, tics]
Requires the player's total time in all Record Attack maps to be below a target time.
- - OVERALLRINGS [rings to beat]
Requires the player's total rings in all Record Attack maps to be above a target amount.
- - MAPVISITED [map number]
Requires the player to visit the defined map. Does not require them to complete the map, however.
- - MAPBEATEN [map number]
Requires the player to complete the defined map.
- - MAPALLEMERALDS [map number]
Requires the player to complete the defined map with all emeralds.
- - MAPULTIMATE [map number]
Requires the player to complete the defined map on Ultimate skill. Again, included just in case any modders wish to hide things behind Ultimate mode.
- - MAPPERFECT [map number]
Requires the player to complete the defined map with a Perfect Bonus.
- - MAPSCORE [map number] [score to beat]
Requires a target score on a defined map to be beaten. This must be done in Record Attack.
- - MAPTIME [map number] [time to beat, tics]
Requires a target time on a defined map to be beaten. This must be done in Record Attack.
- - MAPRINGS [map number] [rings to beat]
Requires a target ring count on a defined map to be beaten. This must be done in Record Attack.
- - NIGHTSSCORE [map number] [mare, 0 for overall] [score to beat]
Requires a set score on a specific mare (or, if mare is 0, overall score) of a NiGHTS course to be beaten. This does not need to be achieved in NiGHTS mode, and can in fact be achieved when playing the game normally.
- - NIGHTSTIME [map number] [mare, 0 for overall] [time to beat, tics]
Requires a set time on a specific mare (or, if mare is 0, overall score) of a NiGHTS course to be beaten. This does not need to be achieved in NiGHTS mode, and can in fact be achieved when playing the game normally. Note that in NiGHTS mode, the tracked time is the time that it takes you to break the capsule, not the time that it took you to return to the drone.
- - NIGHTSGRADE [map number] [mare, 0 for overall] [grade]
Requires a set grade on a specific mare (or, if mare is 0, overall score) of a NiGHTS course to be gotten. This does not need to be achieved in NiGHTS mode, and can in fact be achieved when playing the game normally. 0 is F, 1 is E, 2 is D, 3 is C, 4 is B, and 5 is A.
- - TRIGGER [trigger number]
This one is a little unique -- This requires a special Linedef Executor with type 441 set to the desired trigger number. When this Linedef Executor is activated, the trigger flag will be set (and unlockable status will be checked immediately). These triggers carry over from map to map, and a Trigger Linedef Executor with type 317 or 318 can check for them as well. This could potentially allow you to trigger unlockables by jumping on a certain person's house three times, if you wish to run an already dead joke into the ground even further. Note that this does not work in netgames, or if gamedata is no longer being saved (due to the use of GOD, NOCLIP, NOTARGET, etc.).
- - TOTALEMBLEMS [number of emblems]
Requires a set number of emblems collected. This counts both regular emblems and extra emblems.
- - EMBLEM [emblem number]
Requires a specific emblem to be collected.
- - EXTRAEMBLEM [extra emblem number]
Requires a specific extra emblem to be earned.
- - CONDITIONSET [condition set number]
Requires a previous condition set to already be achieved.
Review
A complete secrets and unlockables SOC includes the following:
- A maincfg category which sets a gamedata file
- Clear commands which remove the vanilla game's secrets and headers (and any other mod's, as well)
- Emblems and extra emblems sections marking "achievement" style collectables
- Unlockable sections which define the secrets menu options
- ConditionSet sections which define the rules for which extra emblems become collected and unlockables become unlocked
A complete (although simple) example follows:
Code:
MainCFG Category
GameData = smallgame.dat
Clear Unlockables
Clear Emblems
Clear ExtraEmblems
Clear ConditionSets
ExtraEmblem 1
Name = Double Complete
Objective = Complete the game twice
ConditionSet = 2
Unlockable 1
Name = Sound Test
Objective = Complete the game
Type = SoundTest
Height = 20
ConditionSet = 1
ConditionSet 1
Condition1 = GameClear
ConditionSet 2
Condition1 = GameClear 2
We hope you will use this to create entertaining and long-lasting adventures in your future projects.
Last edited by a moderator: