S0P Posted January 31, 2016 Share Posted January 31, 2016 I'm trying to remove/unequip an item from an NPC during a quest, the rest of the script during the quest seems to run without error, however the collar seems to not remove itself (Obligatory: I'm a bit of a noob when it comes to modding)I suspect I have the buddy reference wrong. 00slavecollar is a quest object rather than the default "slave collar", but the issue persists regardless of which version I use. player.removeitem 00slavedetonator 1setstage 00madmorals 30setobjectivecompleted 00madmorals 10 1setobjectivecompleted 00madmorals 20 1RewardXP 1001madtopsRef.unequipitem 00slavecollar 11madtopsRef.removeitem 00slavecollar 1 Lemme know what I'm doing wrong. Link to comment Share on other sites More sharing options...
S0P Posted February 5, 2016 Author Share Posted February 5, 2016 Well, better question I suppose. Is it possible to use "removeitem" on an npc object assuming the object reference is correct? Link to comment Share on other sites More sharing options...
madmongo Posted February 5, 2016 Share Posted February 5, 2016 You don't need to unequip the item before removing it. Maybe that is what is causing the trouble? I've used removeitem in conversation scripts and it has worked fine. I've never tried it from a quest script but I don't know any reason why it wouldn't work. Link to comment Share on other sites More sharing options...
S0P Posted February 8, 2016 Author Share Posted February 8, 2016 tested it without the unequiping, same thing.actually anything in the script using the NPC's reference seems to fail, so I'm almost certain I'm forming the "buddyREF" part of the script incorrectly. I should be using the reference editor ID (and adding REF) at its set n the reference window with the base object/zone/positional co-ordinates ect. correct? NPCeditorid = NPCeditoridREF.dosomethingexample 1 ? Link to comment Share on other sites More sharing options...
madmongo Posted February 9, 2016 Share Posted February 9, 2016 Let me go through this step by step and make sure we are on the same page. You create an NPC in the GECK. Let's call him Buddy (since you called him Buddy). Now we place Buddy somewhere. Double click on the Buddy that you placed, and a form comes up. Up at the top you fill in the reference ID. This name can be anything you want, as long as it is unique. It makes things easier on you if you give him a reference ID of BuddyREF, but that format is not required. Now your scripts look like this (this is off the top of my head, so let's just pretend that SlaveCollar01 is a valid editor ID): To give Buddy a slave collar and make him wear it:BuddyREF.additem SlaveCollar01 1BuddyREF.equipitem SlaveCollar01 Get rid of Buddy's slave collar:BuddyREF.removeitem SlaveCollar01 1 I don't know why you have the NPCeditorID in your post. If you use the GECK powerup, it will tell you when scripts fail to compile and will give you more info than the standard GECK. Link to comment Share on other sites More sharing options...
S0P Posted February 10, 2016 Author Share Posted February 10, 2016 Yep, we're on the same page. Ran the GECK power up, cobbled together a generic test npc with some limited dialog for testing purposes, confirmed the reference ID was unique and correct, same with the intended item to be manipulated, Split the scripts between two dialog options (one to add and then equip, one to remove the item) 00NPCREF.AddItem 00slavecollar 100NPCREF.equipitem 00slavecollar 1Error is: script command "00NPCREF.AddItem" not found. 00NPCREF.removeitem 00slavecollar 1Error is: script command "00NPCREF.removeitem" not found. Now, interestingly enough, when I switch it to player.additem or player.removeitem ect as appropriate, everything runs fine ***FIgured it out***For some reason using leading 00s or numbers in the reference ID for the NPC causes things to not work. I took those out and everything compiles and runs without any problem whatsoever. Link to comment Share on other sites More sharing options...
madmongo Posted February 10, 2016 Share Posted February 10, 2016 Yeah, I've run into that before. I didn't catch that you had 00 at the front of the names in your first post, but as I read your last post that immediately jumped out at me. But then I read the rest of your post and you had figured it out yourself anyway. I started out prefixing things with 00 in my own mods then switched to zz after running into the exact same problem. Glad you got it working. Link to comment Share on other sites More sharing options...
S0P Posted February 11, 2016 Author Share Posted February 11, 2016 Huge thanks for the feedback. :) Link to comment Share on other sites More sharing options...
Recommended Posts