SubTerminalEX
Improve performance for command, enable other mods to add their own custom command and add some utility command for you
Last updated | a week ago |
Total downloads | 78 |
Total rating | 3 |
Categories | Mods Libraries |
Dependency string | Ozzzzy-SubTerminalEX-1.1.1 |
Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
SubTerminalEX v1.1.1
Note
- This is client-only mod, it does not add cheat or hacks, it does not allow user to use hidden system only terminal command by itself.
- If you happen to encounter crash, please report it to me so i can identify if it was because of my faulty code or vanilla issue
- If you got any issue with this mod, feel free to mention me in this discord server (username: Ozzzzymaniac)
Features
- "Cleanup" game command interpreter which improve performance (source?: trust me bro)
- Allow terminal to take a string argument
"this is multiple words argument"
as an single argument instead of being splitted to multiple argument - Add "a lot" of utility and quality of life commands
- Remove terminal bootup text (for people want "speed" startup, can be disabled in config
- Allow other mods to add their own desired custom commands and more...
New terminal command
clear
or it alias cls
- Clear all text on the terminal
alias (set/map) [old] [new]
or alias [old] [new]
- Map [old] command to [new] so you can type [new] and it will work as if you are typing [old]
- E.g
alias set view_cam vcam
now you can type vcam and it work as if you are using view_cam
- E.g
alias (rem/remove/rm) [new]
- Remove mapped [new] command
- E.g
alias rem vcam
vcam will no longer work
- E.g
alias (clear/reset)
- Reset and remove all mapped commands
- E.g
alias clear
vcam and anything mapped before this point will now no longer work
- E.g
alias load [filename]
- Load a pre-defined alias text file at GAME_ROOT directory, due to "lazy" limitation loading a new alias text file result in all current alias'ed command being removed (technically a
alias clear
before loading the new file) - Please note that [filename] are case in-sensitive because it will get capitialized!
- E.g
alias load promax
now any of pre-defined alias will work just like you manually typing alias set
- E.g
alias (gen/generate) [filename]
- Generate alias text file for use of
alias load
, the generated file will include all of currently alias'ed command - Please note that [filename] are case in-sensitive because it will get capitialized!
- E.g
alias gen promax
will create a "PROMAX.txt" file at GAME_ROOT directory for use withalias load
- E.g
Alias Format
The alias text file is a simple text file that are follow the [block][separator?]
format
[block]
: a text section contain[old command]<space>[new command]
, within this block everything after[new command]<space>
are ignored[separator?]
: is either a newline\n
or a comma,
E.g:
view_cams vcam <= ( [block] = view_cams vcam; [separator?] = \n )
shop s this is a comment and will be ignored
list_bulkhead ldoor -- this is also a comment and also ignored (including --)
list_cam lcam, open_bulkhead open -- this comma is valid
close_bulkhead close,minimap mmap -- also valid
For mods developer (last revised: 11/13/2024)
- Note that any change to the first number in the mod version will cause incompatibility which mean any of these api will be or can be completely unsuable
- All argument passed to your new command can be more than you request, only argument passed to vanilla are exactly the size they request!
- Prefer to xml documentation named
SubTerminalEX.xml
for more information
Add custom command
public static IEnumerator OnExecuteA(List<string> _){} // command has no argument so you can safely ignore the argument passed in
public static IEnumerator OnExecuteB(List<string> args) {} // command has argument, and are listed by the order they typed in
public static IEnumerator newMinimap(List<string> args) {} // when minimap is executed this method will run instead of the original method
public static void OnExecuteHook(List<string> args) {} // this method will run after route_to is executed, all argument passed in are exactly like the original command
// way 1 - for command have no argument
// command, on execute method, name, description
TerminalCommandManager.AddNoArgumentCommand("play", OnExecuteA, "do something A", "description");
// way 2 - for command that have argument
// command, on execute method, name, description, argument amount, force exact argument amount, is argument optional (can be skipped by user), parameter description, example usage command
TerminalCommandManager.AddCommand("reset", OnExecuteB, "do something B", "description", 2, true, false, "[type] [how]", "reset game now");
// way 3 - override command (from other mods or vanilla)
// except for the first 2, the rest can be skipped
// which vanilla command (e.g view_cam), on execute method, name, description, parameter description, argument amount, is argument optional (can be skipped by user), example command
TerminalCommandManager.OverrideCommand("minimap", newMinimap);
// extra: you can create your own alias too for mods that want to add alias for their own command, this work just like when user typed in "alias base_command new_alias"
TerminalCommandManager.AliasCommand("base_command", "new_alias");
// extra 2: you can now hook the desired command instead of override and then use hacks to run the original command!
// hook target can be before or after (and is after by default, also optional so you can ignore it)
// hook priority mean your hook execute before or after other hook that are hooked against the same command, you can also specify number, ordered descending so high number execute first before low number (is optional and you can ignore it)
TerminalCommandManager.HookCommand("route_to", OnExecuteHook, STEHookTarget.Default, STEHookPriority.Default);
Remove command
// you can remove command added by mods or even remove vanilla command (not recommend unless you know what you're doing)
TerminalCommandManager.RemoveCommand("minimap");
License
MIT License
Copyright (c) 2024 Nguyen Anh Tri
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.