def read_light_probe_v2(file): light_probe = LightProbe() light_probe.position = Point3D(float4(file), float4(file), float4(file)) light_probe.radius = float4(file) light_probe.is_primary = bool1(file) light_probe.height_mode = string(file) return light_probe
def read_river_node_v1(file): river_node = RiverNode() river_node.vertex = Point3D(float4(file), float4(file), float4(file)) river_node.width = float4(file) river_node.flow_speed = float4(file) #print(river_node.vertex.__dict__) return river_node
def read_otline(file): point_amount = int4(file) outline = Outline() outline.points = [] for i in range(point_amount): point = Point2D(float4(file), float4(file)) outline.points.append(point) return outline
def read_polygone(file): polygone = Polygone polygone.points_amount = int4(file) polygone.points = [] for i in range(polygone.points_amount): point = Point2D(float4(file), float4(file)) polygone.points.append(point) return polygone
def read_boundary(file): boundary = Boundary() boundary.type = string(file) positions = int4(file) boundary.positions = [] for i in range(positions): position = Point2D(float4(file), float4(file)) boundary.positions.append(position) return boundary
def read_bmd_catchment_area_list(file: BinaryIO): version = int2(file) # version amount = int4(file) for i in range(amount): bmd_catchment_area_version = int2(file) bmd_catchment_area_name = string(file) some_floats = (float4(file), float4(file), float4(file), float4(file)) file.read(10) # print(bmd_catchment_area_version, bmd_catchment_area_name, some_floats) # assert int4(file) == 0, "BMD_CATCHMENT_AREA_LIST has items"
def read_playable_area_v2(file): playable_area = PlayableArea() playable_area.min_x = float4(file) playable_area.min_y = float4(file) playable_area.max_x = float4(file) playable_area.max_y = float4(file) playable_area.flags = {} # dont know exact flags file.read(5) return playable_area
def read_polyline(file): polyline = PolyLine version = int2(file) polyline.type = string(file) points_amount = int4(file) polyline.points = [] for i in range(points_amount): point = Point2D(float4(file), float4(file)) polyline.points.append(point) return polyline
def read_zone_template(file): zone_template = ZoneTemplate() points_amount = int4(file) outline = Outline() for i in range(points_amount): outline.points.append(Point2D(float4(file), float4(file))) zone_template.outline = outline # <zone_name> <entity_formation_template name=''> and <lines/> file.read(8) # transformation matrix zone_template.transformation = read_transform_n_x_m(file, 4, 4) return zone_template
def read_terrain_stencil_triangle(file): terrain_stencil_triangle = TerrainStencilTriangle() terrain_stencil_triangle.position1 = (float4(file), float4(file), float4(file)) terrain_stencil_triangle.position2 = (float4(file), float4(file), float4(file)) terrain_stencil_triangle.position3 = (float4(file), float4(file), float4(file)) terrain_stencil_triangle.height_mode = string(file) return terrain_stencil_triangle
def read_playable_area_v3(file): playable_area = PlayableArea() playable_area.min_x = float4(file) playable_area.min_y = float4(file) playable_area.max_x = float4(file) playable_area.max_y = float4(file) playable_area.has_been_set = bool1(file) valid_location_flags_version = int2(file) playable_area.flags = {} playable_area.flags["valid_north"] = bool1(file) playable_area.flags["valid_south"] = bool1(file) playable_area.flags["valid_east"] = bool1(file) playable_area.flags["valid_west"] = bool1(file) return playable_area
def read_custom_material_mesh_v2(file): custom_material_mesh = CustomMaterialMesh() vertices_amount = int4(file) custom_material_mesh.vertices = [] for i in range(vertices_amount): vertex = Point3D(float4(file), float4(file), float4(file)) custom_material_mesh.vertices.append(vertex) indices_amount = int4(file) custom_material_mesh.indices = [] for i in range(indices_amount): custom_material_mesh.indices.append(int2(file)) custom_material_mesh.material = string(file) custom_material_mesh.height_mode = string(file) return custom_material_mesh
def read_capture_location(file): capture_location = CaptureLocation() capture_location.location = (float4(file), float4(file)) capture_location.radius = float4(file) capture_location.valid_for_min_num_players = int4(file) capture_location.valid_for_max_num_players = int4(file) capture_location.capture_point_type = string(file) location_points = int4(file) capture_location.location_points_list = [] for l in range(location_points): point = Point2D(float4(file), float4(file)) capture_location.location_points_list.append(point) capture_location.database_key = string(file) capture_location.flag_facing = (float4(file), float4(file)) building_links_amount = int4(file) capture_location.building_links = [] for l in range(building_links_amount): building_link = CaptureLocationBuildingLink() building_link.version = int2(file) building_link.building_index = int4(file) building_link.prefab_index = int4(file) building_link.link = string(file) capture_location.building_links.append(building_link) return capture_location
def read_particle_instnace_common(file): particle = Particle() particle.model_name = string(file) particle.transform = read_transform_n_x_m(file, 4, 3) # not 100 sure about order if particle crash it would be probably here particle.emission_rate = float4(file) particle.instance_name = string(file) particle.flags = read_particle_flags(file) particle.object_relation = string(file) return particle
def read_prop_instance_common(file): prop = Prop() prop.key_index = int2(file) file.read(2) # TODO prop.transform = read_transform_n_x_m(file, 4, 3) prop.decal = bool1(file) file.read(7) # flags from logic_decal to animated prop.decal_parallax_scale = float4(file) # print('Decal parallax: ', prop.decal_parallax_scale) prop.decal_tiling = float4(file) # print('Decal tiling: ', prop.decal_tiling) decal_override_gbuffer_normal = bool1(file) prop.flags = read_flags(file) prop.flags["decal_override_gbuffer_normal"] = decal_override_gbuffer_normal prop.flags["visible_in_shroud"] = bool1(file) prop.flags["decal_apply_to_terrain"] = bool1(file) prop.flags["decal_apply_to_gbuffer_objects"] = bool1(file) prop.flags["decal_render_above_snow"] = bool1(file) prop.height_mode = string(file) return prop
def read_deployment_zone_region(file): deployment_zone_region = DeploymentZoneRegion() boundary_list_amount = int4(file) deployment_zone_region.boundary_list = [] for i in range(boundary_list_amount): boundary_version = int2(file) deployment_zone_region.boundary_list.append(read_boundary_list(file)) deployment_zone_region.orientation = float4(file) deployment_zone_region.snap_facing = bool1(file) deployment_zone_region.id = int4(file) return deployment_zone_region
def read_building_projectile_emitter_v2(file): building_projectile_emitter = BuildingProjectileEmitter() building_projectile_emitter.position = Point3D(float4(file), float4(file), float4(file)) building_projectile_emitter.direction = (float4(file), float4(file), float4(file)) # print(building_projectile_emitter.direction) building_projectile_emitter.building_index = int4(file) building_projectile_emitter.height_mode = string(file) return building_projectile_emitter
def read_building_property_v4(file): building_property = BuildingProperty() # seems to be empty string building_id building_property.building_id = string(file) building_property.starting_damage_unary = float4(file) building_property.flags = {} # i am not sure about next 4 bytes, but probably they are on_fire, start_disabled, weak_point, ai_breachable building_property.flags["on_fire"] = bool1(file) building_property.flags["start_disabled"] = bool1(file) building_property.flags["weak_point"] = bool1(file) building_property.flags["ai_breachable"] = bool1(file) building_property.flags["indestructible"] = bool1(file) # next byte is probably dockable building_property.flags["dockable"] = bool1(file) building_property.flags["toggleable"] = bool1(file) # next 2 bytes are probably lite and clamp_to_surface building_property.flags["lite"] = bool1(file) building_property.flags["clamp_to_surface"] = bool1(file) building_property.flags["cast_shadows"] = bool1(file) return building_property
def read_spot_light_common(file): spot_light = SpotLight() spot_light.position = Point3D(float4(file), float4(file), float4(file)) spot_light.end = (float4(file), float4(file), float4(file), float4(file)) spot_light.length = float4(file) spot_light.inner_angle = float4(file) spot_light.outer_angle = float4(file) spot_light.colour = ColourRGB(float4(file), float4(file), float4(file)) spot_light.falloff = float4(file) spot_light.gobo = string(file) spot_light.flags = {"volumetric": bool1(file)} spot_light.height_mode = string(file) return spot_light
def read_sound_shape_common(file): sound_shape = SoundShape() sound_shape.key = string(file) sound_shape.type = string(file) points = int4(file) sound_shape.points = [] for j in range(points): point = Point3D(float4(file), float4(file), float4(file)) sound_shape.points.append(point) sound_shape.inner_radius = float4(file) sound_shape.outer_radius = float4(file) sound_shape.inner_cube = Cube(float4(file), float4(file), float4(file), float4(file), float4(file), float4(file)) sound_shape.outer_cube = Cube(float4(file), float4(file), float4(file), float4(file), float4(file), float4(file)) river_nodes_amount = int4(file) sound_shape.river_nodes = [] for i in range(river_nodes_amount): river_node_version = int2(file) sound_shape.river_nodes.append( river_node_versions.get_reader(river_node_version)(file)) sound_shape.clamp_to_surface = bool1(file) sound_shape.height_mode = string(file) sound_shape.campaign_type_mask = int4(file) return sound_shape
def read_point_light_common(file): point_light = PointLight() point_light.position = Point3D(float4(file), float4(file), float4(file)) point_light.radius = float4(file) point_light.colour = ColourRGB(float4(file), float4(file), float4(file)) point_light.colour_scale = float4(file) point_light.animation_type = int1(file) point_light.params = (float4(file), float4(file)) point_light.colour_min = float4(file) point_light.random_offset = float4(file) point_light.falloff_type = string(file) return point_light