Bas and GameDataMgr: Difference between pages

From ZeldaMods (Breath of the Wild)
(Difference between pages)
Jump to navigation Jump to search
imported>Ginger
 
imported>Leoetlino
 
Line 1: Line 1:
{{Stub}}{{Lowercase}}
{{Subsystem infobox|name=GameDataMgr|is_name_official=1|description=Manages game data flags|init_addr_switch150=0000007100DCE964}}
<onlyinclude>
{{stub}}
'''bas''' files each represent an animation that can be called by an [[actor]] or [[Demo|cutscene]]. They contain a reference to an animation name, but not the animation file itself. They can be found at '''Actor/AS/{EventName}/{AnimationSequenceName}.bas''' in [[Beventpack|beventpacks]] and [[TitleBG.pack]]/Actor/AS, and '''Actor/AS/{AnimationSequenceName}.bas''' in bactorpacks.
</onlyinclude>


==Layout==
GameDataMgr holds the date of all game data flags and provides functions to get, set and reset them. It is also responsible for keeping track of "shop sold out" flags and resetting them regularly.
Each bas file is made up of one list of elements, named Elements. Each element (Element0, Element1, etc) can be either a test to figure out what animation to play, or a call to play the animation.


===Parameters===
Flag data is loaded from [[bgdata]] files and stored in [[TriggerParam]] objects. Transferring data from and to save files is done by interacting with the [[SaveSystem]] and [[SaveMgr]] subsystems.
All nodes have Parameters, which determine what kind of node they are. They can be a control node, which helps decide which animation to play, or an animation node, which actually plays the animation.
{| class="wikitable"
!Key
!Key Type
!Description
!Node Type
!Default value
|-
|TypeIndex
|int
|Type of node the Element is. Known types are listed below the table.
| -
| -
|-
|NoSync
|bool
| -
|Control
| -
|-
|JudgeOnce
|bool
|Tells the game to skip evaluating this node (and use the previous result) if the input value has not changed since the last time the node was run.
|Control
|False
|-
|InputLimit
|float
| -
|Control
| -
|-
|FileName
|str64
|Name of the animation to play
|Animation
| -
|-
|Morph
|int
|Time to blend the previous animation into this one. (Whether this is in milliseconds or frames is currently unknown)
|Animation
| -
|-
|}


====Parameter TypeIndexes====
In debug versions, GameDataMgr is able to sync save data from and to a computer.
Nodes with Blender are generally used to perform the same checks as those with Selector in the name, with a key difference: Blender nodes may evaluate multiple cases as true, and will blend the resulting animations together. Selector nodes will choose only the first case that evaluates to true.{{Check}}
{| class="wikitable"
!Index
!Name
!Description
!Type
|-
|0
|AbsTemperatureBlender
|Current world temperature. Evaluated by float range.
|Control
|-
|1
|AbsTemperatureSelector
|Current world temperature. Evaluated by float range.
|Control
|-
|2
|ArmorSelector
| -
| -
|-
|3
|ArrowSelector
| -
| -
|-
|4
|AttentionSelector
| -
| -
|-
|5
|BoneBlender
| -
| -
|-
|6
|BoneVisibilityAsset
| -
| -
|-
|7
|BoolSelector
|Boolean evaluator - See [[#BitIndex]]{{#tag:ref|Element1 of Player_CutNinja.bas, WiiU 1.5.0|name=e1pcn}}{{#tag:ref|Element0 of Player_FaceDefault.bas, WiiU 1.5.0|name=e0pfd}}{{#tag:ref|Element2 of Player_FaceDefault.bas, WiiU 1.5.0|name=e2pfd}}
|Control
|-
|8
|ButtonSelector
| -
| -
|-
|9
|ChargeSelector
| -
| -
|-
|10
|ClearMatAnmAsset
| -
| -
|-
|11
|ComboSelector
| -
| -
|-
|12
|DiffAngleYBlender
| -
| -
|-
|13
|DiffAngleYSelector
| -
| -
|-
|14
|DirectionAngleBlender
|Compares to the movement analog stick's current orientation, in degrees, in counter-clockwise fashion. Accepts -359 to 360. (e.g. 270 and -90 both point directly to the right). Evaluated by float range.
|Control
|-
|15
|DirectionAngleSelector
|Compares to the movement analog stick's current orientation, in degrees, in counter-clockwise fashion. Accepts -359 to 360. (e.g. 270 and -90 both point directly to the right). Evaluated by float range.
|Control
|-
|16
|DistanceBlender
|Compares distance between Link and his current locked target{{#tag:ref|Element2 of Player_CutNinja.bas, WiiU 1.5.0|name=e2pcn}}. Evaluated by float range.
|Control
|-
|17
|DistanceSelector
|Compares distance between Link and his current locked target. Evaluated by float range.
|Control
|-
|18
|DungeonClearSelector
| -
| -
|-
|19
|DungeonNumberSelector
| -
| -
|-
|20
|EmotionSelector
| -
| -
|-
|21
|EventFlagSelector
| -
| -
|-
|22
|EyeSelector
| -
| -
|-
|23
|EyebrowSelector
| -
| -
|-
|24
|FaceEmotionSelector
| -
| -
|-
|25
|FootBLLifeSelector
| -
| -
|-
|26
|FootBRLifeSelector
| -
| -
|-
|27
|FootFLLifeSelector
| -
| -
|-
|28
|FootFRLifeSelector
| -
| -
|-
|29
|ForwardBentBlender
| -
| -
|-
|30
|ForwardBentSelector
| -
| -
|-
|31
|GearSelector
| -
| -
|-
|32
|GenerationSelector
| -
| -
|-
|33
|GrabTypeSelector
| -
| -
|-
|34
|GroundNormalBlender
| -
| -
|-
|35
|GroundNormalSelector
| -
| -
|-
|36
|GroundNormalSideBlender
| -
| -
|-
|37
|GroundNormalSideSelector
| -
| -
|-
|38
|MaskSelector
| -
| -
|-
|39
|MatVisibilityAsset
| -
| -
|-
|40
|MouthSelector
| -
| -
|-
|41
|NoAnmAsset
|Play no animation. Used to cancel evaluation.
|Animation
|-
|42
|NoLoopStickAngleBlender
| -
| -
|-
|43
|NoLoopStickAngleSelector
| -
| -
|-
|44
|NodePosSelector
|Compares name of a bone, takes StrRef of the bone name. Unknown how it decides which bone name to compare the StrRef to.{{#tag:ref|Element0 of Player_LadderJump.bas, WiiU 1.5.0|name=e0plj}}
|Control
|-
|45
|PersonalitySelector
| -
| -
|-
|46
|PostureSelector
| -
| -
|-
|47
|PreASSelector
|Compares last played animation name, takes StrRef of animation name. Known to accept two Children to test against, plus a default case, but might accept more or less.
|Control
|-
|48
|PreExclusionRandomSelector
| -
| -
|-
|49
|RandomSelector
|Picks a random node from the given nodes.{{Check}}
|Control
|-
|50
|RideSelector
| -
| -
|-
|51
|RightStickAngleBlender
| -
| -
|-
|52
|RightStickAngleSelector
| -
| -
|-
|53
|RightStickValueBlender
| -
| -
|-
|54
|RightStickValueSelector
| -
| -
|-
|55
|RightStickXBlender
| -
| -
|-
|56
|RightStickXSelector
| -
| -
|-
|57
|RightStickYBlender
| -
| -
|-
|58
|RightStickYSelector
| -
| -
|-
|59
|SelfHeightSelector
| -
| -
|-
|60
|SelfWeightSelector
| -
| -
|-
|61
|SequencePlayContainer
|Float comparison - Unknown{{#tag:ref|Element0 of Player_Move.bas, WiiU 1.5.0|name=e0pm}}
|Control
|-
|62
|ShaderParamAsset
|Plays material animation, takes StrRef of the animation name. Its Extend uses a secondary animation name for unknown purpose.{{#tag:ref|Element1 of Player_SkinColor.bas, WiiU 1.5.0|name=e1psc}}{{#tag:ref|Element2 of Player_SkinColor.bas, WiiU 1.5.0|name=e2psc}}
|Animation
|-
|63
|ShaderParamColorAsset
| -
| -
|-
|64
|ShaderParamTexSRTAsset
|Plays texture transform animation, takes StrRef of the animation name.
|Animation
|-
|65
|SizeBlender
| -
| -
|-
|66
|SizeSelector
| -
| -
|-
|67
|SkeltalAsset
|Plays model animation, takes StrRef of the animation name.
|Animation
|-
|68
|SpeedBlender
|Compares actor's current movement speed. Evaluated by float range.
|Control
|-
|69
|SpeedSelector
|Compares actor's current movement speed. Evaluated by float range.
|Control
|-
|70
|StickAngleBlender
|Compares the movement analog stick's current orientation, in degrees, in counter-clockwise fashion. Accepts -359 to 360. (e.g. 270 and -90 both point directly to the right). Evaluated by float range.
|Control
|-
|71
|StickAngleSelector
|Compares the movement analog stick's current orientation, in degrees, in counter-clockwise fashion. Accepts -359 to 360. (e.g. 270 and -90 both point directly to the right). Evaluated by float range.
|Control
|-
|72
|StickValueBlender
|Range evaluation - Unknown{{#tag:ref|Element0 of Player_SwimAtnMove.bas, WiiU 1.5.0|name=e0psam}}
|Control
|-
|73
|StickValueSelector
| -
| -
|-
|74
|StickXBlender
| -
| -
|-
|75
|StickXSelector
| -
| -
|-
|76
|StickYBlender
| -
| -
|-
|77
|StickYSelector
| -
| -
|-
|78
|StressBlender
| -
| -
|-
|79
|StressSelector
| -
| -
|-
|80
|SyncPlayContainer
|Synchronously plays multiple child elements
|Animation
|-
|81
|TemperatureBlender
| -
| -
|-
|82
|TemperatureSelector
|Range evaluation - Unknown{{#tag:ref|Element1 of Player_FaceDefault.bas, WiiU 1.5.0|name=e1pfd}}
|Control
|-
|83
|TexturePatternAsset
| -
| -
|-
|84
|TimeSelector
| -
| -
|-
|85
|TiredBlender
| -
| -
|-
|86
|TiredSelector
| -
| -
|-
|87
|UseItemSelector
| -
| -
|-
|88
|UserAngle2Blender
| -
| -
|-
|89
|UserAngle2Selector
| -
| -
|-
|90
|UserAngleBlender
| -
| -
|-
|91
|UserAngleSelector
| -
| -
|-
|92
|UserSpeedBlender
| -
| -
|-
|93
|UserSpeedSelector
| -
| -
|-
|94
|VariationSelector
| -
| -
|-
|95
|WallAngleBlender
| -
| -
|-
|96
|WallAngleSelector
| -
| -
|-
|97
|WeaponDetailSelector
|Compares actor's equipped weapon subtype (from its bgparamlist [ProfileUser] WeaponSubtype value), takes StrRef of weapon subtype name
|Control
|-
|98
|WeaponSelector
|Compares actor's equipped weapon profile (from its bxml ProfileUser value), takes StrRef of weapon profile name
|Control
|-
|99
|WeatherSelector
| -
| -
|-
|100
|WeightBlender
| -
| -
|-
|101
|WeightSelector
| -
| -
|-
|102
|WindVelocityBlender
| -
| -
|-
|103
|YSpeedBlender
| -
| -
|-
|104
|YSpeedSelector
| -
| -
|-
|105
|ZEx00ExposureBlender
| -
| -
|-
|106
|ZEx00ExposureSelector
| -
| -
|-
|}


===Children===
== TriggerParams ==
Control nodes will have Children, in addition to Parameters, which determine which Element to go to after the control node is evaluated. The properties of Children will be named Child0, Child1, etc, and each will have a single integer value, which will correspond to the Element number. e.g. <code>Child0: 7</code> points to Element7.
There are at least two sets of TriggerParams at all times and up to four (param1, param, ???, GimmickResetBuffer). The exact purpose of each TriggerParam is currently unknown.


===Extend===
After all GameData flag info has been loaded into this->triggerParam from the GameData archive ([[gamedata.sarc]]), another TriggerParam instance called param1 (this->triggerParam1) is constructed and data is copied from this->triggerParam. The copy function also builds the lists of flags that need to be reset (with a non-zero ResetType) and of boolean flags with (initialValue >> 1) != 0.
All nodes have an Extend, which contains specific details about the node. Control node Extends will contain details about the comparison being performed, while animation nodes will contain information about the animation being played, such as: during which frames of the animation a weapon will deal damage if it hits something, when user input is ignored, when to draw weapon trails through the air for attack animations, etc.


====Typed Array====
== Flags ==
A list of variables of a given type to use for various control comparisons. Corresponds directly to the Children of the node. i.e. if Value0 matches the value being compared against, the code will jump to the Element listed under Child0. If no comparison of a lower Child number has evaluated as true, automatically evaluates a Child whose value is "default" as true.{{#tag:ref|Element0 of Player_CutNinja.bas, WiiU 1.5.0|name=e0pcn}}{{#tag:ref|Element3 of Player_FaceDefault.bas, WiiU 1.5.0|name=e3pfd}}


====BitIndex====
== GameDataMgr::Flags ==
Used with BoolSelector Parameters. Also has TypeIndex, which are used to perform the check.
Stored at GameDataMgr+0xC18 on Switch 1.5.0. Most flags are still poorly understood.


*2 - Unknown (believed to check if Link has any armor equipped)<ref name="e0pfd" />
Flags are checked in the main update function (GameDataMgr::calc). Some flags are used to request actions such as resetting all flags to their initial value; these are automatically unset after GameDataMgr has processed the request.
*30 - Whether or not Link has a shield equipped.<ref name="e1pcn" />
*33 - Unknown<ref name="e2pfd" />
*37 - Whether IsBlunt is set to true in the equipped weapon’s bgparamlist
*46 - Unknown (believed to check if Link is crouched)


====Ranges====
<source lang="c++">
Used with control nodes that perform a Range evaluation. If the value being compared is above the Start value and below the End value, evaluates as true. Otherwise, moves on to the next value. (Unknown what happens if none of the Ranges evaluate to true, presumably game crash)
enum GameDataMgr::Flags
{
  GameDataMgr::Flags_1 = 0x1,
  GameDataMgr::Flags_2 = 0x2,
  /// Causes GameDataMgr to call TriggerParam::resetToInitialValues(this->triggerParam1),
  /// clear some values of this->triggerParam and invoke reset callbacks
  GameDataMgr::Flags_NeedResetAllToInitial = 0x4,
  /// Causes GameDataMgr to call TriggerParam::reset(this->triggerParam1) (see below)
  GameDataMgr::Flags_NeedReset = 0x8,
  /// [Debug only] Creates a TriggerParam instance called "GimmickResetBuffer" (if needed)
  /// and copies data from param1.
  /// A pointer to the instance is stored in GameDataMgr.
  GameDataMgr::Flags_NeedGimmickReset = 0x10,
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 0, 0).
  GameDataMgr::Flags_NeedCopyGimmickParam = 0x20,
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 1, 0).
  GameDataMgr::Flags_40 = 0x40,
  GameDataMgr::Flags_80 = 0x80,
  GameDataMgr::Flags_100 = 0x100,
  GameDataMgr::Flags_200 = 0x200,
  GameDataMgr::Flags_400 = 0x400,
  /// Set from flag setter functions. The name is based on the fact that IsChangedByDebug gets set at the same time.
  GameDataMgr::Flags_IsChangedByDebugMaybe = 0x800,
  GameDataMgr::Flags_1000 = 0x1000,
  GameDataMgr::Flags_2000 = 0x2000,
  GameDataMgr::Flags_4000 = 0x4000,
  GameDataMgr::Flags_ChangeOnlyOnceMode = 0x8000,
  GameDataMgr::Flags_10000 = 0x10000,
  GameDataMgr::Flags_20000 = 0x20000,
  /// If set, GameDataMgr::calc will skip copying param1 to param (args: 0, 0, 0)
  GameDataMgr::Flags_DisableParam1ToParamSync = 0x40000,
  GameDataMgr::Flags_IsRestartFromGameOverMaybe = 0x80000,
  GameDataMgr::Flags_DoNotResetToInitialFromRadarMgr = 0x100000,
};
</source>


====FrameCtrl====
== Reset flags ==
Used with animation nodes. The node itself is required, even if it is empty (i.e. none of the keys are specified)
Stored at GameDataMgr+0xC1C on Switch 1.5.0.
{| class="wikitable"
{|class="wikitable"
!Key
! Flag !! Description
!Type
!Description
!Default value
|-
|Rate
|float
|Speed at which to play the animation. Higher numbers are faster.
|1.0
|-
|EndFrame
|int
| -
| -
|-
|-
|}
| 1 || ?
 
====TriggerEvents====
Used with Parameter TypeIndex 67. Possibly used with other animation node TypeIndexes, but none have so far been observed. Events which are triggered during this animation.
{| class="wikitable"
!Key
!Type
!Description
!Default value
|-
|-
|TypeIndex
| 2 || Corresponds to reset type 1.
|int
|Which type of event to fire. Known events are detailed below
| -
|-
|-
|Frame
| 4 || Corresponds to reset type 2.
|int
|Which frame to fire the event on, relative to the frame numbers of the animation. Can be negative.
| -
|-
|-
|Value
| 8 || Corresponds to reset type 3.
|strRef
| -
| -
|-
|-
| 0x10 || Corresponds to reset type 4.
|}
|}
Known TypeIndex values:


*0 - Unknown (believed to define when an attack begins to deal damage)<ref>Compare Event0 of TriggerEvents and Event0 of HoldEvents for most of Link's attack animations</ref>
== Reset process ==
*4 - Triggers the animation controller to transition back into the idle stance. The Frame value should be a few before the end of the actual animation, so that the controller can make the blending look natural.<ref>Compare TriggerEvent TypeIndex 4 Frame value for an animation with the number of frames in the actual animation.</ref>
All game data flags for which <code>(1 << resetType) & resetFlags</code> is true are reset to their initial values.
*7 - Call AS. Passes the strRef to the ASList to retrieve an AS file and starts evaluating it from Element0.
 
*28 - Play audio. Only observed with PV%03d as the value, which corresponds to bfwav files in PlayerVoice.bars, but is believed to be able to play other audio files as well.
TriggerParam::reset processes up to 1024 flags at a time. The function returns the number of remaining flags to reset and flag 0x08 (GameDataMgr::Flags_NeedReset) is only cleared when all flags have been reset.


====HoldEvents====
=== bool and s32 flags with reset type 3 ===
Used with Parameter TypeIndex 67. Possibly used with other animation node TypeIndexes, but none have so far been observed. States that are entered into while the animation is playing.
bool and s32 flags with reset type 3, and with a flag name hash that is listed in ShopAreaInfo (in [[ShopGameDataInfo.byml]]) receive special treatment.
{| class="wikitable"
!Key
!Type
!Description
!Default value
|-
|TypeIndex
|int
|Which type of event to fire. Known events are detailed below
| -
|-
|StartFrame
|int
|Which frame to start the event on, relative to the frame numbers of the animation. Unknown if it can be negative.
| -
|-
|EndFrame
|int
|Which frame to end the event on, relative to the frame numbers of the animation. A value of -1 is treated as the ending frame of the animation.
| -
|-
|Value
|strRef
| -
| -
|-
|}
Known TypeIndex values:


*0 - Unknown
If:
*2 - Unknown
* the player is in none of the shop areas that are associated with the flag (or in the Dealer's area for area-less flags); or if the player is not on MainField
*3 - Defines when an attack will deal damage. Value is the damage type. Left: slashing. Stab: piercing. Lower: blunt. {{Check}}
* '''and''', for items with the <code>Arrow</code> tag: if the player has fewer than {itemSaleRevivalCount} arrows in their inventory
*17 - Unknown
Then:
*25 - Unknown
* The flag is reset to its initial value.
*45 - Defines when to accept input to start the next attack.
* For bool flags: All associated sold out flags are reset to their initial values.
*48 - Defines when to display the trails in the air during an attack.


===References===
[[Category: Internals]]
[[Category:File extensions]]
[[Category: Subsystems (BotW)]]
[[Category:File extensions (AAMP)]]
[[Category:Actor parameter files]]
<references />

Revision as of 09:47, 31 December 2018

GameDataMgr
Subsystem
Official name Yes
Description Manages game data flags
Init function Switch 1.5.0: 0000007100DCE964
Wii U 1.5.0: ???
Debug only No


GameDataMgr holds the date of all game data flags and provides functions to get, set and reset them. It is also responsible for keeping track of "shop sold out" flags and resetting them regularly.

Flag data is loaded from bgdata files and stored in TriggerParam objects. Transferring data from and to save files is done by interacting with the SaveSystem and SaveMgr subsystems.

In debug versions, GameDataMgr is able to sync save data from and to a computer.

TriggerParams

There are at least two sets of TriggerParams at all times and up to four (param1, param, ???, GimmickResetBuffer). The exact purpose of each TriggerParam is currently unknown.

After all GameData flag info has been loaded into this->triggerParam from the GameData archive (gamedata.sarc), another TriggerParam instance called param1 (this->triggerParam1) is constructed and data is copied from this->triggerParam. The copy function also builds the lists of flags that need to be reset (with a non-zero ResetType) and of boolean flags with (initialValue >> 1) != 0.

Flags

GameDataMgr::Flags

Stored at GameDataMgr+0xC18 on Switch 1.5.0. Most flags are still poorly understood.

Flags are checked in the main update function (GameDataMgr::calc). Some flags are used to request actions such as resetting all flags to their initial value; these are automatically unset after GameDataMgr has processed the request.

enum GameDataMgr::Flags
{
  GameDataMgr::Flags_1 = 0x1,
  GameDataMgr::Flags_2 = 0x2,
  /// Causes GameDataMgr to call TriggerParam::resetToInitialValues(this->triggerParam1),
  /// clear some values of this->triggerParam and invoke reset callbacks
  GameDataMgr::Flags_NeedResetAllToInitial = 0x4,
  /// Causes GameDataMgr to call TriggerParam::reset(this->triggerParam1) (see below)
  GameDataMgr::Flags_NeedReset = 0x8,
  /// [Debug only] Creates a TriggerParam instance called "GimmickResetBuffer" (if needed)
  /// and copies data from param1.
  /// A pointer to the instance is stored in GameDataMgr.
  GameDataMgr::Flags_NeedGimmickReset = 0x10,
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 0, 0).
  GameDataMgr::Flags_NeedCopyGimmickParam = 0x20,
  /// If this->gimmickResetBufferParam is non-null, copy it to triggerParam and to triggerParam1 (args: 1, 1, 0).
  GameDataMgr::Flags_40 = 0x40,
  GameDataMgr::Flags_80 = 0x80,
  GameDataMgr::Flags_100 = 0x100,
  GameDataMgr::Flags_200 = 0x200,
  GameDataMgr::Flags_400 = 0x400,
  /// Set from flag setter functions. The name is based on the fact that IsChangedByDebug gets set at the same time.
  GameDataMgr::Flags_IsChangedByDebugMaybe = 0x800,
  GameDataMgr::Flags_1000 = 0x1000,
  GameDataMgr::Flags_2000 = 0x2000,
  GameDataMgr::Flags_4000 = 0x4000,
  GameDataMgr::Flags_ChangeOnlyOnceMode = 0x8000,
  GameDataMgr::Flags_10000 = 0x10000,
  GameDataMgr::Flags_20000 = 0x20000,
  /// If set, GameDataMgr::calc will skip copying param1 to param (args: 0, 0, 0)
  GameDataMgr::Flags_DisableParam1ToParamSync = 0x40000,
  GameDataMgr::Flags_IsRestartFromGameOverMaybe = 0x80000,
  GameDataMgr::Flags_DoNotResetToInitialFromRadarMgr = 0x100000,
};

Reset flags

Stored at GameDataMgr+0xC1C on Switch 1.5.0.

Flag Description
1 ?
2 Corresponds to reset type 1.
4 Corresponds to reset type 2.
8 Corresponds to reset type 3.
0x10 Corresponds to reset type 4.

Reset process

All game data flags for which (1 << resetType) & resetFlags is true are reset to their initial values.

TriggerParam::reset processes up to 1024 flags at a time. The function returns the number of remaining flags to reset and flag 0x08 (GameDataMgr::Flags_NeedReset) is only cleared when all flags have been reset.

bool and s32 flags with reset type 3

bool and s32 flags with reset type 3, and with a flag name hash that is listed in ShopAreaInfo (in ShopGameDataInfo.byml) receive special treatment.

If:

  • the player is in none of the shop areas that are associated with the flag (or in the Dealer's area for area-less flags); or if the player is not on MainField
  • and, for items with the Arrow tag: if the player has fewer than {itemSaleRevivalCount} arrows in their inventory

Then:

  • The flag is reset to its initial value.
  • For bool flags: All associated sold out flags are reset to their initial values.