About this mod
An SFSE plugin that automatically runs user defined console commands on some events.
- Requirements
- Permissions and credits
- Changelogs
Contact me if you are reading this and you are Bobbyclue! Well, 50% of this mod DPs are already yours.
How to install
Install the Data folder.
You can do this manually.
- Place it to the game root and merge with existing Data there.
You can use a mod-manager.
- If you use Mod Organizer 2 then let the mod-manager handle this mod's archive.
- If you use Vortex then let the mod-manager handle this mod's archive.
I can't help you with your installation issues.
If you don't get any "ConsoleCommandRunner.log" in your "Documents\My Games\Starfield\SFSE\Logs" - this is your installation issue.
How to use
- Create an uniquely named .toml file in your "Data\SFSE\Plugins\ConsoleCommandRunner" directory. Any number of .toml files can be read, you are not limited to a single file. This ensures compatibility with other mods.
- In this new .toml file you'll want to create a layout that looks like this:
[[Event]]
EventType = "DataLoaded"
Commands = ['SetGS fZKeyMaxForce 90000', 'bat MyFile', 'bat "My File With Spaces"']
[[Event]]
EventType = "OnMenuOpenCloseEvent"
asMenuName = "BSMissionMenu"
abOpening = true
Commands = ['Player.RestoreAV StarPower 1000;CGF "Debug.Notification" "Player was powered"']
[[Event]]
EventType = "GameLoaded"
aiLoadType = 2
Commands = ['005788.MoveTo Player']
[[Event]]
EventType = "OnItemEquipped"
abEquipping = true
asActorString = "FC_HT_RonHope"
aItemStrings = ['Clothes_Baseball_Cap_01_HopeTech']
Commands = ['Print "That damn cap again..."']
Each individual event is prefaced with the "[[Event]]" tag. Within the event the event type needs to be defined. If an event has any parameters those are listed. Then the actual commands to fire are listed. Any valid console command should work here. Commands should be encased in apostrophes (so quotes will also work for any command that takes a string parameter) and separated by commas.
And that's it!
Be careful when you Ctrl-C Ctrl-V something from NexusMods, invisible symbols are possible, I mean ZWNBSP and such. They break parsing, double-check that.
Valid event types
- DataLoaded
- This event will run registered console commands when the game data is fully loaded (this happens in the main menu before you load your gameplay process). This happens only once so if you exit to the main menu the event will not fire again.
- You can use this event to change things that persist across the whole game session with no changes including saves and characters switch. This means using "SetGS fZKeyMaxForce 90000" is nice but "005788.AddKeyword 1453AA" is useless (your changes will be ignored in your save load).
- OnMenuOpenCloseEvent
- This event will run registered console commands when you open or close different menus. It has 2 options - menu name and open/close condition. For example asMenuName="BSMissionMenu" with abOpening=true will fire when you open your missions menu where you track your tasks. All valid menus names are listed here or here (63 of them).
- You can use this event to process some things when your player character is already in the game world and you can control them. Here you have access to persistent object references and CGF (CallGlobalFunction) console command.
- GameLoaded
- This event will run registered console commands when you start a new game (including NG+) or when your save is loaded and you are in the game world. It's similar to OnMenuOpenCloseEvent but has one integer option - aiLoadType. 0 = assigned commands will be executed on both new game and save loaded, 1 = only on new game, 2 = only on save loaded.
- You can use all the same commands as for OnMenuOpenCloseEvent because it fires during the game process but once, in the very beginning.
- OnItemEquipped
- This event will run registered console commands when an actor equips or unequips something. This happens all the time so make sure you use good filtering. So, about filtering, this event has 3 options.
- abEquipping - boolean, true = equip, false = unequip.
- asActorString - here you can specify a string, it can be actor Editor ID or actor base Editor ID or actor Form ID w/ plugin or actor base Form ID w/ plugin. What is Form ID with plugin? This is string that looks like this: "starfield.esm:0x27A23C" - it has plugin name in lower-case, colon, 0x prefix and local record Form ID. Why so many options? Many actors have no Editor ID and using Form ID is the only solution. Fortunately, Player always has "PlayerRef" Editor ID but you can also use starfield.esm:0x14 or Player or starfield.esm:0x7.
- aItemStrings - this is a strings array. You already know what is it, "Commands" is also a strings array. Here only Editor IDs work but you can also specify keywords Editor IDs to filter by weapon or armor type, etc. This array works with AND rule only, this means all specified Editor IDs must be present within item. If you specify Wakizashi and WeaponTypeMelee1H - this is fine. But if you use Wakizashi and WeaponTypeRanged - filtering will cut everything because the game has no ranged Wakizashi.
Source