Changes

Jump to navigation Jump to search
1,047 bytes added ,  19:34, 22 August 2022
→‎CGameCtnChallenge (03 043 000): add 0x040 item chunk TM2020 snapping documentation
Line 401: Line 401:  
''Note:'' This chunk has its own lookback string state (is encapsulated with CSystemArchiveEncapsuledChunk).
 
''Note:'' This chunk has its own lookback string state (is encapsulated with CSystemArchiveEncapsuledChunk).
   −
''Note:'' Version 5+ can have data that is based on the count of certain types of items in the item array. If you want to modify items in TM2020, you can come across issues when modifying the item array. This can be fixed by downgrading the version to 4. This downgrade shouldn't break anything, except maybe some new TM2020 features of items.
+
''Note:'' Version 5+ can have data that is based on the count of certain types of items in the item array. If you want to modify items in TM2020, you can come across issues when modifying the item array and it becomes rather difficult. This can be resolved by downgrading the version to 4. This downgrade should only affect item snapping - which is useful only when deleting items in the map editor.
    
''Note:'' Version 5+ was guessed by bruteforce, there's a chance something could be inaccurate.
 
''Note:'' Version 5+ was guessed by bruteforce, there's a chance something could be inaccurate.
 +
 +
* '''snappedBlocks''': ''Values'' are ''indexes'' of the Blocks array (chunk 0x01F). -1 = snapped to an item and you should use the index of snappedItems.
 +
* '''snappedItems''': ''Values'' are ''indexes'' of the AnchoredObjects array (this chunk). -1 = snapped to a block and you should use the index of snappedBlocks.
 +
* '''snapItemGroups''': Separates item "deletion groups" via a simple number. Usual values are between 0 and 5. You can index these with itemSnapIndexes values.
 +
* '''itemSnapIndexes''': Uses the values above to connect them with the item list. ''Values'' are ''indexes'' of '''snappedBlocks'''/'''snappedItems''' arrays. Any index of this array corresponds to the same AnchoredObjects index, '''except -1''', which means the item is not snapped.
    
  uint32 version
 
  uint32 version
Line 415: Line 420:  
     uint32 size
 
     uint32 size
 
     uint2[size] // 2 uint32 per element
 
     uint2[size] // 2 uint32 per element
     if version >= 5:
+
     if version >= 5: // TM2020
 
         if version < 6:
 
         if version < 6:
 
             uint32
 
             uint32
         uint32 size1
+
         uint32 snappedBlockCount
         uint32[size1]
+
         uint32 snappedBlocks[snappedBlockCount]
         uint32 size2
+
         uint32 snappedItemCount
         uint32[size2]
+
         uint32 snappedItems[snappedItemCount]
 
         if version >= 6:
 
         if version >= 6:
             uint32 size3
+
             uint32 snapItemGroupCount
             uint32[size3]
+
             uint32 snapItemGroups[snapItemGroupCount]
             uint32 size4
+
             uint32 size
             uint32[size4]
+
             uint32[size] // unknown atm
 
             if version >= 7:
 
             if version >= 7:
                 uint32 size5
+
                 uint32 itemSnapIndexCount // should be the same as the item count itself
                 uint32[size5]
+
                 uint32 itemSnapIndexes[itemSnapIndexCount]
    
'''03043044''' (skippable)
 
'''03043044''' (skippable)
33

edits

Navigation menu