khazerruss Posted August 7, 2016 Share Posted August 7, 2016 (edited) I can't compile a RemoveItem function. It seams that something is wrong with my property.I found thiss note on CK wiki:The function accepts a form object, however you can't make a property to a form object, you need to create a property to another type of object that extends form. Most often a MiscObject, or Weapon, etc.I think that might be the problem, but I have trouble translating it to human. Somebody speeks nerdish? :tongue: Edit: Im posting my code and LOG CODE: Scriptname PlayerEqupingLimiter extends Actor Const Event OnItemEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject.HasKeyword(EquipSlot_A_Coat) if Game.GetPlayer().HasPerk(SlotEquipped_A_Coat) Game.GetPlayer().RemoveItem(Keyword EquipSlot_A_Coat, int aiCount = -1, bool abSilent = true) Game.GetPlayer().EquipItem(akBaseObject, abSilent = True) Game.GetPlayer().AddPerk(SlotEquipped_A_Coat) Else Game.GetPlayer().AddPerk(SlotEquipped_A_Coat) EndIf EndIfendEvent Perk Property SlotEquipped_A_Coat Auto Const Keyword Property EquipSlot_A_Coat Auto Const AND THE LOG:Papyrus Compiler Version 2.8.0.4 for Fallout 4Copyright © ZeniMax Media. All rights reserved.Starting 1 compile threads for 1 files...Compiling "PlayerEqupingLimiter"...C:\Users\borys\AppData\Local\Temp\PapyrusTemp\PlayerEqupingLimiter.psc(8,45): no viable alternative at input 'EquipSlot_A_Coat'C:\Users\borys\AppData\Local\Temp\PapyrusTemp\PlayerEqupingLimiter.psc(8,79): required (...)+ loop did not match anything at input ','C:\Users\borys\AppData\Local\Temp\PapyrusTemp\PlayerEqupingLimiter.psc(8,101): required (...)+ loop did not match anything at input ')'No output generated for PlayerEqupingLimiter, compilation failed. Edited August 8, 2016 by khazerruss Link to comment Share on other sites More sharing options...
paulatreides0 Posted August 7, 2016 Share Posted August 7, 2016 Seeing your script would be rather useful. Link to comment Share on other sites More sharing options...
khazerruss Posted August 7, 2016 Author Share Posted August 7, 2016 Seeing your script would be rather useful.Here is the line:Game.GetPlayer().RemoveItem( ########## , int aiCount = -1, bool abSilent = true) ########## - everithing I put in here fails the compilation.I'm trying to put keyword here.I tried a lot like:"Keyword KeywordName" or"akItemToRemove.HasKeyword(KeywordName)" Nothing seams to be working. Link to comment Share on other sites More sharing options...
Pokepunch Posted August 7, 2016 Share Posted August 7, 2016 Please refer to the examples on the wiki. You don't need to put the type into the function. So in your example: Game.GetPlayer().RemoveItem( KeywordName , int aiCount = -1, bool abSilent = true) You don't need the "int" or "bool". It's also unnecessary to have the "aiCount" and "abSilent" like so: Game.GetPlayer().RemoveItem( KeywordName, -1, true) Link to comment Share on other sites More sharing options...
khazerruss Posted August 7, 2016 Author Share Posted August 7, 2016 Please refer to the examples on the wiki. You don't need to put the type into the function. So in your example: Game.GetPlayer().RemoveItem( KeywordName , int aiCount = -1, bool abSilent = true) You don't need the "int" or "bool". It's also unnecessary to have the "aiCount" and "abSilent" like so: Game.GetPlayer().RemoveItem( KeywordName, -1, true)I doesn't change anything. Still not working. :( Link to comment Share on other sites More sharing options...
Pokepunch Posted August 7, 2016 Share Posted August 7, 2016 Show us your whole script, not just one line the entire thing. Link to comment Share on other sites More sharing options...
khazerruss Posted August 7, 2016 Author Share Posted August 7, 2016 (edited) Code In main post Edited August 8, 2016 by khazerruss Link to comment Share on other sites More sharing options...
Pokepunch Posted August 7, 2016 Share Posted August 7, 2016 So are you trying to remove a keyword? If so you need to use RemoveKeyword and not RemoveItem. Link to comment Share on other sites More sharing options...
khazerruss Posted August 7, 2016 Author Share Posted August 7, 2016 (edited) So are you trying to remove a keyword? If so you need to use RemoveKeyword and not RemoveItem.No. I'm trying to unequip player from all items that have a EquipSlot_A_Coat keyword. Edited August 7, 2016 by khazerruss Link to comment Share on other sites More sharing options...
paulatreides0 Posted August 8, 2016 Share Posted August 8, 2016 (edited) It's hard to know how to help you because we can't see your whole script. You have people essentially guessing as to how to do that. From what I can tell you are trying to remove an item that has a certain keyword? If so then you want something along the lines of: Game.GetPlayer().RemoveItem(<ObjectNameHere>.HasKeyword(<KeywordNameHere>)) Of course you'll need some kind of way of iterating through objects, either through a list that runs through and checks everything, or using events to check items. But, again, to say any more than that we'd need to see your code. Edited August 8, 2016 by paulatreides0 Link to comment Share on other sites More sharing options...
Recommended Posts