def read_prop_instance_v15(file): prop = read_prop_instance_common(file) strange_number = int8(file) bool1(file) bool1(file) return prop
def read_particle_instance_v6(file): particle = read_particle_instnace_common(file) particle.pdlc_mask = int8(file) particle.autoplay = bool1(file) particle.visible_in_shroud = bool1(file) return particle
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_composite_scene_v7(file): composite_scene = read_composite_scene_common(file) composite_scene.pdlc_mask = int8(file) composite_scene.flags = {} composite_scene.flags["autoplay"] = bool1(file) composite_scene.flags["visible_in_shroud"] = bool1(file) composite_scene.flags["no_culling"] = bool1(file) return composite_scene
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_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_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_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_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_particle_flags(file): assert_version('PARTICLE_EMITTER->flags', 2, int2(file)) return { 'allow_in_outfield': bool1(file), 'clamp_to_surface': bool1(file), 'clamp_to_water_surface': bool1(file), 'spring': bool1(file), 'summer': bool1(file), 'autumn': bool1(file), 'winter': bool1(file) }
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_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