Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

totk files have dictionary / variables #4

Open
savage13 opened this issue Sep 25, 2023 · 2 comments
Open

totk files have dictionary / variables #4

savage13 opened this issue Sep 25, 2023 · 2 comments

Comments

@savage13
Copy link

Some (approx. 8) appear to have non-zero values in the Entry Point at

  • 0x08 Dictionary*
  • 0x10 VariableDef*

Dictionary is easily parsed by using DicReader

VariableDef does not appear to have a reader.

Working on a solution

Files that fail to parse:

  • DmF_SY_Camp.bfevfl
  • DmF_SY_SleepBed.bfevfl
  • DmF_SY_SleepHotel.110.bfevfl
  • DmF_SY_SleepHotel.bfevfl
  • EightHeroStatues_After.bfevfl
  • GerudoGreeting.bfevfl
  • Gerudo_UrbosaWeapon.bfevfl
  • GiantHorse.bfevfl
@savage13
Copy link
Author

I think I unpacked these properly

struct Variable {
    union {
         s32 val_s32, 
         float val_f32
    } value;
    u32 x8;    // padding - always 0
    u16 num;   // always 1
    u16 type;  // 2: s32, 4: float (looks like Container Data Types)
    u32 xe;    // padding - always 0
}
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
05 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour           5 s32     Morning
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     Morning
0c 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          12 s32     Noon
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     Noon
15 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          21 s32     Night
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     Night
DmF_SY_SleepBed.bfevfl
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
0c 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          12 s32     Noon
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     Noon
05 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour           5 s32     Morning
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     Morning
15 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          21 s32     Night
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     Night
DmF_SY_SleepHotel.110.bfevfl
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
05 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour           5 s32     INN_Morning
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     INN_Morning
0c 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          12 s32     INN_Noon
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     INN_Noon
15 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          21 s32     INN_Night
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     INN_Night
... clip ...
DmF_SY_SleepHotel.bfevfl
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
05 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour           5 s32     INN_Morning
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     INN_Morning
0c 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          12 s32     INN_Noon
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     INN_Noon
15 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeHour          21 s32     INN_Night
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   TimeMin            0 s32     INN_Night
... clip ...
EightHeroStatues_After.bfevfl
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   BallNumFirst       1 s32     NpcOasis027_Reaction4
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   BallNumFirst       1 s32     NpcOasis027_Reaction5
02 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   BallNumFirst       2 s32     NpcOasis027_Reaction7
02 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   BallNumFirst       2 s32     NpcOasis027_Reaction8
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   BallNumFirst       1 s32     NpcOasis027_Reaction9
GerudoGreeting.bfevfl
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
04 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Arg_Turn           4 s32     InitTalk_GerudoGreeting
02 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Arg_Turn           2 s32     InitTalk_GerudoGreeting_TurnDontFace
Gerudo_UrbosaWeapon.bfevfl
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
04 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   DiamondNum         4 s32     SUB_CheckHaveMaterial
0a 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   FlintNum          10 s32     SUB_CheckHaveMaterial
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Shield             1 s32     SUB_CheckHaveMaterial
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Sword              1 s32     SUB_CheckHaveMaterial
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   DiamondNum         1 s32     SUB_CheckHaveMaterial_Shield
05 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   FlintNum           5 s32     SUB_CheckHaveMaterial_Shield
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Shield             1 s32     SUB_CheckHaveMaterial_Shield
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Sword              0 s32     SUB_CheckHaveMaterial_Shield
03 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   DiamondNum         3 s32     SUB_CheckHaveMaterial_Sword
05 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   FlintNum           5 s32     SUB_CheckHaveMaterial_Sword
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Shield             0 s32     SUB_CheckHaveMaterial_Sword
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Sword              1 s32     SUB_CheckHaveMaterial_Sword
fc ff ff ff   00 00 00 00   01 00 02 00   00 00 00 00   DiamondNum        -4 s32     SUB_DeleteMaterial
f6 ff ff ff   00 00 00 00   01 00 02 00   00 00 00 00   FlintNum         -10 s32     SUB_DeleteMaterial
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Shield             1 s32     SUB_DeleteMaterial
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Sword              1 s32     SUB_DeleteMaterial
ff ff ff ff   00 00 00 00   01 00 02 00   00 00 00 00   DiamondNum        -1 s32     SUB_DeleteMaterial_Shield
fb ff ff ff   00 00 00 00   01 00 02 00   00 00 00 00   FlintNum          -5 s32     SUB_DeleteMaterial_Shield
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Shield             1 s32     SUB_DeleteMaterial_Shield
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Sword              0 s32     SUB_DeleteMaterial_Shield
fd ff ff ff   00 00 00 00   01 00 02 00   00 00 00 00   DiamondNum        -3 s32     SUB_DeleteMaterial_Sword
fb ff ff ff   00 00 00 00   01 00 02 00   00 00 00 00   FlintNum          -5 s32     SUB_DeleteMaterial_Sword
00 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Shield             0 s32     SUB_DeleteMaterial_Sword
01 00 00 00   00 00 00 00   01 00 02 00   00 00 00 00   Sword              1 s32     SUB_DeleteMaterial_Sword
GiantHorse.bfevfl
value        | padding   |  num  |type |  padding      |  variable | value | kind  | name  
00 00 20 41   00 00 00 00   01 00 04 00   00 00 00 00   NearDist        10.0 f32     Sub_RetFindHorse_GiantHorse

@leoetlino
Copy link
Member

Is this what you're looking for?

https://github.com/open-ead/EventFlow/blob/556793186c3065e7b25a51247d0560d7ff401b81/include/evfl/ResFlowchart.h#L71-L83

That mostly matches your struct but yours is missing int arrays and float arrays (and 0x8 is part of the union, not padding).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants