BiskmatarCatalyst Posted April 7, 2015 Share Posted April 7, 2015 Hey all, Running into a short scripting issue. I need a key added to the player's inventory after paying a cost, and since you can't sell keys directly, I wrote a script to add the key after purchasing a book. The book has a high cost (100K). However, I want the value of the book set to zero after purchase, so that it can't be resold to recoup the cost. The OBSE CS extension allows for the SetGoldValue function, but it's not setting the book cost to zero after running the script. According to the TESCS wiki, the function syntax is reference.SetGoldValue nuGoldValue. The current script layout is: scn ModKeyBookAddScriptshort Dooncebegin OnEquipif ( Doonce == 0 )player.additem 01052C5E 1 ;this adds the key to the player's inventoryModChorrolHouseKeybook.SetGoldValue 1 ;this -should- mod the cost of the book to 1, but isn'tset Doonce to 1endifend I'd use the TESCS wiki forums, but it doesn't seem very active anymore. Any help? Link to comment Share on other sites More sharing options...
Deleted3619564User Posted April 7, 2015 Share Posted April 7, 2015 First of all, use the name of the object and not the id when you use the additem. The id can change at runtime.Then it seems you are mixing the base object with the ref.You need to set the gold value on the ref if you use ModChorrolHouseKeybook.SetGoldValue, while it seems the base object id name, so you need to do:SetGoldValue 1 ModChorrolHouseKeybook Anyway the wiki: http://cs.elderscrolls.com/index.php?title=List_of_Functions Link to comment Share on other sites More sharing options...
Recommended Posts