This is an idea I got from Spikerocks, who wrote about a sandbox gametype
Never played campaign, mostly cause I don't like not having everything at once. I played hours upon hours on the Colony missions thou. I wish I kept some of my old saves. Another fun map was the Tutorial levels, cause you can just mess around on it, and have no mission to worry about.
On that note, why haven't we made a colony mission with no goal? Maybe you can send waves in to attack you by typing something like "/attack medium" or something.
This is an early release, not even half of my minimum requirements are met and I didn't test all of it yet, but it already works.
Basically, you can issue an command via chat (in singleplayer there's no prefix required), along with a list of arguments.
Commands that are implemented as of now:
spwn|--
Description: Spawns one or multiple predefined spawn templates
|--
Format ::= "spwn" [ " " ( <groupnum>+ | "x" ) ]
<groupnum> ::= <opt-space> <digit>
<opt-space> ::= " " <opt-space> | ""
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|--
Example"spwn 6"
Effect: Spawns group 6
"spwn x"
Effect: Spawns groups 0 to 9
"spwn"
Effect: The very same as the last example
"spwn 735"
Effect: Spawns groups 7, 3 and 5
"spwn 7 3 5"
Effect: The very same as the last example
grp|--
Description: Adds up to 32 units to a predefined spawn template
Weapon:
Acid cloud = A
EMP = e
ESG = E
Laser = L
Microwave = M
Rail gun = R
RPG = r
Starflare = s
Sticky foam = S
Supernova = N
Thors Hammer = T
Energy Cannon(Scorpion) = C
Chassis:
Lynx = L
Panther = P
Tiger = T
Scorpion = C
|--
Format ::= "grp " <groupnum> <typeinfo>+
<opt-space> ::= " " <opt-space> | ""
<groupnum> ::= <digit>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<typeinfo> ::= <opt-space> <weapon> <chassis> <amount> | <opt-space> "CC" <amount>
<weapon> ::= A | e | E | L | M | R | r | s | S | N | T
<chassis> ::= L | P | T
<amount> ::= [ 0 | 1 | 2 ] <digit> | 3 ( 0 | 1 | 2 )
// <amount> specifies a range from 0 to 32
|--
Example"grp 0 TT2"
Effect: Adds 2 Thors Hammer Tigers to group 0
"grp 4rP4 LL5AL1 sT1"
"grp 4 LL2 MP5"
Effect: Adds 4 RPG Panthers, 7 Laser Lynx, 1 Acid Cloud Lynx, 1 Starflare Tiger and 5 Microwave Panthers to group 4
"grp 4TL2MT3NT10"
Effect: Adds 2 Thors Hammer Lynx, 3 Microwave Tigers and 10 Supernova Tigers to group 4
"grp 4 TL2 MT3 NT10"
Effect: The very same as the last example
loc|--
Description: Sets up a predefined spawn location
|--
Format ::= "loc " <spawnnum> " " <location> [" " <priority>]
<location> ::= <number> "," <number>
<spawnnum> ::= <digit>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<number> ::= <digit> <number> | <digit>
// <number> is not actually unlimited, but bound to int ranges.
<priority> ::= [[ 0 | 1 ] <digit>] <digit> | 2 ( 0 | 1 | 2 | 3 | 4 ) <digit> | "25" ( 0 | 1 | 2 | 3 | 4 | 5)
// <priority> specifies a range from 0 to 255
|--
Example"loc 9 145,155"
Effect: Sets spawn location 9 to x=145, y=155 priority=1
"loc 3 45,63 19"
Effect: Sets spawn location 9 to x=45, y=63 priority=19
"loc 1 100,100 10"
"loc 2 25,60 5"
Effect: Sets up two spawn locations. In 5 cases out of 15, a new group will spawn at location 2, in 10 cases out of 15, it spawns at location 1
"loc 8 2,1 4"
"loc 3 225,15"
"loc 6 24,10 2"
Effect: Sets up three spawn locations. In 4 cases out of 7, a new group will spawn at location 8, in 2 cases out of 7, it spawns at location 6, in one case out of 7, it spawns at location 3
reset|--
Description: Resets data set by other commands
|--
Format ::= "reset " <command> [" " <argnum>+]
<argnum> ::= <opt-space> <digit>
<opt-space> ::= " " <opt-space> | ""
<command> ::= "grp" | "loc" | "file"
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|--
Example"reset grp 5"
Effect: Removes all units from template group 5 (Does not affect units already on the field)
"reset loc 2"
Effect: Resets location 2
"reset grp"
Effect: Removes all units from all template groups
"reset loc"
Effect: Resets all locations
"reset file"
Effect: Clears the file name currently set as sink for save operations
"reset grp 30 6"
Effect: Removes all units from group 0, 3 and 6
load|--
Description: Loads commands from a file located in a folder called fl_file in the Outpost 2 directory, appending a ".txt" to the name supplied by the user.
Note: If the command was entered by a user, it is a primary call. If it is read from a file, it is a secondary call. If a secondary call tries to load a file that was already read but not fully executed during the processing of the same primary call, it fails.
Note: A primary load call displays special behaviour; The command is not stored in the internal "last command" buffer until it was fully executed. Additionally, at the beginning of the primary load call, the "last command" buffer is cleared.
|--
Format ::= "load " <filename>
// <filename> accepts any characters Windows would, except for full stops/periods
|--
Exampleloc 0 100,99 10
grp 0 MT10 ML1
grp 2 ML9
spwn x
"load Test"
Effect: Loads Test.txt, which in turn sets up spawn location 0 with x=100, y=90 and priority=10, spawn template 0 with 10 Microwave Tigers and 1 Microwave Lynx, spawn template 2 with 9 Microwave Lynx and finally, spawns all groups, thus spawning 20 vehicles total
loc 0 25,7
load Group
spwn 0 3 1
reset loc
reset grp
grp 1 rP32
"load MyCommands"
Effect: Loads MyCommands.txt, which in turn sets up a spawn location, loads Group.txt, which wipes all group infos and sets up group 1. Back in MyCommands, it spawns group 0, 1 and 3 and lastly, wipes all spawn location information.
file|--
Description: Sets a filename within fl_file as target of following save operations, appending a ".txt" to the name supplied by the user.
|--
Format ::= "file " <filename>
// <filename> accepts any characters Windows would, except for full stops/periods
|--
Example"file MyFile"
Effect: Any following save operations will append data to a file called MyFile.txt, which will be created if it doesn't exist.
save|--
Description: Saves a setting in an appropriate format so loading said file will correctly restore all data active at the time the save command was given.
Note: The downloadable package comes with a savescript.txt file, which will always save all saveable information in a file called savefile.txt, and a do_save.txt file, which does the same as savescript.txt, but does not set or reset any file name, requiring the user to supply one beforehand.
|--
Format ::= "save " <command> [" " <argnum>+]
<argnum> ::= <opt-space> <digit>
<opt-space> ::= " " <opt-space> | ""
<command> ::= "grp" | "loc" | "time"
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|--
Example"file Test"
"loc 1 140,210 10"
"loc 6 10,51 1"
"grp 2 rP10"
"save loc"
"save grp"
Effect: Saves "loc 1 140,210 10", "loc 6 10,51", "reset grp 2" and "grp 2 rP10" to Test.txt.
"loc 1 140,210 10"
"loc 6 10,51 1"
"grp 2 rP10"
"load savescript"
Effect: Nearly the same as the last example, except that all data will be saved to savefile.txt instead.
"loc 1 140,210 10"
"loc 6 10,51 1"
"grp 2 rP10"
"file Test2"
"load do_save"
Effect: Nearly the same as the last example, except that all data will be saved to Test2.txt instead.
"file Test3"
"loc 1 140,210 10"
"loc 2 35,16 4"
"loc 6 10,51 1"
"save loc 61"
Effect: Saves "loc 1 140,210 10" and "loc 6 10,51" to Test3.txt.
"file Test3"
"loc 1 140,210 10"
"loc 2 35,16 4"
"loc 6 10,51 1"
"save loc 6 1"
Effect: The same as the last example
time|--
Description: Sets up time triggers which spawn their associated template groups
Note: When using the "save" command, all triggers, enabled or not, are saved as disabled. If you want those saved triggers to be enabled upon loading them with the "load" command, you have to do so manually either with the "start" command or by editing the commands stored in the file.
Note: If a trigger is not set to repeat, it counts as disabled after it fired, it's not deleted and can still be saved via "save" as well as restarted via "start"
Note: The minimum value for time is set to 100 ticks (1 mark)
|--
Format ::= "time " <groupnum> " " <timesettings> " " <enabled> [ <repeat> ]
<groupnum> ::= <digit>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<timesettings> ::= <number> [ "," <number> ]
<number> ::= <digit> <number> | <digit>
// <number> is not actually unlimited, but bound to int ranges.
<enabled> ::= 0 | 1
<repeat> ::= " R"
|--
Example"loc 9 100,40"
"grp 4 CC3"
"grp 5 rP10"
"time 4 3000 1 R"
"time 5 6000,10000 1 R"
Effect: Sets up a location, two groups and two triggers. Trigger 4 is set to repeat and will fire exactly every 3000 ticks(30 marks)(relative time) and spawns group 4 (3 Scorpions). Trigger 5 is set to repeat and will fire at some point between 6000 and 10000 ticks (60 and 100 marks)(relative time) and spawns group 5 (10 RPG Panthers).
"loc 2 20,30"
"grp 7 AL8"
"time 7 1000 1"
Effect: Sets up a group, a location and a trigger which will spawn it's group after exactly 1000 ticks (10 marks) and switches to disabled afterwards.
"loc 2 20,30"
"grp 7 AL8"
"time 7 1000 0"
Effect: Sets up a group, a location and a disabled trigger, and nothing happens.
"grp 2 LL10"
"time 2 100 1 R"
Effect: Sets up a group and a trigger, which spams you with error messages every single time mark because you forgot to set up any location (true story).
"time 5 100,400 1 R"
"time 5 4000,10000 0"
Effect: Sets up trigger 5 and subsequently overrides it with a disabled trigger, so nothing happens.
"time 3 30000 1 R"
"file Game"
"save time 3"
Effect: Saves information for a disabled trigger "time 3 30000 0 R" to Game.txt
start|--
Description: Restarts a command aspect
|--
Format ::= "start " <command> [" " <argnum>+]
<argnum> ::= <opt-space> <digit>
<opt-space> ::= " " <opt-space> | ""
<command> ::= "time"
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|--
Example"time 6 100 0"
"start time 6"
Effect: Sets up a disabled trigger and enables it; As if "time 6 100 1"
"time 7 7500 0"
"time 2 6000 0 R"
"time 4 80000 0"
"start time"
Effect: Sets up 3 disabled triggers and restarts all of them.
"time 1 5000 0 R"
"time 2 9000 0"
"time 3 70000 0 R"
"start time 13"
Effect: Enables trigger 1 and 3, but not 2.
stop|--
Description: Stops a command aspect
Note: "stop" always stops a trigger, even if it will fire in a short while
|--
Format ::= "stop " <command> [" " <argnum>+]
<argnum> ::= <opt-space> <digit>
<opt-space> ::= " " <opt-space> | ""
<command> ::= "time"
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|--
Example"time 6 100 1"
"stop time 6"
Effect: Sets up an enabled trigger and disables it; As if "time 6 100 0"
"time 7 7500 1"
"time 2 6000 1 R"
"time 4 80000 1"
"stop time"
Effect: Sets up 3 enabled triggers and disables all of them.
"time 1 5000 1 R"
"time 2 9000 1"
"time 3 70000 1 R"
"stop time 13"
Effect: Disables trigger 1 and 3, but not 2.
storm|--
Description: Controls storms, natural aswell as player-spawned.
Note: Natural storms are activated by default.
|--
Format ::= "storm " <opt-space> <location> " " <opt-space> <location>
<location> ::= <number> "," <number>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<number> ::= <digit> <number> | <digit>
// <number> is not actually unlimited, but bound to int ranges.
<opt-space> ::= " " <opt-space> | ""
|--
Example"storm 16,209 30,229"
Effect: Initiates a storm that spawns after 10 marks and travels from 16,209 to 30,229
"stop storm"
Effect: Disables all natural storms that have not been initialized yet.
"start storm"
Effect: Enables all natural storms
"start storm"
"save storm"
Effect: saves "start storm" to the associated file
"stop storm"
"save storm"
Effect: saves "stop storm" to the associated file
meteor|--
Description: Controls meteors, natural aswell as player-spawned.
Note: Natural meteors are activated by default.
|--
Format ::= "meteor " <opt-space> <location>
<location> ::= <number> "," <number>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<number> ::= <digit> <number> | <digit>
// <number> is not actually unlimited, but bound to int ranges.
<opt-space> ::= " " <opt-space> | ""
|--
Example"meteor 16,209"
Effect: Initiates a meteor that spawns after 10 marks and hits 16,209
"stop meteor"
Effect: Disables all natural meteors that have not been initialized yet.
"start meteor"
Effect: Enables all natural meteors
"start meteor"
"save meteor"
Effect: saves "start meteor" to the associated file
"stop meteor"
"save meteor"
Effect: saves "stop meteor" to the associated file
vortex|--
Description: Controls vortices, natural aswell as player-spawned.
Note: Natural vortices are activated by default.
|--
Format ::= "vortex " <opt-space> <location> " " <opt-space> <location>
<location> ::= <number> "," <number>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<number> ::= <digit> <number> | <digit>
// <number> is not actually unlimited, but bound to int ranges.
<opt-space> ::= " " <opt-space> | ""
|--
Example"vortex 16,209 30,229"
Effect: Initiates a vortex that spawns after 10 marks and travels from 16,209 to 30,229
"stop vortex"
Effect: Disables all natural vortices that have not been initialized yet.
"start vortex"
Effect: Enables all natural vortices
"start vortex"
"save vortex"
Effect: saves "start vortex" to the associated file
"stop vortex"
"save vortex"
Effect: saves "stop vortex" to the associated file
quake|--
Description: Controls quakes, natural aswell as player-spawned.
Note: Natural quakes are activated by default.
|--
Format ::= "quake " <opt-space> <location> " " <opt-space> <location>
<location> ::= <number> "," <number>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<number> ::= <digit> <number> | <digit>
// <number> is not actually unlimited, but bound to int ranges.
<opt-space> ::= " " <opt-space> | ""
|--
Example"quake 16,209"
Effect: Initiates a quake that spawns after 10 marks and hits 16,209
"stop quake"
Effect: Disables all natural quakes that have not been initialized yet.
"start quake"
Effect: Enables all natural quake
"start quake"
"save quake"
Effect: saves "start quake" to the associated file
"stop quake"
"save quake"
Effect: saves "stop quake" to the associated file
version|--
Description: Manages version info. Meant to be used to distinguish old saves from new ones.
|--
Format ::= "version"
|--
Example"version"
Effect: Prints the current version as a message. In version 0.4.1-136, this is "v0.4.1-136"
"save version"
Effect: Saves the current version to the associated file. In version 0.4.1-136, this is "noop v0.4.1-136"
noop|--
Description: Does nothing. Meant to be used for comments in files.
|--
Format ::= "noop" [ " " <anything> ]
|--
Example"noop"
Effect: Does nothing
"noop example"
Effect: Does nothing
"noop v0.4.1-136"
Effect: Does nothing
"noop storms"
Effect: Does nothing
"noop file spwn loc grp"
Effect: Does nothing
"noop 235ngiwo4gJIIEI!"
Effect: Does nothing
evnt|--
Description: Manages random events, timed and instant.
|--
Format ::= "evnt" [ " " <opt-space> <timesettings>]
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<timesettings> ::= <number> [ "," <number> ]
<number> ::= <digit> <number> | <digit>
// <number> is not actually unlimited, but bound to int ranges.
<opt-space> ::= " " <opt-space> | ""
|--
Example"evnt"
Effect: Rolls a random event instantly
"evnt 200"
Effect: Rolls a random event every 200 ticks (2 marks)
"evnt 300,450"
Effect: Rolls a random event every 300 to 450 ticks (3 to 4,5 marks)
"save evnt"
Effect: Saves event timer information
"reset evnt"
Effect: Resets all event timer information
"stop evnt"
Effect: Stops the event timer.
"start evnt"
Effect: Restarts the event timer.
Note: All settings done via these commands are preserved by OP2's saving/loading mechanism.
Upcoming: More commands, random events
Known bugs:
-None
Updates:
->0.1-064
#->0.2-086
-Updated "spwn" to accept optional white-spaces between each group number
-Updated "loc" to take spaces instead of ":" and "="
-Updated list of bugs
-Added command "load"
-Added random electric storms
#->0.3-091
-Fixed incorrect use of loc generating too many error messages
-Added command "save"
-Added command "file"
-Added folder "fl_file"
-Added file "fl_file\savescript.txt"
#->0.3.1-106
-Updated "spwn" to accept an empty parameter list
-Updated "load" behaviour
-Updated "grp" to accept an additional expression variant
-Updated "reset" and "save" to accept a variable argument list
-Fixed incorrect "last command" buffer functionality
-Added file "fl_file\do_save.txt"
-Added error messages in case the user enters an unknown command
#->0.4-122
-Updated file "fl_file\do_save.txt"
-Added saveable command "time"
-Added command "start"
-Added command "stop"
#->0.4.1-136
-Updated file "fl_file\do_save.txt"
-Fixed memory leak under edge case low memory conditions
-Fixed slot selection interpreting 'all slots selected' as 'none selected'
-Added random meteors, vortexes and quakes
-Added saveable command "storm"
-Added saveable command "meteor"
-Added saveable command "vortex"
-Added saveable command "quake"
-Added saveable command "version"
-Added command "noop"
#->0.4.2-155
-Updated file "fl_file\do_save.txt"
-Added a very small selection of random events
-Added saveable command "evnt"
#->0.4.3-158
-Added alternative land rush-style variation
Download v0.4.3-158 AlphaDownload source v0.4.3-158 AlphaAs usual, if you encounter any bugs, please tell me.