def save_decals_list(decals: List[TerryDecal], entities: Element):
    for terry_decal in decals:
        entity = create_entity_node(entities)
        ECDecal = SubElement(
            entity, "ECDecal", {
                "model_path":
                terry_decal.model_path,
                "parallax_scale":
                str(terry_decal.parallax_scale),
                "tiling":
                str(terry_decal.tiling),
                "normal_mode":
                terry_decal.normal_mode,
                "apply_to_terrain":
                s_bool(terry_decal.flags["apply_to_terrain"]),
                "apply_to_objects":
                s_bool(terry_decal.flags["apply_to_objects"]),
                "render_above_snow":
                s_bool(terry_decal.flags["render_above_snow"]),
            })
        ecterrainclamp_to_xml(entity, terry_decal.ecterrainclamp)
        ectransform_to_xml(entity, terry_decal.ectransform)
        ecbattleproperties_to_xml(entity, terry_decal.ecbattleproperties)

    return entities
def save_tree_list(trees: List[TerryTree], entities: Element):
    for tree in trees:
        entity = create_entity_node(entities)
        ECVegetation = SubElement(entity, "ECVegetation", {
            "key": tree.key,
        })
        ectransform_to_xml(entity, tree.ectransform)
        ecterrainclamp_to_xml(entity, tree.ecterrainclamp)
def save_prefab_instance_list(prefab_instances: List[TerryPrefabInstance], entities: Element):
    for prefab_instance in prefab_instances:
        entity = create_entity_node(entities)
        ECPrefab = SubElement(entity, "ECPrefab", {
            "key": str(prefab_instance.key),
        })
        ecterrainclamp_to_xml(entity, prefab_instance.ecterrainclamp)
        ectransform_to_xml(entity, prefab_instance.ectransform)

    return entities
Beispiel #4
0
def save_prop_buildings_list(prop_buildings: List[TerryPropBuilding],
                             entities: Element):
    for prop_building in prop_buildings:
        entity = create_entity_node(entities)
        ECPropMesh = SubElement(entity, "ECPropMesh")
        ECMesh = SubElement(
            entity, "ECMesh", {
                "model_path": prop_building.model_path,
                "animation_path": "",
                "opacity": "1",
            })
        ecterrainclamp_to_xml(entity, prop_building.ecterrainclamp)
        ectransform_to_xml(entity, prop_building.ectransform)
        ecbattleproperties_to_xml(entity, prop_building.ecbattleproperties)

    return entities
Beispiel #5
0
def save_particles_list(particles: List[TerryParticle], entities: Element):
    for terry_particle in particles:
        # terry_particle = convert_particle(particle)
        entity = create_entity_node(entities)

        ECVFX = SubElement(entity, "ECVFX", {
            "vfx": terry_particle.vfx,
            "autoplay": "true",
            "scale": "1",
            "instance_name": "",
        })
        ecterrainclamp_to_xml(entity, terry_particle.ecterrainclamp)
        ectransform_to_xml(entity, terry_particle.ectransform)
        ecbattleproperties_to_xml(entity, terry_particle.ecbattleproperties)

    return entities
def save_buildings_list(buildings: List[TerryBuilding], entities: Element):
    for building in buildings:
        entity = create_entity_node(entities)
        ECBuilding = SubElement(
            entity, "ECBuilding", {
                "key":
                building.key,
                "damage":
                str(building.damage),
                "indestructible":
                s_bool(building.flags["indestructible"]),
                "toggleable":
                s_bool(building.flags["toggleable"]),
                "capture_location":
                "",
                "export_as_prop":
                s_bool(building.flags["export_as_prop"]),
                "allow_in_outfield_as_prop":
                s_bool(building.flags["allow_in_outfield_as_prop"]),
            })
        ecmeshrendersettings_to_xml(entity, building.ecmeshrendersettings)
        ectransform_to_xml(entity, building.ectransform)
        ecterrainclamp_to_xml(entity, building.ecterrainclamp)