Parsing these arguments into something usable is left up to your script. 'args' is the argument(s) the player entered after this command, for example the command "addcrew 500 elite" would pass in "500 elite" as a single String. public CommandResult runCommand(String args, CommandContext context) This interface contains only one method (plus two enumerations, see below): Your commands must implement the interface. Just follow the same procedure you did to add the Starsector API. Just comment out the row by adding a # at the beginning to prevent the game from loading your command until it's finished)įirst off, make sure your IDE has "mods/Console Commands/jars/lw_Console.jar" added as a library. (Sometimes you may want to start with the CSV row to get a better idea of how your command will look.
If you are the sort who learns best by example, you might find copying from that mod easier than following this tutorial.
Placing them elsewhere allows you to bundle commands with a regular mod that will only be loaded if the console is tagged in the launcher.Īn example mod that adds several simple commands can be found in the mod folder. Starsector will automatically compile any scripts in this directory or its subdirectories, and this will cause errors when the console mod is not active. It is _highly_ recommended that you do not place your commands in data/scripts. Commands can also be in jars (which shouldn't create a dependency as these classes won't be loaded if the console isn't active). The console mod loads command classes itself, so you can place the java files anywhere in your mod folder you want - data/console/commands is a good choice as data/console already exists to contain commands.csv. You do not need to add Console.jar to your mod_info.json.Īll commands are contained in their own separate Java class. To add custom commands to the console you'll need a mod that contains two things: your commands' scripts, and the file data/console/commands.csv to register them in. This tutorial is intended to explain the new process in detail.
A major design goal of version 2.0 was to make implementing these commands as painless as possible. These work in both contexts, but function in different ways. Some commands are listed under both campaign and combat. AddCommandPoints, BlockRetreat, EndCombat, Flameout, ForceDeployAll, God, InfiniteAmmo, InfiniteCR, InfiniteFlux, Kill, NoCooldown, Nuke, RemoveHulks, Repair, Reveal, Rout, ShowAI, ShowBounds, ShowLoc, SpawnAsteroids, Suicide, ToggleAI, Traitor.AddCredits, AddCrew, AddFuel, AddHullmod, AddItem, AddMarines, AddOfficer, AddOrdnancePoints, AddShip, AddSkillPoints, AddSpecial, AddSupplies, AddWeapon, AddWing, AddXP, AdjustRelation, AllBlueprints, AllCommodities, AllHullmods, AllHulls, AllWeapons, AllWings, FactionInfo, FindItem, FindShip, ForceDismissDialog, ForceMarketUpdate, GoTo, Hide, Home, InfiniteFuel, InfiniteSupplies, Jump, Kill, List, OpenMarket, PlanetList, Repair, Respec, Reveal, SetCommission, SetHome, SetRelation, ShowLoc, SpawnDerelict, SpawnFleet, Storage, Suicide, Survey.Alias, BugReport, Clear, DevMode, DumpHeap, Help, List, ModInfo, Reload, RunCode, Settings, SourceOf, Status.Should be compatible with all mods, even total conversions.Doesn't require a new game, and can be safely untagged from a running game without issues.
For example, "god nocooldown reveal infiniteflux infiniteammo" would run all of these combat cheats in a row. You can enter multiple commands by separating them with a semicolon. For more information on a specific command use 'help '.
For a full list of supported commands enter 'help' in the console. While the commands themselves aren't case sensitive, arguments are. Once in the game, you can summon the console with control+backspace and enter your commands.
Put it in the mods folder and make sure it's tagged in Starsector's launcher. c local surface = for y=-1,1 do for x=-1,1 do surface.This is installed just like any regular mod.
Below you will find a plethora of cheat codes and console commands for Factorio. Using cheat codes you can summon hundreds of resources, weapons, armor, and more.