Skip to content

Commit

Permalink
Update for .trackedridecar
Browse files Browse the repository at this point in the history
  • Loading branch information
ilodev committed Dec 4, 2024
1 parent 2a0768f commit 9ccabf5
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 109 deletions.
35 changes: 35 additions & 0 deletions generated/formats/trackedridecar/compounds/Row.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from generated.formats.ovl_base.compounds.MemStruct import MemStruct
from generated.formats.trackedridecar.imports import name_type_map


class Row(MemStruct):

__name__ = 'Row'


def __init__(self, context, arg=0, template=None, set_default=True):
super().__init__(context, arg, template, set_default=False)

# Offset of the row to create station gates
self.offset = name_type_map['Float'](self.context, 0, None)
self.u_0 = name_type_map['Uint'].from_value(0)
self.seats_count = name_type_map['Uint64'](self.context, 0, None)
self.seats = name_type_map['ArrayPointer'](self.context, self.seats_count, name_type_map['Seat'])
if set_default:
self.set_defaults()

@classmethod
def _get_attribute_list(cls):
yield from super()._get_attribute_list()
yield 'offset', name_type_map['Float'], (0, None), (False, None), (None, None)
yield 'u_0', name_type_map['Uint'], (0, None), (True, 0), (None, None)
yield 'seats', name_type_map['ArrayPointer'], (None, name_type_map['Seat']), (False, None), (None, None)
yield 'seats_count', name_type_map['Uint64'], (0, None), (False, None), (None, None)

@classmethod
def _get_filtered_attribute_list(cls, instance, include_abstract=True):
yield from super()._get_filtered_attribute_list(instance, include_abstract)
yield 'offset', name_type_map['Float'], (0, None), (False, None)
yield 'u_0', name_type_map['Uint'], (0, None), (True, 0)
yield 'seats', name_type_map['ArrayPointer'], (instance.seats_count, name_type_map['Seat']), (False, None)
yield 'seats_count', name_type_map['Uint64'], (0, None), (False, None)
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@
from generated.formats.trackedridecar.imports import name_type_map


class Vector3(MemStruct):
class Seat(MemStruct):

"""
12 bytes
"""

__name__ = 'Vector3'
__name__ = 'Seat'


def __init__(self, context, arg=0, template=None, set_default=True):
super().__init__(context, arg, template, set_default=False)
self.floats = Array(self.context, 0, None, (0,), name_type_map['Float'])
self.position = Array(self.context, 0, None, (0,), name_type_map['Float'])
if set_default:
self.set_defaults()

@classmethod
def _get_attribute_list(cls):
yield from super()._get_attribute_list()
yield 'floats', Array, (0, None, (3,), name_type_map['Float']), (False, None), (None, None)
yield 'position', Array, (0, None, (3,), name_type_map['Float']), (False, None), (None, None)

@classmethod
def _get_filtered_attribute_list(cls, instance, include_abstract=True):
yield from super()._get_filtered_attribute_list(instance, include_abstract)
yield 'floats', Array, (0, None, (3,), name_type_map['Float']), (False, None)
yield 'position', Array, (0, None, (3,), name_type_map['Float']), (False, None)
52 changes: 27 additions & 25 deletions generated/formats/trackedridecar/compounds/TrackedRideCarRoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,45 @@

class TrackedRideCarRoot(MemStruct):

"""
48 bytes
"""

__name__ = 'TrackedRideCarRoot'


def __init__(self, context, arg=0, template=None, set_default=True):
super().__init__(context, arg, template, set_default=False)
self.tracked_ride_car_sub_count = name_type_map['Uint'](self.context, 0, None)
self.total_vecs_count = name_type_map['Uint'](self.context, 0, None)
self.vec = Array(self.context, 0, None, (0,), name_type_map['Float'])
self.zero_0 = name_type_map['Uint'](self.context, 0, None)
self.zero_1 = name_type_map['Uint64'](self.context, 0, None)
self.sub = name_type_map['ArrayPointer'](self.context, self.tracked_ride_car_sub_count, name_type_map['TrackedRideCarSub'])
self.hitcheck_name = name_type_map['Pointer'](self.context, 0, name_type_map['ZString'])

# Numer of seats rows
self.seat_rows_count = name_type_map['Uint'](self.context, 0, None)

# Total number of seats in this car
self.total_seats_count = name_type_map['Uint'](self.context, 0, None)

# Size of different fence elements
self.sizes = Array(self.context, 0, None, (0,), name_type_map['Float'])
self.zero_0 = name_type_map['Uint'].from_value(0)
self.zero_1 = name_type_map['Uint64'].from_value(0)
self.seat_rows = name_type_map['ArrayPointer'](self.context, self.seat_rows_count, name_type_map['Row'])
self.hitcheck_model_name = name_type_map['Pointer'](self.context, 0, name_type_map['ZString'])
if set_default:
self.set_defaults()

