Quick Script Syntax Check: RemoveItem

Post » Tue Jun 19, 2012 9:11 am

I want the following script to fire at a line of dialogue to essentially sell the designated item (alias).

Scriptname QutSellItemScript extends TopicInfoGame.JunkChest.RemoveItem(SellItem, 1)Game.GetPlayer().AddItem(Gold001, (SellItem.GetGoldValue()))ReferenceAlias Property SellItem  AutoReferenceAlias Property JunkChest  AutoMiscObject Property Gold001  Auto

This is the error I get, which seems to indicate something is wrong with my RemoveItem line:

Starting 1 compile threads for 1 files...Compiling "QutSellItemScript"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QutSellItemScript.psc(3,4): no viable alternative at input '.'No output generated for QutSellItemScript, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on QutSellItemScript

Removing "Game" from line 3 gives a similar error.
User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Post » Tue Jun 19, 2012 10:46 am

have you tried

JunkChest.GetReference().Removeitem(SellItem, 1)
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm

Post » Tue Jun 19, 2012 6:39 am

I'm guessing this supposed to be a fragment script?

If you use the fragment interface then your code will reside inside a function, where it will be valid.
See the FAQ on how you'll need to save a dummy fragment before declaring your properties.
It's a 3-stage thing, and a PITA.

http://www.creationkit.com/FAQ:_My_Script_Doesn%27t_Work! <-- last entry.
User avatar
Natalie Harvey
 
Posts: 3433
Joined: Fri Aug 18, 2006 12:15 pm

Post » Tue Jun 19, 2012 6:48 pm

Still getting the same error in the same line. Also tried defining JunkChest as a container instead of as a Reference Alias.
User avatar
jadie kell
 
Posts: 3497
Joined: Sat Jul 29, 2006 3:54 pm

Post » Tue Jun 19, 2012 7:26 pm

Hehe, Tuna, I tried a second time to get it to work as a fragment. After saving, closing, and reloading, it let me define the properties (I've seen the happen before: What a pain!).

Anyway, I get a whole different set of errors now. It seems to not like the functions themselves:

Starting 1 compile threads for 1 files...Compiling "qut__TIF__0101D388"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\qut__TIF__0101D388.psc(9,25): type mismatch on parameter 1 (did you forget a cast?)c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\qut__TIF__0101D388.psc(10,44): GetGoldValue is not a function or does not existc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\qut__TIF__0101D388.psc(10,17): type mismatch on parameter 2 (did you forget a cast?)No output generated for qut__TIF__0101D388, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on qut__TIF__0101D388
User avatar
cassy
 
Posts: 3368
Joined: Mon Mar 05, 2007 12:57 am

Post » Tue Jun 19, 2012 12:17 pm

ive had these exact compiler errors before. the problem for me was because of the type of script (extends quest, extends topicinfo, etc) was not recognizing the functions, and then when i changed it to like extends objectreference it worked
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Tue Jun 19, 2012 10:28 am

Yep, as AD says, it looks like a simple type mismatch thingy.
Can you post the auto-generated TIF file too? The line numbers in the errors should be easier to follow then.

I'm guessing you'll need a SellItem.GetRef().GetGoldValue() as one of the fixes.
User avatar
daniel royle
 
Posts: 3439
Joined: Thu May 17, 2007 8:44 am


Return to V - Skyrim