Skip to content

Instantly share code, notes, and snippets.

@Scrivener07
Last active March 27, 2020 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Scrivener07/eab6931beb00ef465975d8911f7566cd to your computer and use it in GitHub Desktop.
Save Scrivener07/eab6931beb00ef465975d8911f7566cd to your computer and use it in GitHub Desktop.
In fallout 4 there is a console command called `Screenshot`. You might be able to invoke the command in a convoluted way to execute it from Papyrus.
ScriptName ConsoleRunner Extends Quest
int Home = 36 const ; the home key
string EmptyState = "" const
string ExecuteState = "Execute" const
string ConsoleMenu = "Console" const
Event OnQuestInit()
RegisterForKey(Home)
EndEvent
Event OnKeyDown(int keyCode)
GotoState(ExecuteState)
EndEvent
State Execute
Event OnBeginState(string oldState)
RegisterForMenuOpenCloseEvent(ConsoleMenu)
UI.OpenMenu(ConsoleMenu)
EndEvent
Event OnMenuOpenCloseEvent(string menuName, bool opening)
If (opening)
var[] arguments = new var[1]
arguments[0] = "Screenshot" ; the console command to send
UI.Invoke(ConsoleMenu, "root1.AnimHolder_mc.Menu_mc.executeCommand", arguments)
GotoState(EmptyState)
EndIf
EndEvent
Event OnEndState(string newState)
UnregisterForMenuOpenCloseEvent(ConsoleMenu)
UI.CloseMenu(ConsoleMenu)
EndEvent
EndState
@Scrivener07
Copy link
Author

Scrivener07 commented Mar 27, 2020

A script like this could easily be altered to run a different console command, or any console command.

Example

Console: COC RedRocketExt

If (opening)
	var[] arguments = new var[1]
	arguments[0] = "COC RedRocketExt" ; the console command to send
	UI.Invoke(ConsoleMenu, "root1.AnimHolder_mc.Menu_mc.executeCommand", arguments)
	GotoState(EmptyState)
EndIf

UI.psc is a script provided by F4SE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment