Vortetty Posted January 6, 2019 Share Posted January 6, 2019 i have a script fragment for a terminal: if(game.GetPlayer().GetItemCount(f) >= 100) ;if has enough game.getPlayer().RemoveItem(f,100,false) game.getPlayer().AddItem(f,100,false) debug.notification("Enjoy the caps") else ;if has not enough debug.notification("Come back when you have enough caps") endIf it checks if the player has 100 caps, if they do, it removes 100 caps then gives them the item.The problem is i get the following error window: ---------------------------------------------------------------------------------------------------------------------------------------Papyrus Compiler Version 2.8.0.4 for Fallout 4Copyright © ZeniMax Media. All rights reserved.Starting 1 compile threads for 1 files...Compiling "Fragments:Terminals:TERM_ShoppingDefaultTerminal_0400220E"...C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\Fragments\Terminals\TERM_ShoppingDefaultTerminal_0400220E.psc(7,33): variable f is undefinedC:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\Fragments\Terminals\TERM_ShoppingDefaultTerminal_0400220E.psc(10,28): variable f is undefinedC:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\Fragments\Terminals\TERM_ShoppingDefaultTerminal_0400220E.psc(11,25): variable f is undefined No output generated for Fragments:Terminals:TERM_ShoppingDefaultTerminal_0400220E, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on Fragments:Terminals:TERM_ShoppingDefaultTerminal_0400220E --------------------------------------------------------------------------------------------------------------------------------------- i need help figuring out what the problem is any idea why it is broken anybody? Link to comment Share on other sites More sharing options...
Pokepunch Posted January 6, 2019 Share Posted January 6, 2019 (edited) The compiler log tells you everything you need. "variable f is undefined" You need to add a property called f in the Terminal Fragment window. Edited January 6, 2019 by Pokepunch Link to comment Share on other sites More sharing options...
Vortetty Posted January 6, 2019 Author Share Posted January 6, 2019 The compiler log tells you everything you need. "variable f is undefined" You need to add a property called f in the Terminal Fragment window.f is the id for Caps001 (bottlecaps), and all my research has shown i just need to use the id for the item i am removing/adding, or is there a special way to define an item you are using the id of? Link to comment Share on other sites More sharing options...
Pokepunch Posted January 6, 2019 Share Posted January 6, 2019 You don't use an items ID for scripts. You must add caps as a property on the script. You can do this by clicking on the "Properties" button at the bottom of the Papyrus Fragment box in the Terminal window. Then add a property. Caps are a Misc item called Caps001. Link to comment Share on other sites More sharing options...
Vortetty Posted January 6, 2019 Author Share Posted January 6, 2019 ok, thank you You don't use an items ID for scripts. You must add caps as a property on the script. You can do this by clicking on the "Properties" button at the bottom of the Papyrus Fragment box in the Terminal window. Then add a property. Caps are a Misc item called Caps001 Link to comment Share on other sites More sharing options...
Recommended Posts