@classmethod
def _get_attribute_list(cls):
yield from super()._get_attribute_list()
yield 'sub', name_type_map['ArrayPointer'], (None, name_type_map['TrackedRideCarSub']), (False, None), (None, None)
yield 'tracked_ride_car_sub_count', name_type_map['Uint'], (0, None), (False, None), (None, None)
yield 'total_vecs_count', name_type_map['Uint'], (0, None), (False, None), (None, None)
yield 'vec', Array, (0, None, (3,), name_type_map['Float']), (False, None), (None, None)
yield 'zero_0', name_type_map['Uint'], (0, None), (False, None), (None, None)
yield 'hitcheck_name', name_type_map['Pointer'], (0, name_type_map['ZString']), (False, None), (None, None)
yield 'zero_1', name_type_map['Uint64'], (0, None), (False, None), (None, None)
yield 'seat_rows', name_type_map['ArrayPointer'], (None, name_type_map['Row']), (False, None), (None, None)
yield 'seat_rows_count', name_type_map['Uint'], (0, None), (False, None), (None, None)
yield 'total_seats_count', name_type_map['Uint'], (0, None), (False, None), (None, None)
yield 'sizes', Array, (0, None, (3,), name_type_map['Float']), (False, None), (None, None)
yield 'zero_0', name_type_map['Uint'], (0, None), (True, 0), (None, None)
yield 'hitcheck_model_name', name_type_map['Pointer'], (0, name_type_map['ZString']), (False, None), (None, None)
yield 'zero_1', name_type_map['Uint64'], (0, None), (True, 0), (None, None)

@classmethod
def _get_filtered_attribute_list(cls, instance, include_abstract=True):
yield from super()._get_filtered_attribute_list(instance, include_abstract)
yield 'sub', name_type_map['ArrayPointer'], (instance.tracked_ride_car_sub_count, name_type_map['TrackedRideCarSub']), (False, None)
yield 'tracked_ride_car_sub_count', name_type_map['Uint'], (0, None), (False, None)
yield 'total_vecs_count', name_type_map['Uint'], (0, None), (False, None)
yield 'vec', Array, (0, None, (3,), name_type_map['Float']), (False, None)
yield 'zero_0', name_type_map['Uint'], (0, None), (False, None)
yield 'hitcheck_name', name_type_map['Pointer'], (0, name_type_map['ZString']), (False, None)
yield 'zero_1', name_type_map['Uint64'], (0, None), (False, None)
yield 'seat_rows', name_type_map['ArrayPointer'], (instance.seat_rows_count, name_type_map['Row']), (False, None)
yield 'seat_rows_count', name_type_map['Uint'], (0, None), (False, None)
yield 'total_seats_count', name_type_map['Uint'], (0, None), (False, None)
yield 'sizes', Array, (0, None, (3,), name_type_map['Float']), (False, None)
yield 'zero_0', name_type_map['Uint'], (0, None), (True, 0)
yield 'hitcheck_model_name', name_type_map['Pointer'], (0, name_type_map['ZString']), (False, None)
yield 'zero_1', name_type_map['Uint64'], (0, None), (True, 0)
37 changes: 0 additions & 37 deletions generated/formats/trackedridecar/compounds/TrackedRideCarSub.py

This file was deleted.

5 changes: 3 additions & 2 deletions generated/formats/trackedridecar/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'PadAlign': 'generated.formats.base.compounds.PadAlign',
'FixedString': 'generated.formats.base.compounds.FixedString',
'Vector2': 'generated.formats.base.compounds.Vector2',
'Vector3': 'generated.formats.trackedridecar.compounds.Vector3',
'Vector3': 'generated.formats.base.compounds.Vector3',
'Vector3Half': 'generated.formats.base.compounds.Vector3Half',
'Vector4': 'generated.formats.base.compounds.Vector4',
'Bool': 'generated.formats.ovl_base.basic',
Expand All @@ -42,7 +42,8 @@
'Empty': 'generated.formats.ovl_base.compounds.Empty',
'ZStringList': 'generated.formats.ovl_base.compounds.ZStringList',
'TrackedRideCarRoot': 'generated.formats.trackedridecar.compounds.TrackedRideCarRoot',
'TrackedRideCarSub': 'generated.formats.trackedridecar.compounds.TrackedRideCarSub',
'Row': 'generated.formats.trackedridecar.compounds.Row',
'Seat': 'generated.formats.trackedridecar.compounds.Seat',
}

name_type_map = {}
Expand Down
35 changes: 17 additions & 18 deletions generated/formats/trackedridecar/trackedridecar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@
<xi:include href="../ovl_base/ovl_base.xml" xmlns:xi="http://www.w3.org/2001/XInclude" xpointer="xpointer(*/*)" />

