IWantMyMod Posted January 29, 2018 Share Posted January 29, 2018 Is it possible to run a script from the console. I've been searching around but I haven't found anything helpful on this subject. Link to comment Share on other sites More sharing options...
JobVanDam Posted January 30, 2018 Share Posted January 30, 2018 Like a .pex file? No, I don't think that's possible. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 30, 2018 Share Posted January 30, 2018 You cannot run a papyrus script directly from the console. You can start a quest from the console. Said quest could have a script with code to start running in the OnInit event. Depending upon what you want to do, this may or may not be feasible. Link to comment Share on other sites More sharing options...
IWantMyMod Posted January 30, 2018 Author Share Posted January 30, 2018 That's a shame. It would have been very helpful for testing and debugging. Link to comment Share on other sites More sharing options...
anjenthedog Posted November 13, 2022 Share Posted November 13, 2022 You cannot run a papyrus script directly from the console. You can start a quest from the console. Said quest could have a script with code to start running in the OnInit event. Depending upon what you want to do, this may or may not be feasible.Not to hijack the thread, but just for curiosity, could a general purpose quest be made that would accept a script name at execution, ie a hook into Console that would fire X when called by a quest request? Or am I being wishful/ignorant? EX: > setstage MySillyQuestForCallingAnyOldScript 10 <User input script name> Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 13, 2022 Share Posted November 13, 2022 I do not think so. That said, if there is a utility / extension that allows obtaining string data from the console, then something might theoretically be doable. Thinking about the possibility of using console input string data to do something like {scriptname}.{functionname}({parameters}) to run a Form or Game function when the console is closed. SKSE can catch when the console closes with OnMenuClose. But the rest of it, wishful thinking as far as I know. Link to comment Share on other sites More sharing options...
xkkmEl Posted November 14, 2022 Share Posted November 14, 2022 You can use modevents to map strings to functions, or even gotoState, but I don't see a way to get a string from the console or how to trigger directly a modevent or a state change. You can trigger various events, and from there run your scripts, but AFAIK the scripts must have been specially prepared for the purpose, and attached to a form of some kind. You can't just call a script from the filename in a string variable... you have to call a function inside the script... with a function name and arguments... and a "self". Here are a few event triggering methods available from the console:startQueststartScenecastSpellplaceAtMeaddSpell (to add an ability) Truthfully, in most cases, mod authors create "lesser powers" (a type of spell) to access this type of functionality from the game instead of the console. Using a spell, you can prompt the player for a string (using SkyUI for example), and then map that string to an attached script (using a modevent, gotoState, or just calling an overridden function). Link to comment Share on other sites More sharing options...
Recommended Posts