Jump to content

OBSE CS script error


Recommended Posts

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 ModKeyBookAddScript

short Doonce

begin OnEquip

if ( Doonce == 0 )
player.additem 01052C5E 1 ;this adds the key to the player's inventory
ModChorrolHouseKeybook.SetGoldValue 1 ;this -should- mod the cost of the book to 1, but isn't
set Doonce to 1
endif

end

 

 

 

I'd use the TESCS wiki forums, but it doesn't seem very active anymore. Any help?

Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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