1

Detect bookshelves by script

This commit is contained in:
Eddoursul 2022-06-22 16:06:25 +02:00
parent 487f5741b7
commit 3b78c86e79
5 changed files with 12 additions and 15 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,7 +8,6 @@ FormList Property ETR_ItemsStored Auto
FormList Property ETR_PersistentStorageList Auto FormList Property ETR_PersistentStorageList Auto
Container Property ETR_CellStorageContainer Auto Container Property ETR_CellStorageContainer Auto
Container Property PlayerBookShelfContainer Auto
Keyword Property LocTypePlayerHouse Auto Keyword Property LocTypePlayerHouse Auto
@ -88,14 +87,9 @@ Event OnUpdate()
endif endif
bRescanHome = false bRescanHome = false
ObjectReference bookShelf if lastDestContainer && lastDestContainer as PlayerBookShelfContainerScript
if lastDestContainer && lastDestContainer.GetBaseObject() == PlayerBookShelfContainer
bookShelf = lastDestContainer
endif
if bookShelf && bookShelf as PlayerBookShelfContainerScript
int iLimit = 10 int iLimit = 10
while iLimit >= 0 && (bookShelf as PlayerBookShelfContainerScript).GetState() == "PlacingBooks" while iLimit >= 0 && (lastDestContainer as PlayerBookShelfContainerScript).GetState() == "PlacingBooks"
Debug.Notification("Waiting for shelf update") Debug.Notification("Waiting for shelf update")
iLimit -= 1 iLimit -= 1
Utility.wait(0.5) Utility.wait(0.5)

View File

@ -8,7 +8,6 @@ FormList Property ETR_ItemsStored Auto
FormList Property ETR_PersistentStorageList Auto FormList Property ETR_PersistentStorageList Auto
Container Property ETR_CellStorageContainer Auto Container Property ETR_CellStorageContainer Auto
Container Property PlayerBookShelfContainer Auto
Keyword Property LocTypePlayerHouse Auto Keyword Property LocTypePlayerHouse Auto
@ -81,15 +80,19 @@ Event OnUpdate()
bRescanHome = false bRescanHome = false
ObjectReference bookShelf ObjectReference bookShelf
if lastDestContainer && lastDestContainer.GetBaseObject() == PlayerBookShelfContainer if lastDestContainer
if lastDestContainer as PlayerBookShelfContainerScript
bookShelf = lastDestContainer bookShelf = lastDestContainer
elseif lastSourceContainer && lastSourceContainer.GetBaseObject() == PlayerBookShelfContainer endif
elseif lastSourceContainer
if lastSourceContainer as PlayerBookShelfContainerScript
bookShelf = lastSourceContainer bookShelf = lastSourceContainer
endif endif
endif
if bookShelf && bookShelf as PlayerBookShelfContainerScript if bookShelf
int iLimit = 10 int iLimit = 10
while iLimit >= 0 && (bookShelf as PlayerBookShelfContainerScript).GetState() == "PlacingBooks" while iLimit > 0 && (bookShelf as PlayerBookShelfContainerScript).GetState() == "PlacingBooks"
Debug.Notification("Waiting for shelf update") Debug.Notification("Waiting for shelf update")
iLimit -= 1 iLimit -= 1
Utility.wait(0.5) Utility.wait(0.5)