<compound name="TrackedRideCarRoot" inherit="MemStruct">
48 bytes
<add name="sub" type="ArrayPointer" template="TrackedRideCarSub" arg="TrackedRideCarSub_count"/>
<add name="TrackedRideCarSub_count" type="uint" />
<add name="total_vecs_count" type="uint" /> probably total of all sub count1
<add name="vec" type="float" arr1="3" />
<add name="zero0" type="uint" />
<add name="Hitcheck_name" type="Pointer" template="ZString"/>
<add name="zero1" type="uint64" />
<!-- 48 bytes consistent through all games -->
<add name="Seat Rows" type="ArrayPointer" template="Row" arg="Seat Rows Count"/>
<add name="Seat Rows Count" type="uint">Numer of seats rows</add>
<add name="Total Seats Count" type="uint">Total number of seats in this car</add>
<add name="Sizes" type="float" arr1="3">Size of different fence elements</add>
<add name="zero0" type="uint" default="0" optional="true"/>
<add name="Hitcheck Model Name" type="Pointer" template="ZString"/>
<add name="zero1" type="uint64" default="0" optional="true"/>
</compound>

<compound name="TrackedRideCarSub" inherit="MemStruct">
32 bytes
<add name="float" type="float" />
<add name="u0" type="uint" />
<add name="vectors" type="ArrayPointer" template="Vector3" arg="vecs_count"/>
<add name="vecs_count" type="uint64" />
<!--<add name="zero1" type="uint64" /> -->
<compound name="Row" inherit="MemStruct">
<!-- 32 bytes consistent through all games -->
<add name="Offset" type="float">Offset of the row to create station gates</add>
<add name="u0" type="uint" default="0" optional="true"/> <!-- always found to be 0 -->
<add name="Seats" type="ArrayPointer" template="Seat" arg="Seats Count"/>
<add name="Seats Count" type="uint64" />
</compound>

<compound name="Vector3" inherit="MemStruct">
12 bytes
<add name="floats" type="float" arr1="3" />
<compound name="Seat" inherit="MemStruct">
<!-- 12 bytes consistent through all games -->
<add name="Position" type="float" arr1="3" />
</compound>

</niftoolsxml>
35 changes: 17 additions & 18 deletions source/formats/trackedridecar/trackedridecar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@
<xi:include href="../ovl_base/ovl_base.xml" xmlns:xi="http://www.w3.org/2001/XInclude" xpointer="xpointer(*/*)" />

<compound name="TrackedRideCarRoot" inherit="MemStruct">
48 bytes
<add name="sub" type="ArrayPointer" template="TrackedRideCarSub" arg="TrackedRideCarSub_count"/>
<add name="TrackedRideCarSub_count" type="uint" />
<add name="total_vecs_count" type="uint" /> probably total of all sub count1
<add name="vec" type="float" arr1="3" />
<add name="zero0" type="uint" />
<add name="Hitcheck_name" type="Pointer" template="ZString"/>
<add name="zero1" type="uint64" />
<!-- 48 bytes consistent through all games -->
<add name="Seat Rows" type="ArrayPointer" template="Row" arg="Seat Rows Count"/>
<add name="Seat Rows Count" type="uint">Numer of seats rows</add>
<add name="Total Seats Count" type="uint">Total number of seats in this car</add>
<add name="Sizes" type="float" arr1="3">Size of different fence elements</add>
<add name="zero0" type="uint" default="0" optional="true"/>
<add name="Hitcheck Model Name" type="Pointer" template="ZString"/>
<add name="zero1" type="uint64" default="0" optional="true"/>
</compound>

<compound name="TrackedRideCarSub" inherit="MemStruct">
32 bytes
<add name="float" type="float" />
<add name="u0" type="uint" />
<add name="vectors" type="ArrayPointer" template="Vector3" arg="vecs_count"/>
<add name="vecs_count" type="uint64" />
<!--<add name="zero1" type="uint64" /> -->
<compound name="Row" inherit="MemStruct">
<!-- 32 bytes consistent through all games -->
<add name="Offset" type="float">Offset of the row to create station gates</add>
<add name="u0" type="uint" default="0" optional="true"/> <!-- always found to be 0 -->
<add name="Seats" type="ArrayPointer" template="Seat" arg="Seats Count"/>
<add name="Seats Count" type="uint64" />
</compound>

<compound name="Vector3" inherit="MemStruct">
12 bytes
<add name="floats" type="float" arr1="3" />
<compound name="Seat" inherit="MemStruct">
<!-- 12 bytes consistent through all games -->
<add name="Position" type="float" arr1="3" />
</compound>

</niftoolsxml>

0 comments on commit 9ccabf5

Please sign in to comment.