ShopGameDataInfo.byml: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
mNo edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude>
<onlyinclude>
'''ShopGameDataInfo.byml''' (found in Bootup/Gamedata) is a [[Yaz0]]-compressed [[BYML]] file which contains data pertaining to [[Actor|actors]] purchasable from NPC Shops. It is used when purchasing items (actors) from a shop to keep track of items that are "Sold Out".  
'''ShopGameDataInfo.byml''' (found in Bootup/Gamedata) is a [[Yaz0]]-compressed [[BYML]] file which contains data pertaining to [[Actor|actors]] purchasable from NPC Shops. It is used by [[GameDataMgr]] to keep track of items that have been purchased from a shop ("sold out" items) and [[GameDataMgr#bool_and_s32_flags_with_reset_type_3|restock them]] periodically.
</onlyinclude>
</onlyinclude>
== Contents ==
== Contents ==
===ShopAreaInfo Hashes===
===ShopAreaInfo Hashes===
'''ShopAreaInfo Hashes''' is an array of CRC32 hashes of all Shop actor-name flags.  
'''ShopAreaInfo Hashes''' is an array of CRC32 hashes of all shop actor-name flags.  
The hashed flags are named in the format Npc_Name_Actor_Name.
The hashed flags are named in the format Npc_Name_Actor_Name.
This array does not need to be sorted. {{Check}}
 
This array ''must'' be sorted, as GameDataMgr performs a binary search on the list<ref>ksys::gdt::Manager::getShopInfoIter: https://github.com/zeldaret/botw/blob/2eeae37cf787e8ab1cf64b98db35de4b1b0fca3f/src/KingSystem/GameData/gdtManager.cpp#L630</ref>.
 
Similar to tag values, each number is stored as an unsigned int if it is greater than 0x80000000 and as a signed int otherwise.
Similar to tag values, each number is stored as an unsigned int if it is greater than 0x80000000 and as a signed int otherwise.


===ShopAreaInfo Values===
===ShopAreaInfo Values===


===SoldOutInfo Hashes===
This section contains a list of all items sold by NPCs.
===SoldOutInfo Values===
 
This list must be in the same order as the [[#ShopAreaInfo Hashes]] array.


{| class="wikitable"
!Name
!Description
!Example
|-
|Areas
|A list of map area coordinates where the item is sold when the Dealer and Item are the same. This is used to prevent the item from being restocked while the player is in the same map area. Each coordinate identifies a map area on the [[revival map grid]].
| [0, 6]
|-
|Dealer
|The name of the actor which sells the item.
|Npc_MamonoShop
|-
|Item
|The name of the actor which is sold.
|Armor_160_Upper
|-
|}


''Example entries:''


  - Areas:
    - [1, 7]
    Dealer: NPC_oasis065
    Item: Armor_008_Upper
   
  - Areas:
    - [0, 6]
    - [1, 2]
    - [6, 5]
    - [7, 7]
    - [8, 0]
    - [8, 3]
    - [8, 5]
    - [9, 2]
    Dealer: Npc_MamonoShop
    Item: Armor_160_Upper


===SoldOutInfo Hashes===
'''SoldOutInfo Hashes''' is an array of CRC32 hashes of all shop actor-name flags that change state when sold out.
The flags are used in stores where the item is physically shown to the player (e.g A Mannequin displaying Armor).
The hashed flags are named in the format Npc_Name_Actor_Name.


This array ''must'' also be sorted, as GameDataMgr performs a binary search on the list<ref>ksys::gdt::Manager::getShopInfoIter: https://github.com/zeldaret/botw/blob/2eeae37cf787e8ab1cf64b98db35de4b1b0fca3f/src/KingSystem/GameData/gdtManager.cpp#L630</ref>.


Similar to tag values, each number is stored as an unsigned int if it is greater than 0x80000000 and as a signed int otherwise.


===SoldOutInfo Values===




This is a list of lists of hashes of boolean GameData flags that should be reset<ref>ksys::gdt::TriggerParam::resetFlagsAccordingToPolicy: https://github.com/zeldaret/botw/blob/2eeae37cf787e8ab1cf64b98db35de4b1b0fca3f/src/KingSystem/GameData/gdtTriggerParam.cpp#L1670</ref>. This list must be in the same order as the [[#SoldOutInfo Hashes]] array, but each list of hashes need not be sorted.


[[Category:Content (BotW)]]
[[Category:Content (BotW)]]

Latest revision as of 15:53, 16 June 2022

ShopGameDataInfo.byml (found in Bootup/Gamedata) is a Yaz0-compressed BYML file which contains data pertaining to actors purchasable from NPC Shops. It is used by GameDataMgr to keep track of items that have been purchased from a shop ("sold out" items) and restock them periodically.

Contents

ShopAreaInfo Hashes

ShopAreaInfo Hashes is an array of CRC32 hashes of all shop actor-name flags. The hashed flags are named in the format Npc_Name_Actor_Name.

This array must be sorted, as GameDataMgr performs a binary search on the list[1].

Similar to tag values, each number is stored as an unsigned int if it is greater than 0x80000000 and as a signed int otherwise.

ShopAreaInfo Values

This section contains a list of all items sold by NPCs.

This list must be in the same order as the #ShopAreaInfo Hashes array.

Name Description Example
Areas A list of map area coordinates where the item is sold when the Dealer and Item are the same. This is used to prevent the item from being restocked while the player is in the same map area. Each coordinate identifies a map area on the revival map grid. [0, 6]
Dealer The name of the actor which sells the item. Npc_MamonoShop
Item The name of the actor which is sold. Armor_160_Upper

Example entries:

 - Areas:
   - [1, 7]
   Dealer: NPC_oasis065
   Item: Armor_008_Upper
   
 - Areas:
   - [0, 6]
   - [1, 2]
   - [6, 5]
   - [7, 7]
   - [8, 0]
   - [8, 3]
   - [8, 5]
   - [9, 2]
   Dealer: Npc_MamonoShop
   Item: Armor_160_Upper

SoldOutInfo Hashes

SoldOutInfo Hashes is an array of CRC32 hashes of all shop actor-name flags that change state when sold out. The flags are used in stores where the item is physically shown to the player (e.g A Mannequin displaying Armor). The hashed flags are named in the format Npc_Name_Actor_Name.

This array must also be sorted, as GameDataMgr performs a binary search on the list[2].

Similar to tag values, each number is stored as an unsigned int if it is greater than 0x80000000 and as a signed int otherwise.

SoldOutInfo Values

This is a list of lists of hashes of boolean GameData flags that should be reset[3]. This list must be in the same order as the #SoldOutInfo Hashes array, but each list of hashes need not be sorted.