Minoumimi Posted April 18, 2014 Posted April 18, 2014 Hello i do not want people to access my minikaka's inventory but they are picking up stuff they shouldn't i couldnt make them creatures so they are NPC's but i used my cat scripts on them, so it does not allow for anything else then follow and stop But if they pick up guns well, i made 2 of them With claws and even if set to melee default they will use my strongest guns i got in the schoolhouse lol is there a way i can either prevent them from looting at all, or if not does anyone have the script to make a simple lazer gun that could open bags and thats it i tried scn NekoInventory begin GameMode also tried (( Begin OnActivate openteammatecontainer 1 endif end i mean in topic thats all there is to open the bags O_o hmm
Odessa Posted April 18, 2014 Posted April 18, 2014 well... this feels like a bit of a hack and there may be a better way, but: You could create a form list with all the equipment they are allowed to hold. Then, in some block that runs fairly regularly, you could add: ref rYourCat ; or whatever your actor it is ref rItem int iCount Begin GameMode set iCount to rYourCat.GetNumItems while ( iCount > 0 ) set rItem to rYourCat.GetInventoryObject iCount ; * set to inv item X if ListGetFormIndex MyAllowedItemFormList rItem == -1 ; * if not in allowed list rYourCat.Drop rItem 1 ; * drop, or replace this with some other method endif let iCount -= 1 ; * I am pretty sure inv is 1-based numbering, so this belongs here not at start loop End So, they'll still pick stuff up, but they drop it afterwards. Maybe it smells funny. EDIT: You could also use RemoveAllTypedItems specifying the formlist of allowed items, to remove all items except the ones allowed, and put them someplace else.
Minoumimi Posted April 18, 2014 Author Posted April 18, 2014 hmm thanks ! ill give it a try ! starting to look a bit complicated for me haha so i will save this for future use =) really though i could have something easier lol but i looked groovatron script and wowow i been wondering maybe that option in geck weaopn tab that says ( player only) would prevent them from looting them? but i wouldnt want it to totally make it unusuable for them unless i actually just duplicate the guns they own and make those playable for them hmm
Odessa Posted April 18, 2014 Posted April 18, 2014 I don't think making weapons player only is a good idea, it would block all NPCs in the game from using it not just your cats, and modifying vanilla records is best avoided when practical. If its only weapons you want them to drop (or whatever) thats easy too, add 'GetObjectType' ref rYourCat ; or whatever your actor it is ref rItem int iCount Begin GameMode set iCount to rYourCat.GetNumItems while ( iCount > 0 ) set rItem to rYourCat.GetInventoryObject iCount ; * set to inv item X if rItem.GetObjectType != 40 ; this magic number means 'weapon', if the item is not a weapon, we just skip it ; Pass elseif ListGetFormIndex MyAllowedItemFormList rItem == -1 ; * if not in allowed list rYourCat.Drop rItem 1 ; * drop, or replace this with some other method endif let iCount -= 1 ; * I am pretty sure inv is 1-based numbering, so this belongs here not at start loop End Or to remove all weapons from the actor to some container except the ones you want them to be allowed: rMyCatREF.RemoveAllTypedItems SomeContainerREF 0 0 40 MyCatsAllowedWeaponsFormList
jaam Posted April 18, 2014 Posted April 18, 2014 If you want to remove alll weapons at once, don't forget to set the claws as quest item, so they get left behind.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.