Thread: 2.7 Update
View Single Post
01/09/17, 04:26 PM   #29
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Originally Posted by sirinsidiator View Post
I managed to make it work somewhat.
But there are a few major drawbacks.
  • I currently rely on SHARED_FURNITURE:GetPlaceableFurnitureCategoryTreeData():GetNumEntriesRecursive() and filter items by name in order to find what I need, but that means that it does not work across languages and it also requires that there is no search text placed in the housing editor (although I probably can clear that from code).
  • It looks like some items do not return an itemName from GetPlacedHousingFurnitureInfo which makes it impossible to restore them with this method. (Haven't checked which items are affected yet)
  • In order to find out which method I should use to place an item (HousingEditorRequestItemPlacement or HousingEditorRequestCollectiblePlacement) I use GetCollectibleInfo and check if the name is an empty string, but I am not confident that it is always correct. I believe if I get an itemLink it would be easy to determine by comparing the itemType.
  • This method is slow and sends a lot of individual requests to the server. Maybe you could add a HousingEditorBeginItemPlacement, HousingEditorCommitItemPlacement and HousingEditorRollbackItemPlacement and in the same fashion a HousingEditorBeginItemRemoval, HousingEditorCommitItemRemoval and HousingEditorRollbackItemRemoval to collect these calls locally and then do a bulk update. For removal you could also just add a HousingEditorClearHouse method which removes everything.
Please provide an example of an item without a name when you find one.

As for the placement functions, those trigger an inventory operation and also broadcast a new piece of furniture to everyone when they are used. We have to be careful so that if an addon was made that moved or placed the full contents of the house very frequently it would not grind the servers to a halt. The current mechanism for this is using the message rate limits, but we could potentially build a more robust system for queuing these things in the future.
  Reply With Quote