Esempio n. 1
0
def read_composite_scene_common(file):
    composite_scene = CompositeScene()
    composite_scene.transform = read_transform_n_x_m(file, 4, 3)
    composite_scene.scene_file = string(file)
    composite_scene.height_mode = string(file)

    return composite_scene
Esempio n. 2
0
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
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
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
Esempio n. 6
0
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_prefab_instance(file):
    prefab_instance = PrefabInstance()
    prefab_version = int2(file)
    prefab_instance.name = string(file)
    prefab_instance.transformation = read_transform_n_x_m(file, 4, 4)
    # print(prefab_instance.transform)
    property_overrides = int4(file)
    # print('Property overrides: ', property_overrides)
    for j in range(property_overrides):
        file.read(2)
        property_value = string(file)
        # print(property_value)
        file.read(14)
    file.read(7)
    prefab_instance.height_mode = string(file)

    return prefab_instance
Esempio n. 8
0
def read_point_light_v6(file):
    point_light = read_point_light_common(file)
    point_light.flags = {"lf_relative": bool1(file)}
    point_light.height_mode = string(file)
    point_light.flags["light_probes_only"] = bool1(file)
    point_light.pdlc_mask = int8(file)

    return point_light
def read_building_v8(file):
    building = Building()
    building.flags = {}
    building.building_id = string(file)
    building.parent_id = int2(file)
    building.building_key = string(file)
    building.position_type = string(file)
    building.transform = read_transform_n_x_m(file, 4, 3)

    property_version = int2(file)
    building.properties = building_property_versions.get_reader(
        property_version)(file)

    building.height_mode = string(file)

    #print(building.__dict__)
    return building
Esempio n. 10
0
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
Esempio n. 11
0
def read_point_light_v4(file):
    point_light = read_point_light_common(file)
    # in all files it is in1 -4
    file.read(1)
    point_light.height_mode = string(file)
    # in all files it is 0
    file.read(1)
    point_light.pdlc_mask = int4(file)

    return point_light
Esempio n. 12
0
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"
Esempio n. 13
0
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
Esempio n. 14
0
def read_deployment_area(file):
    deployment_area = DeploymentArea()
    deployment_area.category = string(file)
    deployment_zones_amount = int4(file)
    deployment_area.deployment_zone_regions = []
    for i in range(deployment_zones_amount):
        deployment_zone_region_version = int2(file)
        deployment_area.deployment_zone_regions.append(read_deployment_zone_region(file))

    return deployment_area
Esempio n. 15
0
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
Esempio n. 16
0
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
Esempio n. 17
0
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_building_v11(file):
    building = Building()
    building.flags = {}
    building.building_id = string(file)
    building.parent_id = int2(file)
    some_unknown_flag = int2(file)
    building.building_key = string(file)
    print(building.building_key)
    building.position_type = string(file)
    print(building.position_type)
    building.transform = read_transform_n_x_m(file, 4, 3)
    print(building.transform)
    property_version = int2(file)
    building.properties = building_property_versions.get_reader(
        property_version)(file)

    building.height_mode = string(file)
    print(building.height_mode)
    #print(building.__dict__)
    # extra 8 bytes in the end of building
    file.read(8)
    return building
Esempio n. 19
0
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
Esempio n. 20
0
def read_ai_hints(file: BinaryIO):
    version = int2(file)  # version
    # print('Version: ', version)
    ai_hints = AiHint()

    ai_hints.separators = []

    # separators
    separators_version = int2(file)
    separators_amount = int4(file)
    for i in range(separators_amount):
        ai_hints.separators.append(read_polyline(file))

    # directed_points
    directed_points_version = int2(file)
    directed_points_amount = int4(file)

    # polylines
    polylines_version = int2(file)
    polylines_amount = int4(file)

    polylines = []
    ai_hints.polylines = []
    for i in range(polylines_amount):
        ai_hints.polylines.append(read_polyline(file))

    # polylines list

    polylines_list_version = int2(file)
    polylines_list_amount = int4(file)

    ai_hints.polylines_list_list = []
    for i in range(polylines_list_amount):
        poly_lines_list = PolyLineList()

        hint_polylines_version = int2(file)
        poly_lines_list.type = string(file)
        polygons_amount = int4(file)
        poly_lines_list.polygons = []
        for j in range(polygons_amount):
            poly_lines_list.polygons.append(read_polygone(file))

    return ai_hints
Esempio n. 21
0
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_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
Esempio n. 23
0
def read_prop_key_instance(file: BinaryIO):
    return string(file)