Can't move items to the chest. Need help with existing scrip

Post » Sun Nov 18, 2012 2:34 pm

Can't transport items to the chest.

I wanted a guard to take all player's items and then put them in the chest nearby. Before adding
 akTransferTo 
script worked fine
Using this tutorial http://www.creationkit.com/RemoveAllItems_-_ObjectReference I just simply took one script:


 Game.GetPlayer().RemoveAllItems(abRemoveQuestItems = true, akTransferTo = None) 

Then I added the ID of the chest:


 Game.GetPlayer().RemoveAllItems(abRemoveQuestItems = true, akTransferTo =  MODChestValuablesGuard) 

And it is not compiling any more.
What is my mistake?
User avatar
DarkGypsy
 
Posts: 3309
Joined: Tue Jan 23, 2007 11:32 am

Post » Sun Nov 18, 2012 3:06 pm

Have you set up an ObjectReference property named MODChestValuablesGuard?

EDIT: I'm not sure if it matters, but you might want to make sure that you have the parameters in the right order when passing values.
User avatar
Albert Wesker
 
Posts: 3499
Joined: Fri May 11, 2007 11:17 pm

Post » Sun Nov 18, 2012 7:15 am

Besides agreeing with MrJack, there is no need to write so much. Just game.getplayer().removeallitems(ModChestValuableGuard)

There is no use in includding 'true' paramether for abRemoveQuestItems, as it didn't work anyway.
User avatar
evelina c
 
Posts: 3377
Joined: Tue Dec 19, 2006 4:28 pm

Post » Sun Nov 18, 2012 8:59 am

Have you set up an ObjectReference property named MODChestValuablesGuard?

How do I make one? I mean which one?
User avatar
Laura-Jayne Lee
 
Posts: 3474
Joined: Sun Jul 02, 2006 4:35 pm

Post » Sun Nov 18, 2012 2:35 pm

You need to define the object at the start or the end of the script like this:
Objectreference Property MODChestValuablesGuard Auto

Then, if you want it to have a proper value, instead of being just a name, you need to go to the CK, and in the object you attached the script to, select the script, then properties, then MODChestValuablesGuard and assign it the correct value (in this case the chest containing the valuables in the correct cell).
User avatar
Ice Fire
 
Posts: 3394
Joined: Fri Nov 16, 2007 3:27 am

Post » Sun Nov 18, 2012 7:18 am

You need to define the object at the start or the end of the script like this:
Objectreference Property MODChestValuablesGuard Auto

I have to put it in the end of the dialogue before RemoveAllItems or in the Chest scripts? Because the script is not compiling in both places.
User avatar
Hope Greenhaw
 
Posts: 3368
Joined: Fri Aug 17, 2007 8:44 pm

Post » Sun Nov 18, 2012 3:57 pm

You can put it just beneath the first line (which contains Scriptname).
User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Sun Nov 18, 2012 11:45 am

This is what inside the Dialogue script

Spoiler
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname TIF__01010C16 Extends TopicInfo Hidden

Objectreference Property MODChestValuablesGuard Auto

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Game.GetPlayer().RemoveAllItems(MODChestValuablesGuard)
GetOwningQuest().SetStage(10)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Int Property NewProperty Auto
{Objectreference Property MODChestValuablesGuard Auto}


And this is compilation mistake

Spoiler
Starting 1 compile threads for 1 files...
Compiling "TIF__01010C16"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01010C16.psc(9,32): variable MODChestValuablesGuard is undefined
No output generated for TIF__01010C16, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__01010C16


I put the value of the dungeon to the chest and to the script in the dialogue.
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Sun Nov 18, 2012 2:14 am

Forget it! It works! Don't know why it is not compiling but it works! Thank you very much guys!!! :biggrin:
User avatar
Amanda Furtado
 
Posts: 3454
Joined: Fri Dec 15, 2006 4:22 pm


Return to V - Skyrim