danatoth666 Posted February 13, 2012 Share Posted February 13, 2012 So I want to give the player an item for the quest. I'm not a scripter at all and barely understand how to do any of it, but I've been learning. So I created an item, then made it an Alias in my quest (created at the quest giver) of it. When the quest reaches stage 10 I want to give the player the item. I had no idea how to do thisso I just tried to find a quest that did the same thing. Here is what I found, but it doesn't work.(The alias name I made for my item was "Letter") Alias_Letter.TryToEnable()Game.GetPlayer().AddItem(Alias_Letter.GetReference()) Can anyone give me the correct code? Also if you know, what is the script to remove an item? Link to comment Share on other sites More sharing options...
Lastito Posted February 13, 2012 Share Posted February 13, 2012 hope this work :wallbash: to give a item, you have to find the ID first, this can be seen with type "showinventory" to a container or NPC with consolethen type "player.additem (item ID) (quantity)" it will automatically give the item to player to remove it ... well target the NPC or Container then type "removeitem (item ID) (quantity)" should work, but not sure. :facepalm: just try it. lol :laugh: Link to comment Share on other sites More sharing options...
danatoth666 Posted February 13, 2012 Author Share Posted February 13, 2012 hope this work :wallbash: to give a item, you have to find the ID first, this can be seen with type "showinventory" to a container or NPC with consolethen type "player.additem (item ID) (quantity)" it will automatically give the item to player to remove it ... well target the NPC or Container then type "removeitem (item ID) (quantity)" should work, but not sure. :facepalm: just try it. lol :laugh: Are you talking about command console here?This doesn't work by putting it as a script and compiling it, I get errors. Link to comment Share on other sites More sharing options...
Lastito Posted February 13, 2012 Share Posted February 13, 2012 oh sorry! I don't know maybe you should check to cs.elderscrolls.com :wallbash: Link to comment Share on other sites More sharing options...
Cipscis Posted February 13, 2012 Share Posted February 13, 2012 Skyrim uses a completely new scripting system called Papyrus. All of the scripting information on the Oblivion Construction Kit Wiki is no longer relevant for scripting. AddItem is the correct function for adding an item, and RemoveItem can be used to remove an item. You might also try Debug.Notification to make sure that your code is actually running - it should print a message to the screen. Cipscis Link to comment Share on other sites More sharing options...
danatoth666 Posted February 13, 2012 Author Share Posted February 13, 2012 (edited) So I tried using this code: Game.GetPlayer().AddItem(EGPMedicineNote, 1, false) But I get this error: \Scripts\Source\temp\QF_EGPTestQuest_02005F97.psc(34,25): variable EGPMedicineNote is undefinedNo output generated for QF_EGPTestQuest_02005F97, compilation failed. Just to make it clear, EGPMedicineNote is an item I created. It is not placed anywhere in the world. Edited February 13, 2012 by danatoth666 Link to comment Share on other sites More sharing options...
Deleted147363User Posted February 13, 2012 Share Posted February 13, 2012 (edited) Hmmm...I checked that link out and tried the code it suggested: Game.GetPlayer().AddItem(Diamond, 2, true) Just to see if it would actually add the diamond. I got this error when I compiled the script: \Data\Scripts\Source\temp\QF_EGPTestQuest_02005F97.psc(34,25): variable Diamond is undefinedNo output generated for QF_EGPTestQuest_02005F97, compilation failed. I don't understand why though... The compiler is throwing an error because it doesn't know which object "Diamond" refers to. First make sure you have an object with a unique ID.Create a quest alias for it with a unique nameIn quest stages add a property and property type to the scriptIt should list the alias and object type in the Properties window. Edited February 13, 2012 by Guest Link to comment Share on other sites More sharing options...
danatoth666 Posted February 13, 2012 Author Share Posted February 13, 2012 Hmmm...I checked that link out and tried the code it suggested: Game.GetPlayer().AddItem(Diamond, 2, true) Just to see if it would actually add the diamond. I got this error when I compiled the script: \Data\Scripts\Source\temp\QF_EGPTestQuest_02005F97.psc(34,25): variable Diamond is undefinedNo output generated for QF_EGPTestQuest_02005F97, compilation failed. I don't understand why though... The compiler is throwing an error because it doesn't know which object "Diamond" refers to. First make sure you have an object with a unique ID.Create a quest alias for it with a unique nameIn quest stages add a property and property type to the scriptIt should list the alias and object type in the Properties window. I've made my item (EGPMedicineNote) into an Alias called "Letter"I then tried this code: Alias_Letter.TryToEnable() Game.GetPlayer().AddItem(Alias_Letter.GetReference()) Which is a direct copy of another quest that gives the player a note. It compiles fine, but in game it doesn't give me the note. Link to comment Share on other sites More sharing options...
gsmanners Posted February 13, 2012 Share Posted February 13, 2012 So I tried using this code: Game.GetPlayer().AddItem(EGPMedicineNote, 1, false) But I get this error: \Scripts\Source\temp\QF_EGPTestQuest_02005F97.psc(34,25): variable EGPMedicineNote is undefinedNo output generated for QF_EGPTestQuest_02005F97, compilation failed. Just to make it clear, EGPMedicineNote is an item I created. It is not placed anywhere in the world. I don't really get the new scripting, but I think you need a declaration in your script along the lines of: Book Property EGPMedicineNote auto That should tell the compiler that what you're trying to do is link something in. Link to comment Share on other sites More sharing options...
danatoth666 Posted February 14, 2012 Author Share Posted February 14, 2012 Yeah I was reading on the official forums about this (i posted this question there as well) and Cipscis pretty much said the same thing about the editor ID.I tried to use your code: Book Property EGPMedicineNote auto but it says there is "no viable alternative at input 'Book'" or EGP Medicine note...HmmmHeadache! Link to comment Share on other sites More sharing options...
Recommended Posts