scripting compile fail

Post » Mon Oct 21, 2013 10:01 pm

ok so ive looked around for some tutorials and only seemed to see a few on youtube but they are really basic like clicking items. read tutorials but i dont seem to get it.

this is what i am trying to do at the moment

Scriptname HrefnaImperfectGold extends TopicInfo
{Hrefnar gives Imperfect Gold Ingots
for every Gold ore you have}

if (Game.GetPlayer().GetItemCount(0005ACDE) = 1)

then
(Game.GetPlayer().RemoveItem(0005ACDE, 1)

then
(Game.GetPlayer().AddItem(04007000, 1, true)
endIf

if (Game.GetPlayer().GetItemCount(0005ACDE) > 5)

then
(Game.GetPlayer().RemoveItem(0005ACDE, 5)

then
(Game.GetPlayer().AddItem(04007000, 5, true)
endIf

if (Game.GetPlayer().GetItemCount(0005ACDE) >20)

then
(Game.GetPlayer().RemoveItem(0005ACDE, 20)

then
(Game.GetPlayer().AddItem(04007000, 20, true)
endIf

this script is on the end of a diologue and the diologue only appears if you have more than 1 gold ore so there is no problem missing off if (player doesnt have them.)

there might be something simple that i am missing here.

however the code fails to compile. ive managed to figure out all the other things so far just dont seem to get this one :(

also while we are looking at this if i wanted 3 items removing would it be like

if (Game.GetPlayer().GetItemCount(code, code, code) = 1, 2, 1)

then
(Game.GetPlayer().RemoveItem(code, code, code) = 1, 2, 1

then
(Game.GetPlayer().AddItem(code, 1, true)
endIf

since for adara i may want an ingot and a gem removing :smile:

this is a next big step in my mod also really.

ive tried looking at bethesda scripts however none really say what you can change and all that or if they do the item codes seem to blend in with the script so i may be missing the blatantly obvious jumping out at me

User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm

Post » Mon Oct 21, 2013 10:47 pm

Please use [code=auto:0] tags next time.

It seems like you are used to scripting in Oblivion. You can't reference a form directly; the most basic way to get something like gold ingots into your script is with a http://www.creationkit.com/Bethesda_Tutorial_Basic_Quest_Scripting#Properties (a variable whose value you can set in the CK). Also, the syntax of http://www.creationkit.com/Statement_Reference#If_Statement is different. And you shouldn't be attaching scripts to dialogue manually, and your code has to be wrapped in functions or events. Learn about http://www.creationkit.com/Bethesda_Tutorial_Dialogue#Scripting_Dialogue!

If you address all of these, you may get your script to compile, but Hrefnar would only handle one ingot at a time. It's best to store the player's ore count in a variable and use that variable in the AddItem and RemoveItem calls.

User avatar
abi
 
Posts: 3405
Joined: Sat Nov 11, 2006 7:17 am


Return to V - Skyrim

cron