Hi, does someone can help me adding an item to the player

Post » Wed Jun 20, 2012 3:04 am

Hi, does someone can help me adding an item to the player, just buy dialogue with an NPC ? i have tryed
Game.GetPlayer().AddItem(Diamond, 2, true)
but it doesn't work when compiling

the error message:
Starting 1 compile threads for 1 files...
Compiling "TIF__03004E15"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__03004E15.psc(9,25): variable Diamond is undefined
No output generated for TIF__03004E15, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__03004E15
User avatar
Brittany Abner
 
Posts: 3401
Joined: Wed Oct 24, 2007 10:48 pm

Post » Tue Jun 19, 2012 3:32 pm

You need to add a property. Call it "Gem", or anything really, and make it a MiscObject property type, and set the diamond as the actual object.

Refer to the property name for any instance in which you need to refer to the diamond.




The irony of this post is I cant even construct a simple script on my own, yet i know this part.
User avatar
Emmi Coolahan
 
Posts: 3335
Joined: Wed Jan 24, 2007 9:14 pm

Post » Tue Jun 19, 2012 1:47 pm

thanks i'm trying.
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am

Post » Tue Jun 19, 2012 2:09 pm

Its a learning process for us all. Best of luck to you.
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Wed Jun 20, 2012 4:23 am

i have created a key and linked it to a key property named KeyKruft01, now i write in the papyrus end window:

Game.GetPlayer().AddItem(KeyKruftO1, 1)

still the same error compiling.
What can i write in the papyrus window ?
User avatar
Nomee
 
Posts: 3382
Joined: Thu May 24, 2007 5:18 pm

Post » Wed Jun 20, 2012 12:30 am

well i find out how it works, it was just a matter of property name, thanks you :)
User avatar
Rusty Billiot
 
Posts: 3431
Joined: Sat Sep 22, 2007 10:22 pm


Return to V - Skyrim