Jump to content

is there any script to scrap item?


Recommended Posts

hi,sorry for my bad english,

 

i like to ask, is there any script to do this :

 

if Game.GetPlayer().getItemCount(TinCan01) >=1

Scrap(TinCan01) <= this
endif

 

note : i not talk about removeItem() or addItem(), is that kind syntax exist?

 

and second question is is there any script to open trade menu in "settlement workshop" (console command or papyrus) without interact with the "settlement workshop", something like "openactorcontainer 1" nut to open "settlement workshop"

Link to comment
Share on other sites

No there is not, the only base game script function is GetComponentCount() which is not simple.

 

To use the function, the junk item(s) need to be in an empty container and you need to cycle through a formlist of the 30 components checking for the count of each one, then adding the associated scrap item from another formlist with the same index sort order.

Int iIndex = 0
While iIndex < pComponentList.GetSize()
	Int iScrapCount =  pJunkContainer.GetComponentCount(pComponentList.GetAt(iIndex)) 
	pPlayerREF.AddItem(pScrapList.GetAt(iIndex), iScrapCount, true)
	iIndex += 1
EndWhile
pJunkContainer.RemoveAllItems()

EDIT: I am just finishing a mod which scraps junk the player adds to inventory in real time, saves weight when scavenging.

Edited by SKK50
Link to comment
Share on other sites

  • Recently Browsing   0 members

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