GameDataMgr: Difference between revisions

imported>Leoetlino
imported>Leoetlino
 
(7 intermediate revisions by the same user not shown)
Line 12: Line 12:


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.
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.
* Changes to GameData are (usually) made to param1. A flag allows all param1 changes to be automatically propagated to param, but it appears to be unset under normal operation.
* Under some cases, SaveMgr triggers copies from param to param1.
* GameDataMgr::calc copies param1 to param unless a flag is set.


== Flags ==
== Flags ==
Line 59: Line 63:
== Reset flags ==
== Reset flags ==
Stored at GameDataMgr+0xC1C on Switch 1.5.0.
Stored at GameDataMgr+0xC1C on Switch 1.5.0.
<source lang="c++">
{|class="wikitable"
enum GameDataMgr::ResetFlags
! Flag !! ResetType !! Description
{
|-
  GameDataMgr::ResetFlags_1 = 0x1,
| 1 || 0 || No reset{{check}}
  /// Corresponds to ResetType 1.
|-
  GameDataMgr::ResetFlags_2 = 0x2,
| 2 || 1 || Corresponds to reset type 1: reset on blood moon
  /// Corresponds to ResetType 2.
 
  GameDataMgr::ResetFlags_4 = 0x4,
Set from [[SaveSystem]] code (under specific cases when a save is being loaded), or more commonly from [[AIDef:Action/EventOffWaitRevivalAction|action::EventOffWaitRevivalAction]] (whenever a Blood Moon happens)
  /// Corresponds to ResetType 3.
|-
  GameDataMgr::ResetFlags_8 = 0x8,
| 4 || 2 || Corresponds to reset type 2: reset on stage generation
  /// Corresponds to ResetType 4.
 
  GameDataMgr::ResetFlags_10 = 0x10,
Set when preparing for a stage generation.
};
|-
</source>
| 8 || 3 || Corresponds to reset type 3: reset every night at midnight
 
Set every day at midnight.
|-
| 0x10 || 4 || Corresponds to reset type 4: reset every time the Lord of the Mountain appears
 
Set by [[WorldMgr]] when it determines that the Lord of the Mountain should appear.
|}


== Reset process ==
== Reset process ==
Line 88: Line 99:
* The flag is reset to its initial value.
* The flag is reset to its initial value.
* For bool flags: All associated sold out flags are reset to their initial values.
* For bool flags: All associated sold out flags are reset to their initial values.
For more information on the area checks, see [[Object respawning]].


[[Category: Internals]]
[[Category: Internals]]
[[Category: Subsystems (BotW)]]
[[Category: Subsystems (BotW)]]
Anonymous user