Jump to content

Some scripting help - Remove all items from player


FrankFamily

Recommended Posts

I need to remove all items from the player and send them to a chest that will be accesible later to retrieve them. So it's like a jail, but without being sent anywhere, just removing all items.

 

First i thought about using removeallitems() but that apparently doesn't remove quest items even if you use the flag. And then i found:

 

http://www.creationkit.com/SendPlayerToJail_-_Faction

 

which is suposed to do that, but i wonder if it will break quests or requiring extra setup, i asume i have to make a faction and choose a reference object for the items to be retrieved and another container for stolen goods (is there any way to have both things in the same container?).

Other than the faction is there any extra setup required? will the quest items be on the chest?

 

The script would be something like this (just copying the relevant part)

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Myfaction.SendPlayerToJail(abRealJail = false); the example at creationkit.com says true for "fake" jail which is weird.
EndEvent

Thanks in advance.

Link to comment
Share on other sites

TBH you don't want to be removing the players quest items as it may break their quest the item comes from.

Quest items are in an alias and when you remove it from the player it may break the link to the alias that holds it.

Example:

Books that use text replacement and the text is updated as the quest completes..

Most cases removing the book from the player will break the text replacement leaving the book blank of text if the Alias the book is in is not set up to handle it (which most are not set up to handle it).

 

So unless your absolutely sure that the quest items your removing from the player and sure you are not going to break other quests, then avoid removing quest items from the player.

 

Probably wouldn't be so bad if there was a function to get reference aliases that hold the quest item..

(Bit like the SKSE function for actors to get all reference aliases holding them, but for items instead)

Then you could handle the quest item yourself and assure your not breaking links to the item.

But I'm not aware of any functions to do it that way (even though there may be).

Edited by sLoPpYdOtBiGhOlE
Link to comment
Share on other sites

Thanks, one thing i found after posting is that SendPlayerToJail doesn't actually move quest items but instead it hides them, and then they are unhidden when clearprison or servetime functions are called, so maybe that is what i have to do, i'll do some testing.

The other option is of course use removeallitems not removing quest items but then the player could have a quest weapon and thats what i want to avoid.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...