Bgdata: Difference between revisions

Jump to navigation Jump to search
1,058 bytes added ,  3 years ago
→‎Contents: Revival bool flag init value
imported>Leoetlino
(Created page with "{{lowercase}} '''bgdata''' (binary game data) files are BYMLs containing lists of GameData flags. They are stored in gamedata.sarc and loaded by GameDataMgr. bgda...")
 
(→‎Contents: Revival bool flag init value)
 
(7 intermediate revisions by 2 users not shown)
Line 4: Line 4:
bgdata files are most likely machine generated.
bgdata files are most likely machine generated.
== Contents ==
== Contents ==
The root node is always a dictionary that contains at least one of the following keys:
The root node is always a dictionary that contains one of the following keys:
* bool_data
* bool_data
* s32_data
* s32_data
Line 24: Line 24:
* vector4_array_data
* vector4_array_data


The value for each of these keys is a dictionary:
The value for each of these keys is an array of dictionaries:
{|class="wikitable"
{|class="wikitable"
! Key !! Type !! Description
! Key !! Type !! Description
|-
|-
| Category || int || [Optional, present for some flags] Category{{check}}
| Category || int || [Optional, present for some flags] Category{{check}} (only present for boolean flags)
|-
|-
| DataName || str || Flag name (unused in release builds; only written for debug purposes)
| DataName || str || Flag name (unused in release builds; only written for debug purposes)
Line 43: Line 43:
   - Values: [0, 0, 0, 0, 0, 0, 0]
   - Values: [0, 0, 0, 0, 0, 0, 0]
</source>
</source>
Revival bool flags for objects under the RevivalRandom policy have the position of the object on the main map stored in the upper 7 bits of the initial flag value.
|-
|-
| IsEventAssociated || bool || Is associated with an event{{check}}
| IsEventAssociated || bool || Is associated with an event. If set, GameDataMgr will set the "need gimmick reset" flag (which is ignored in release builds?{{check}}) after any update. Ignored for non-boolean flags{{check}}
|-
|-
| IsOneTrigger || bool || ?{{check}}
| IsOneTrigger || bool || Whether the flag can only be updated once. More specifically: If true, TriggerParam will not allow updates to the flag if its value is different from the initial value. Also called "change only once" mode ("一度しか変更しない").
|-
|-
| IsProgramReadable || bool || Whether the flag can be read by the game
| IsProgramReadable || bool || Whether the flag can be read by the game
Line 66: Line 68:


For vector types (vec2, vec3, vec4), a value is stored as an array which further contains an array of values (e.g. <code>[ [-1.0, 0.0] ]</code> for a vec2).
For vector types (vec2, vec3, vec4), a value is stored as an array which further contains an array of values (e.g. <code>[ [-1.0, 0.0] ]</code> for a vec2).
If any key is found, the game will stop parsing the rest of the file.
Note: some of the read/write restrictions (IsOneTrigger, IsProgramReadable, IsProgramWritable) are bypassed whenever the "force" argument in read/write TriggerParam functions is true. Some functions enable or disable permission checks explicitly; others follow GameDataMgr's global configuration, which has two sets of TriggerParam parameters. [[AIDef:Action/EventFlagONAction]] always bypasses checks.


== Examples ==
== Examples ==
autopatrol, editnews
164

edits

Navigation menu