-
-
Notifications
You must be signed in to change notification settings - Fork 33
groups
Caution
Deprecated: this feature is obsolete and may no longer work in newer versions of the engine. You are advised not to use this feature.
Groups are sets of objects, bricks, and items which can be placed all together with one click by a level designer. They are used to simplify level design and to allow modular placement of certain structures such as loops.
The legacy template level of Open Surge used groups. Let's see a small piece of it:
group
{
brick 49 16 16
brick 50 0 16
brick 0 0 0
brick 50 32 16
brick 49 48 16
brick 0 32 0
brick 50 64 16
brick 49 80 16
brick 0 64 0
brick 50 96 16
brick 49 112 16
brick 0 96 0
brick 50 128 16
brick 49 144 16
brick 0 128 0
}
//In this case, the objects are all bricks and therefore their names are all numbers.
In the above code, the syntax is as follows:
group //This must be present
{
...
brick/item/object name id xpos ypos [layer]
...
}
Where layer
is an optional parameter which accepts green and yellow.
You must add the grouptheme
command to the .lev file in order to make the groups appear in the level editor. Example:
// header
name "Legacy Template"
author "OS Team"
version "1.0"
requires 0.2.0
act 1
theme "themes/template.brk"
bgtheme "themes/template.bg"
spawn_point 56 6424
music "musics/template.ogg"
grouptheme "themes/template.grp" // <--- .grp file
startup ".default_startup"
players "Surge" "Neon" "Charge"
See also: Level specification - grouptheme.
Tip
.grp files can be incredibly difficult to write if you attempt to write them by hand. The level editor offers a way to create them quite easily though. Simply create an empty level which you will place the selected objects into, save it, and then grab the coding out of the .lev file and format it to the above syntax. You must then repeat this for each group you wish to create.