Cultist Simulator

Cultist Simulator

The Roost Machine
 This topic has been pinned, so it's probably important
Chelnoque  [developer] 11 Jan, 2022 @ 8:46am
THE VAGABOND - Command Line
Console now can be opened in the main menu and is reinforced with command line.
Possible commands:

/reimport
to reload all JSONs and update all game entities. Equivalent of vanilla's "Update Content".

/compendium [entityType] [entityId] [property]
to log a specified property of an entity of specified type and id. All arguments past [entityType] are optional. In case only entityType is specified, it'll log an alphabetised list of all entities of such type. In case only entityType and id are specified, it'll return all properties of said entity.
Case insensitive.

/unity [unityObject] [property] [value]
to retrieve and set values for Unity GameObjects and Components.
[unityObject] should always start with a GameObject name. You can add additional parts to it (separated by ".") to specify a Component or another GameObject relative to this in Unity Hierarchy.
/unity AuxConsole.child.0 will retrieve the first child of the object "AuxConsole".
/unity AuxConsole.parent will retrieve the first child of the object "AuxConsole".
/unity AuxConsole.Image will retrieve the Image component of the same object.
You can combine any number of these "pointers", but if you're targeting component, it should always go last.
Same as with /compendium, all parameters are optional. If used parameterless, /unity will log all active objects. If only object is specified, it'll log all its Components. If Component is specified, it'll return all its properties. If property is specified, it'll return its value. If value is speicifed, it'll try to assign the value to the property.
GameObject, Components and properties names are case sensitive.



You can add your own command with
Roost.Vagabond.CommandLine.AddCommand(string command, Action<string[]> method)
Example:
Roost.Vagabond.CommandLine.AddCommand("log", SimpleLog) void SimpleLog(string[] commands) { Birdsong.Sing(String.Join(commands, " ")); }
Then /log my command will result in words "my command" appearing in the console. All additional words (everything separated by spaces) past the initial command name are passed in your method as an array.

Some other modules of the Roost Machine use their own commands, look them up at the corresponding discussion.
Last edited by Chelnoque; 3 Mar, 2022 @ 6:37am