"IsPlayerInsideOpenShop" since DFU 0.15.3 doesn't seem to work properly for Bank/Library

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

"IsPlayerInsideOpenShop" since DFU 0.15.3 doesn't seem to work properly for Bank/Library

Post by King of Worms »

Hi, this was discovered by Zoran who works on the DREAM dynamic paperdoll backgrounds, its a change which happened recently, so I would like to bring it to your attention, using his own words:
Check function "IsPlayerInsideOpenShop" from PlayerEnterExit.cs doesn't seem to work properly for the Bank (0x03) and Library (0x0A) interiors. When a player enters a bank or a library during the open hours the check function doesn't switch to "True" - it ONLY affects banks and libraries and NOT any other shops. This issue appeared on DFU 0.15.3 and is not present on older build 0.14.5.
One slight offtopic (but on topic anyway) - so I dont have to start new thread for it
What does Building Type "Town4" (0x04) correspond to igame?
We were not able to decipher this. Thanks a lot!

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: "IsPlayerInsideOpenShop" since DFU 0.15.3 doesn't seem to work properly for Bank/Library

Post by Interkarma »

Hey KoW! I've found the cause of this. BTW, this is absolutely present in all versions of DFU, just the change you requested back in February to lower the secondary inside flags when exiting buildings has helped reveal it to you.

Banks and Libraries are not considered shops by the IsShop() test. They are considered to be service providers more like Temples and Taverns. The purpose of IsShop() test is to determine if quality message (e.g. "this shop is better appointed than many") should be displayed - which does not happen for Banks and Libraries.

If I was to change this, the player would start seeing quality messages for Banks and Libraries, which is not the intent of the IsShop() test. Insofar as classic, it displays the quality message for Libraries but not for Banks. I've just standardised this message to classify shops as buildings where the buy/sell inventory UI is used, which doesn't include these two building types.

To offer a solution, you can use the public property PlayerEnterExit.BuildingType to get current building type player is inside of (if they are inside a building) and PlayerActivate.IsBuildingOpen(buildingType) to determine if building is within opening hours. And of course, you should be using PlayerEnterExit.IsPlayerInsideBuilding to determine if player is actually inside a building first.

To answer the second question, Town4 and Town23 are just houses and will be marked with the basic house colour on automap. These building types are not used directly in any quest, it's unknown why they have their own data type.

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: "IsPlayerInsideOpenShop" since DFU 0.15.3 doesn't seem to work properly for Bank/Library

Post by King of Worms »

Hi Interkarma,

thanks a lot for a detailed reply. I will FWD it to Zoran as I understand it only partially. But you described it so well even I - as a person who has no idea about the code - get it :) Also thanks for the town 4 / 32 explanation.

Hope you doing well, al the best!

Post Reply