Basic additem, please help!

Post » Tue Dec 04, 2012 11:10 pm

Hello! First of all, I'm completely new to scripting, so I apologize if I ask questions that seem very basic.

Here's what I'm trying to do: After a character says a certain line to the player, I want to add a specific key to the player's inventory. I've written the line and created the key. Now how do I get the key to the player?

I tried the following: I typed

player.additem(questkey01, 1)

into the Scripts - End - Papyrus Fragments box in the "Topic Info" window about that particular piece of dialogue. This won't compile, since (as I understand it) I have not defined any properties. However, a script called TIF_02002865 shows up in the "Script name" box. When I click on this I get the message "Errors encountered while attempting to reload the script". When I click "Ok", the "Properties" window opens up, but with all fields except "cancel" greyed out. What do I do now?


I've been trying to do this simple thing all afternoon, reading all kinds of tutorials on the internet, and by now I feel pretty stupid. There must be something I am overlooking, or am I going about this the wrong way all together?



Edit: I also tried it through creating an Alias for the key and using using the following:

Game.GetPlayer().AddItem(Alias_TestKey.GetRef())

... same result, same error message. :-( This is driving me crazy, please help.
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Return to V - Skyrim