Jump to content

Terminal Scripting Help Needed


Recommended Posts

Okay, so I've hit a bit of a wall. So I'm working on my Scrap Everything mod, trying to script a terminal (that will eventually connect to a holotape) that will allow the user to choose what they want to scrap.

 

Basically, how it's going to work is Every constructible object (COBJ) added by the mod has an IsInList NoScrapList = 0 condition, so when they are added to the list the createable object attached to it can no longer be scrapped.

 

My issue lies in text replacement. My intention is to have text replacement in one (possibly two, if I can get it to work) places:

 

1. When you select an option, the response text would change depending on whether you made it scrappable or not - if you toggled scrapability off, the message would be something like "X can no longer be scrapped" or "X can now be scrapped" if you turned it on again. Note that all options are on by default and the user must choose what they want to toggle off. I also want to make an INI that controls this, but as of right now I can't figure out how...

 

2. (possibly) If I can get it to work, I want to make it so that, in addition to #1, there would be some sort of indicator something like MYOBJECTNAME to indicate at a glance that the formlist is not scrappable.

 

Since I am going to have, like, 500 different lists, I kind of need to avoid having to create a variable (whether global or otherwise) for all of them (because that would be ridiculous).

 

This is the script I am trying to attach to a terminal menu item:

 If (NoScrapList.HasForm(DLC03_BarnDoorframes) == False)
    NoScrapList.AddForm(DLC03_BarnDoorframes)
    Self.AddTextReplacementData("ScrapToggle", ScrapToggleOff)
  Else
    NoScrapList.RemoveAddedForm(DLC03_BarnDoorframes)
    Self.AddTextReplacementData("ScrapToggle", ScrapToggleOn)
  EndIf

And the errors I am getting:

TERM_SS_ScrapConfigDLC03_Arc_06004D2D.psc(9,9): AddTextReplacementData is not a function or does not exist
TERM_SS_ScrapConfigDLC03_Arc_06004D2D.psc(12,9): AddTextReplacementData is not a function or does not exist
No output generated for Fragments:Terminals:TERM_SS_ScrapConfigDLC03_Arc_06004D2D, compilation failed.

Is it because AddTextReplacementData is an ObjectReference function? Should I add 'import ObjectReference' to the script? Cast the terminal I am applying the script to as an ObjectReference? Am I just doing it wrong?

 

Link to comment
Share on other sites

Your fragment will be called (or at least should be called) with something like "akTerminalRef" as parameter.

Thus change

Self.AddTextReplacementData("ScrapToggle", ScrapToggleOn)

to

akTerminalRef.AddTextReplacementData("ScrapToggle", ScrapToggleOn)

 

AFAIK, there is no "Self" in a fragment.

 

HTH

Edited by deadbeeftffn
Link to comment
Share on other sites

  • Recently Browsing   0 members

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