Jump to content

Scripting/Script Fragments Help


Recommended Posts

Hi all, I want to create a fairly simple mod which adds a terminal that lets you trade with an NPC by executing the console command "[npc ref id].showbartermenu" (or the papyrus equivalent) when you activate a particular terminal entry (or just an activator)
How can I translate this from the console format into the papyrus format?

 

I'm having trouble getting the Papyrus script fragment to compile in the CK. Here's what I've got so far; first script compiled successfully whereas the fragment did not:

Scriptname TradeScript01 extends ObjectReference


Function Fragment_Terminal_01(ObjectReference akTerminalRef)


EndFunction

Actor Property kTinkerTom Auto ; filled with desired merchant actor

ObjectReference Property TinkerTomREF auto const

ActorBase Property pTinkerTom Auto Const

 

Fragment: kTinkerTom.ShowBarterMenu()

 

Error:

Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "Fragments:Terminals:TERM_InstituteTradeTerminal_01000F99"...
C:\Users\Cynic\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_InstituteTradeTerminal_01000F99.psc(16,19): script property pTinkerTom already defined
C:\Users\Cynic\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_InstituteTradeTerminal_01000F99.psc(16,19): script variable ::pTinkerTom_var already defined
C:\Users\Cynic\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_InstituteTradeTerminal_01000F99.psc(16,19): script property pTinkerTom already has a get function defined
C:\Users\Cynic\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_InstituteTradeTerminal_01000F99.psc(20,19): script property pTinkerTomTrade already defined
C:\Users\Cynic\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_InstituteTradeTerminal_01000F99.psc(20,19): script variable ::pTinkerTomTrade_var already defined
C:\Users\Cynic\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_InstituteTradeTerminal_01000F99.psc(20,19): script property pTinkerTomTrade already has a get function defined
No output generated for Fragments:Terminals:TERM_InstituteTradeTerminal_01000F99, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on Fragments:Terminals:TERM_InstituteTradeTerminal_01000F99

Edited by CynicalSyllables
Link to comment
Share on other sites

That fragment is screwed.

 

Looks like you have been trying to edit it in an external editor rather than the fragment UI as it should start with the clear warning:

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

 

Also when you do get the script working, you may not be able to pop a modal trade/barter menu ontop of an open Terminal screen.

Link to comment
Share on other sites

That fragment is screwed.

 

Looks like you have been trying to edit it in an external editor rather than the fragment UI as it should start with the clear warning:

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

 

Also when you do get the script working, you may not be able to pop a modal trade/barter menu ontop of an open Terminal screen.

Thanks. I'll start over and see if that fixes the fragment.

What problems do you forsee with the barter menu/trade terminal conflict? Would I need to exit the terminal or would it just not work at all?

Link to comment
Share on other sites

Okay, now I'm getting a different error. It doesn't recognize showbartermenu, so I think I need to define more, not sure exactly what.

 

Redone script:

 

Scriptname TradeScript02 extends ObjectReference Const

Function Fragment_New((ObjectReference akTerminalREF)

Endfunction

Fragment compilation result:

 

Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "Fragments:Terminals:TERM_DefaultTerminalInstitut_001B2362"...
C:\Users\Cynic\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalInstitut_001B2362.psc(7,11): ShowBarterMenu is not a function or does not exist
No output generated for Fragments:Terminals:TERM_DefaultTerminalInstitut_001B2362, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on Fragments:Terminals:TERM_DefaultTerminalInstitut_001B2362


Edited by CynicalSyllables
Link to comment
Share on other sites

  • Recently Browsing   0 members

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