Jump to content

Getting a terminal to run a .swf script


Recommended Posts

  • 1 month later...

I've been playing FO4 for some time now and been walking around with a mod idea that needs this too. I quickly found that this is not possible with just the Creation Kit, and it seems Papyrus Script won't cut it either. This is because the Terminal records don't have a Program property like the Holotape records. After reading, searching and scrolling for a day or 2 at the Creation Kit Wiki about the different options available with Papyrus, I couldn't find any options for loading swf files or holotapes (with autoplay) directly into the terminal through Papyrus in either the Terminal or its parent scripts.

 

So I started looking at the swf files provided with the game (Fallout4 - Interface.ba2), and found 3 interesting files:

  • TerminalMenu.swf
  • TerminalButtons.swf
  • SWFLoaderMenu.swf

The first file manages the content of the terminal itself, including the hacking minigame, and the second manages the options below the terminal ('Exit' and 'Load Holotape'). The third one seems to load swf files, altho I haven't figured out exactly where to. So I started decompiling said swf files and found a few interesting calls.

 

Within TerminalButtons.swf I found the following function:

private function onHolotapeButtonPressed() : void
{
    this.BGSCodeObj.HolotapeActivate();
}

Altho the name of the internal call says 'HolotapeActivate', it tells the game to show you the menu where you can select a holotape. This seems to be a generated menu, as it doesn't have its own swf file. And things got worse, as searching the Creation Kit Wiki for either 'BGSCodeObj' or 'HolotapeActivate' ended op returning no results (AKA 'HolotapeActivate' is not present within any of the Papyrus Scripts). So that turned out to be a dead end.

 

This leaves me with the TerminalMenu and SWFLoaderMenu files. And, as happens more often to me, while I'm writing this I got the Idea to inject the loader functions from SWFLoaderMenu.swf into TerminalMenu.swf and to use a Keyword on the terminal to identify the terminals that should load an swf, and otherwise behave the same way as normal. Now I'm not sure yet whether this will work, but I have a good feeling about it. Now for the things I want to do with my mod, there will be more than one swf file that should be loadable into the terminal, which means that the modified TerminalMenu.swf will get a somewhat dynamic loader. That way it might be possible that other modders, like you, can use this modified TerminalMenu as a community resource within your own projects, just like AWKCR, MCM, and such.

For what I've found now, this should be the easiest solution, and won't require any other modded assets (F4SE for instance). The only downside is that it won't be compatible with other mods that modify TerminalMenu.swf

 

Hope this gives you some ideas too. I'll post again if I manage to get it working, or if I hit a snag.

 

 

PS: I used JPEXS FFDec to get inside those swf files.

Edited by SeriousHare
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...