Ejemplo n.º 1
0
def make_voice_studio(vmf: VMF, loc: Vec):
    """Create the voice-line studio.

    This is either an instance (if monitors are present), or a nodraw room.
    """
    global VOICELINE_LOC

    studio_file = vbsp_options.get(str, 'voice_studio_inst')

    if ALL_MONITORS and studio_file:
        vmf.create_ent(
            classname='func_instance',
            file=studio_file,
            origin=loc,
            angles='0 0 0',
        )
        VOICELINE_LOC = loc + vbsp_options.get(Vec, 'voice_studio_cam_loc')
        return True
    else:
        # If there aren't monitors, the studio instance isn't used.
        # We need to seal anyway.
        vmf.add_brushes(vmf.make_hollow(
            loc - 256,
            loc + 256,
            thick=32,
        ))
        return False
Ejemplo n.º 2
0
def make_voice_studio(vmf: VMF) -> bool:
    """Create the voice-line studio.

    This is either an instance (if monitors are present), or a nodraw room.
    """

    studio_file = options.get(str, 'voice_studio_inst')
    loc = voice_line.get_studio_loc()

    if HAS_MONITOR and studio_file:
        conditions.add_inst(
            vmf,
            file=studio_file,
            origin=loc,
        )
        return True
    else:
        # If there aren't monitors, the studio instance isn't used.
        # We need to seal anyway.
        vmf.add_brushes(vmf.make_hollow(
            loc - 256,
            loc + 256,
            thick=32,
        ))
        return False
Ejemplo n.º 3
0
def make_voice_studio(vmf: VMF) -> bool:
    """Create the voice-line studio.

    This is either an instance (if monitors are present), or a nodraw room.
    """

    studio_file = vbsp_options.get(str, 'voice_studio_inst')
    loc = voiceLine.get_studio_loc()

    if ALL_MONITORS and studio_file:
        vmf.create_ent(
            classname='func_instance',
            file=studio_file,
            origin=loc,
            angles='0 0 0',
        )
        return True
    else:
        # If there aren't monitors, the studio instance isn't used.
        # We need to seal anyway.
        vmf.add_brushes(vmf.make_hollow(
            loc - 256,
            loc + 256,
            thick=32,
        ))
        return False
Ejemplo n.º 4
0
    inst_vmf.create_ent('info_target',
                        origin=pos * 128,
                        targetname='offset',
                        angles='0 0 0',
                        rot_pitch='$rot_pitch',
                        rot_yaw='$rot_yaw',
                        rot_roll='$rot_roll',
                        local_x=pos.x,
                        local_y=pos.y,
                        local_z=pos.z)

main_vmf = VMF()

main_vmf.add_brushes(
    main_vmf.make_hollow(
        Vec(-256, -256, -256),
        Vec(+256, +256, +256),
    ))

# We can't be more accurate, we'll blow the ent limit.
for pitch in range(0, 360, 45):
    for yaw in range(0, 360, 45):
        for roll in range(0, 360, 45):
            inst = main_vmf.create_ent(
                'func_instance',
                file='instances/rot_inst.vmf',
                angles=Vec(pitch, yaw, roll),
                origin='0 0 0',
            )
            inst.fixup['$rot_pitch'] = pitch
            inst.fixup['$rot_yaw'] = yaw
            inst.fixup['$rot_roll'] = roll