Exemplo n.º 1
0
def _create_trigger_locator(trp_name, trp_action, trp_range, trp_reset_delay,
                            trp_flags, trp_position,
                            scs_trigger_actions_inventory):
    locator = _object_utils.create_locator_empty(trp_name, trp_position,
                                                 (0, 0, 0), (1, 1, 1), 0.1,
                                                 'Prefab')
    if locator:
        locator.scs_props.locator_prefab_type = 'Trigger Point'

        action_value = _inventory.get_item_name(scs_trigger_actions_inventory,
                                                trp_action,
                                                report_errors=True)
        locator.scs_props.locator_prefab_tp_action = action_value

        locator.scs_props.locator_prefab_tp_range = trp_range
        locator.scs_props.locator_prefab_tp_reset_delay = trp_reset_delay

        locator.scs_props.locator_prefab_tp_manual_activ = (
            trp_flags & _PL_consts.TPF.MANUAL) != 0
        locator.scs_props.locator_prefab_tp_sphere_trigger = (
            trp_flags & _PL_consts.TPF.SPHERE) != 0
        locator.scs_props.locator_prefab_tp_partial_activ = (
            trp_flags & _PL_consts.TPF.PARTIAL) != 0
        locator.scs_props.locator_prefab_tp_onetime_activ = (
            trp_flags & _PL_consts.TPF.ONETIME) != 0

    return locator
Exemplo n.º 2
0
def _create_traffic_light_locator(
        tsem_name,
        tsem_position,
        tsem_rotation,
        tsem_type,
        tsem_id,
        tsem_intervals,
        tsem_cycle,
        tsem_profile,
        scs_tsem_profile_inventory
):
    locator = _object_utils.create_locator_empty(tsem_name, tsem_position, tsem_rotation, (1, 1, 1), 0.1, 'Prefab')
    if locator:
        locator.scs_props.locator_prefab_type = 'Traffic Semaphore'
        locator.scs_props.locator_prefab_tsem_id = str(tsem_id)

        # try to set semaphore profile only if it has some value
        if tsem_profile != "":
            tsem_profile_value = _inventory.get_item_name(scs_tsem_profile_inventory, tsem_profile, report_errors=True)
            locator.scs_props.locator_prefab_tsem_profile = tsem_profile_value

        locator.scs_props.locator_prefab_tsem_type = str(tsem_type)
        locator.scs_props.locator_prefab_tsem_gs = tsem_intervals[0]
        locator.scs_props.locator_prefab_tsem_os1 = tsem_intervals[1]
        locator.scs_props.locator_prefab_tsem_rs = tsem_intervals[2]
        locator.scs_props.locator_prefab_tsem_os2 = tsem_intervals[3]
        locator.scs_props.locator_prefab_tsem_cyc_delay = tsem_cycle
    return locator
Exemplo n.º 3
0
def _create_trigger_locator(
        trp_name,
        trp_action,
        trp_range,
        trp_reset_delay,
        trp_flags,
        trp_position,
        scs_trigger_actions_inventory
):
    locator = _object_utils.create_locator_empty(trp_name, trp_position, (0, 0, 0), (1, 1, 1), 0.1, 'Prefab')
    if locator:
        locator.scs_props.locator_prefab_type = 'Trigger Point'

        action_value = _inventory.get_item_name(scs_trigger_actions_inventory, trp_action, report_errors=True)
        locator.scs_props.locator_prefab_tp_action = action_value

        locator.scs_props.locator_prefab_tp_range = trp_range
        locator.scs_props.locator_prefab_tp_reset_delay = trp_reset_delay

        locator.scs_props.locator_prefab_tp_manual_activ = (trp_flags & _PL_consts.TPF.MANUAL) != 0
        locator.scs_props.locator_prefab_tp_sphere_trigger = (trp_flags & _PL_consts.TPF.SPHERE) != 0
        locator.scs_props.locator_prefab_tp_partial_activ = (trp_flags & _PL_consts.TPF.PARTIAL) != 0
        locator.scs_props.locator_prefab_tp_onetime_activ = (trp_flags & _PL_consts.TPF.ONETIME) != 0

    return locator
Exemplo n.º 4
0
def _create_traffic_light_locator(
        tsem_name,
        tsem_position,
        tsem_rotation,
        tsem_type,
        tsem_id,
        tsem_intervals,
        tsem_cycle,
        tsem_profile,
        scs_tsem_profile_inventory
):
    locator = _object_utils.create_locator_empty(tsem_name, tsem_position, tsem_rotation, (1, 1, 1), 0.1, 'Prefab')
    if locator:
        locator.scs_props.locator_prefab_type = 'Traffic Semaphore'
        locator.scs_props.locator_prefab_tsem_id = str(tsem_id)

        # try to set semaphore profile only if it has some value
        if tsem_profile != "":
            tsem_profile_value = _inventory.get_item_name(scs_tsem_profile_inventory, tsem_profile, report_errors=True)
            locator.scs_props.locator_prefab_tsem_profile = tsem_profile_value

        locator.scs_props.locator_prefab_tsem_type = str(tsem_type)
        locator.scs_props.locator_prefab_tsem_gs = tsem_intervals[0]
        locator.scs_props.locator_prefab_tsem_os1 = tsem_intervals[1]
        locator.scs_props.locator_prefab_tsem_rs = tsem_intervals[2]
        locator.scs_props.locator_prefab_tsem_os2 = tsem_intervals[3]
        locator.scs_props.locator_prefab_tsem_cyc_delay = tsem_cycle
    return locator
Exemplo n.º 5
0
def _create_sign_locator(sign_name, sign_position, sign_rotation,
                         sign_model_id, sign_part, scs_sign_model_inventory):
    locator = _object_utils.create_locator_empty(sign_name, sign_position,
                                                 sign_rotation, (1, 1, 1), 0.1,
                                                 'Prefab')
    if locator:
        locator.scs_props.locator_prefab_type = 'Sign'
        sign_model_value = _inventory.get_item_name(scs_sign_model_inventory,
                                                    sign_model_id,
                                                    report_errors=True)
        locator.scs_props.locator_prefab_sign_model = sign_model_value
        locator.scs_props.scs_part = sign_part

    return locator
Exemplo n.º 6
0
def _create_sign_locator(
        sign_name,
        sign_position,
        sign_rotation,
        sign_model_id,
        sign_part,
        scs_sign_model_inventory
):
    locator = _object_utils.create_locator_empty(sign_name, sign_position, sign_rotation, (1, 1, 1), 0.1, 'Prefab')
    if locator:
        locator.scs_props.locator_prefab_type = 'Sign'
        sign_model_value = _inventory.get_item_name(scs_sign_model_inventory, sign_model_id, report_errors=True)
        locator.scs_props.locator_prefab_sign_model = sign_model_value
        locator.scs_props.scs_part = sign_part

    return locator