Jump to content

Referencing a function in a holotape fragment


iqoniq

Recommended Posts

I've got a script that has some functions I've made, and I'm trying to use it with a holotape.

 

The functions are fine and I can get them working as a fragment with some minor changes (just removing the Function/EndFunction), but I have absolutely no idea how to reference the script and functions in the holotape. I'm just trying to avoid duplicating what is pretty much the same thing over and over again, only with certain values changed.

 

Is it possible to do this, or am I missing something?

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Not at all missing anything.

 

Script fragments are horrible to work with and maintain so I keep most Functions in a quest script and call them from the script fragments (holotape, quest, perk ... whatever)

Use the [Properties] button to create a fragment property to your Quest, say MyQuest = pMyQuest

In the fragment:

(pMyQuest as MyQuestScriptName).MyQuestScriptFunctionName()

Example:

(pSKK_ARMQuest as SKK_ARMQuestScript).SwitchEnabled()

The ability to test any object "IS" and call any object "AS" an attached script is one of the least well explained things in the history of explaining things:

If (ThisActor is WorkshopNPCScript) 
   (ThisActor as WorkshopNPCScript).GetWorkshopID()
EndIf

...

 

Holdon ! If your actually wanting to create arbitrary functions in a holotape/terminal fragment script and call them from the holotape/terminal selection fragments I have not seen it done that way. If you dont want to use a quest object, add your functions script to the terminal. EXCEPT if it is being run from the Pipboy there may be no "Self" context so the script may not be referenceable. Which is exactly why I use quests to host function scripts.

Link to comment
Share on other sites

Thank you ever much. I've gone with the quest method as you suggested as I couldn't get it working attaching the script to the terminal. I didn't have an issue using a quest, I just wasn't sure how to go about it. The script is for a vendor terminal, so repeating the same routine over and over again seemed really wasteful.

 

Once again, many thanks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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