def process_entry(processor, txt_file, troop, index):
    troop.extend(0 for i in xrange(16 - len(troop)))
    image = "0" if troop[13] == 0 else pc.replace_spaces(str(troop[13]))
    scene_entry = 0 if not troop[4] else processor.process_id(
        troop[4][0], "scn") | troop[4][1]
    output_list = [
        "\r\ntrp_%s %s %s %s %d %d %d %d %d %d\r\n  " %
        (troop[0], pc.replace_spaces(troop[1]), pc.replace_spaces(
            troop[2]), image, troop[3], scene_entry, troop[5],
         processor.process_id(troop[6], "fac"), troop[14], troop[15])
    ]
    output_list.extend("%d 0 " % processor.process_id(i, "itm")
                       for i in troop[7])
    output_list.extend("-1 0 " for i in xrange(64 - len(troop[7])))
    output_list.append("\r\n ")
    output_list.append(" %d %d %d %d %d\r\n" % tuple(
        (troop[8] >> (i * 8)) & 0xff for i in xrange(5)))
    output_list.append(" %d %d %d %d %d %d %d\r\n" % tuple(
        (troop[9] >> (i * 10)) & 0x3ff
        for i in xrange(num_weapon_proficiencies)))
    output_list.append("%d %d %d %d %d %d \r\n  " % tuple(
        (troop[10] >> (i * 32)) & 0xffffffff for i in xrange(num_skill_words)))
    output_list.extend("%d %d %d %d " % tuple(
        (face_key >> (64 * i)) & 0xffffffffffffffff
        for i in reversed(xrange(4))) for face_key in troop[11:13])
    output_list.append("\r\n")
    txt_file.write("".join(output_list))
def process_entry(processor, txt_file, faction, index):
  global faction_relations
  faction_len = len(faction)
  color = faction[6] if faction_len > 6 else 0xaaaaaa
  txt_file.write("fac_%s %s %d %d \r\n" % (faction[0], pc.replace_spaces(faction[1]), faction[2], color))
  map(txt_file.write, (" %f " % relation for relation in faction_relations[index]))
  ranks = faction[5] if faction_len > 5 else []
  txt_file.write("\r\n%d " % len(ranks))
  map(txt_file.write, (" %s " % pc.replace_spaces(rank) for rank in ranks))
  txt_file.write("\r\n")
def process_entry(processor, txt_file, faction, index):
  global faction_relations
  faction_len = len(faction)
  color = faction[6] if faction_len > 6 else 0xaaaaaa
  txt_file.write("fac_%s %s %d %d \r\n" % (faction[0], pc.replace_spaces(faction[1]), faction[2], color))
  map(txt_file.write, (" %f " % relation for relation in faction_relations[index]))
  ranks = faction[5] if faction_len > 5 else []
  txt_file.write("\r\n%d " % len(ranks))
  map(txt_file.write, (" %s " % pc.replace_spaces(rank) for rank in ranks))
  txt_file.write("\r\n")
def process_entry(processor, txt_file, entry, index):
  output_list = ["menu_%s %d %s %s" % (entry[0], entry[1], pc.replace_spaces(entry[2]), entry[3])]
  output_list.extend(processor.process_block(entry[4], entry[0]))
  output_list.append("%d\r\n" % po.block_len(entry[5]))
  for menu in entry[5]:
    output_list.append(" mno_%s " % menu[0])
    name = "%s: %s" % (entry[0], menu[0])
    output_list.extend(processor.process_block(menu[1], name + " conditions"))
    output_list.append(" %s " % pc.replace_spaces(menu[2]))
    output_list.extend(processor.process_block(menu[3], name + " consequences"))
    output_list.append(" %s " % pc.replace_spaces(menu[4]) if len(menu) > 4 else " . ")
  output_list.append("\r\n")
  txt_file.write("".join(output_list))
예제 #5
0
def process_entry(processor, txt_file, troop, index):
  troop.extend(0 for i in xrange(16 - len(troop)))
  image = "0" if troop[13] == 0 else pc.replace_spaces(str(troop[13]))
  scene_entry = 0 if not troop[4] else processor.process_id(troop[4][0], "scn") | troop[4][1]
  output_list = ["\r\ntrp_%s %s %s %s %d %d %d %d %d %d\r\n  " % (troop[0], pc.replace_spaces(troop[1]), pc.replace_spaces(troop[2]),
      image, troop[3], scene_entry, troop[5], processor.process_id(troop[6], "fac"), troop[14], troop[15])]
  output_list.extend("%d 0 " % processor.process_id(i, "itm") for i in troop[7])
  output_list.extend("-1 0 " for i in xrange(64 - len(troop[7])))
  output_list.append("\r\n ")
  output_list.append(" %d %d %d %d %d\r\n" % tuple((troop[8] >> (i * 8)) & 0xff for i in xrange(5)))
  output_list.append(" %d %d %d %d %d %d %d\r\n" % tuple((troop[9] >> (i * 10)) & 0x3ff for i in xrange(num_weapon_proficiencies)))
  output_list.append("%d %d %d %d %d %d \r\n  " % tuple((troop[10] >> (i * 32)) & 0xffffffff for i in xrange(num_skill_words)))
  output_list.extend("%d %d %d %d " % tuple((face_key >> (64 * i)) & 0xffffffffffffffff for i in reversed(xrange(4))) for face_key in troop[11:13])
  output_list.append("\r\n")
  txt_file.write("".join(output_list))
def process_entry(processor, txt_file, entry, index):
    name = get_dialog_name(entry[start_state_pos], entry[end_state_pos],
                           entry[text_pos])
    trp_pt = entry[speaker_pos]
    flags = entry[flags_pos]
    speaker = 0
    if flags & other:
        speaker = processor.process_id(trp_pt[1], "trp") << other_bits
        flags ^= other
        trp_pt = trp_pt[0]
    if flags & party_tpl:
        speaker |= processor.process_id(trp_pt, "pt")
    else:
        speaker |= processor.process_id(trp_pt, "trp")
    speaker |= flags
    output_list = ["%s %d %d " % (name, speaker, start_states[index])]
    output_list.extend(
        processor.process_block(entry[conditions_pos], "%s conditions" % name))
    output_list.append(
        "%s " %
        pc.replace_spaces(entry[text_pos]) if entry[text_pos] else "NO_TEXT ")
    output_list.append(" %d " % end_states[index])
    output_list.extend(
        processor.process_block(entry[consequences_pos],
                                "%s consequences" % name))
    output_list.append(
        "%s " %
        entry[voice_pos] if len(entry) > voice_pos else "NO_VOICEOVER ")
    output_list.append("\r\n")
    txt_file.write("".join(output_list))
def process_entry(processor, txt_file, entry, index):
    spawn_records = entry[4]
    output_list = [
        "mst_%s %s %d  %d\r\n%s \r\n\r\n%d " %
        (entry[0], entry[0], entry[1], entry[2], pc.replace_spaces(
            entry[3]), po.block_len(spawn_records))
    ]
    for spawn_record in spawn_records:
        item_override_len = po.block_len(spawn_record[5])
        if item_override_len > 8:
            pc.ERROR("the maximum number of spawn item overrides is 8")
        output_list.append("%d %d %d %d %d %d  " % (spawn_record[0:5] +
                                                    (item_override_len, )))
        output_list.extend("%d " % processor.process_id(item, "itm")
                           for item in spawn_record[5])
        output_list.append("\r\n")
    output_list.append("%d\r\n" % po.block_len(entry[5]))
    txt_file.write("".join(output_list))
    for i, trigger in enumerate(entry[5]):
        txt_file.write("%f %f %f " % trigger[0:3])
        if trigger[0] < 0.0:
            name = "%s: %s" % (entry[0], get_trigger_name(trigger[0]))
        else:
            name = "%s: trigger #%d" % (entry[0], i)
        txt_file.write("".join(
            processor.process_block(trigger[3], name + " conditions")))
        txt_file.write("".join(
            processor.process_block(trigger[4], name + " consequences")))
        txt_file.write("\r\n")
    txt_file.write("\r\n\r\n")
def process_entry(processor, txt_file, item, index):
    visible_name = pc.replace_spaces(item[1])
    item_meshes = item[2]
    output_list = [
        " itm_%s %s %s %d " %
        (item[0], visible_name, visible_name, po.block_len(item_meshes))
    ]
    output_list.extend([" %s %d " % mesh_imod for mesh_imod in item_meshes])
    stats = item[6]
    output_list.append(
        " %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\r\n" %
        (item[3], item[4], item[5], item[7], get_weight(stats),
         get_abundance(stats), get_head_armor(stats), get_body_armor(stats),
         get_leg_armor(stats), get_difficulty(stats), get_hit_points(stats),
         get_speed_rating(stats), get_missile_speed(stats),
         get_weapon_length(stats), get_max_ammo(stats),
         get_thrust_damage(stats), get_swing_damage(stats)))
    item_len = len(item)
    if item_len > 9:
        output_list.append(" %d\r\n" % po.block_len(item[9]))
        output_list.extend([
            " %d" % processor.process_id(item_faction, "fac")
            for item_faction in item[9]
        ])
        output_list.append("\r\n")
    else:
        output_list.append(" 0\r\n")
    txt_file.write("".join(output_list))
    triggers = item[8] if item_len > 8 else []
    triggers = processor.process_triggers(triggers, item[0])
    triggers.append("\r\n")
    txt_file.write("".join(triggers))
def process_entry(processor, txt_file, entry, index):
    output_list = [
        "menu_%s %d %s %s" %
        (entry[0], entry[1], pc.replace_spaces(entry[2]), entry[3])
    ]
    output_list.extend(processor.process_block(entry[4], entry[0]))
    output_list.append("%d\r\n" % po.block_len(entry[5]))
    for menu in entry[5]:
        output_list.append(" mno_%s " % menu[0])
        name = "%s: %s" % (entry[0], menu[0])
        output_list.extend(
            processor.process_block(menu[1], name + " conditions"))
        output_list.append(" %s " % pc.replace_spaces(menu[2]))
        output_list.extend(
            processor.process_block(menu[3], name + " consequences"))
        output_list.append(
            " %s " % pc.replace_spaces(menu[4]) if len(menu) > 4 else " . ")
    output_list.append("\r\n")
    txt_file.write("".join(output_list))
예제 #10
0
def process_entry(processor, txt_file, entry, index):
  passages = entry[8]
  txt_file.write("scn_%s %s %d %s %s %f %f %f %f %f %s \r\n  %d " % (entry[0], pc.replace_spaces(entry[0]), entry[1],
      entry[2], entry[3], entry[4][0], entry[4][1], entry[5][0], entry[5][1], entry[6], entry[7], po.block_len(passages)))
  output_list = [" %d " % (100000 if p == "exit" else 0 if p == "" else processor.identifier_map.get_id("scn", p)) for p in passages]
  chest_troops = entry[9]
  output_list.append("\r\n  %d " % po.block_len(chest_troops))
  output_list.extend(" %d " % processor.identifier_map.get_id("trp", troop) for troop in chest_troops)
  output_list.append("\r\n %s \r\n" % entry[10] if len(entry) > 10 else "\r\n 0 \r\n")
  txt_file.write("".join(output_list))
예제 #11
0
def process_entry(processor, txt_file, entry, index):
  icon_flags = (entry[2][1] if po.block_len(entry[2]) > 1 else 0) | processor.process_id(entry[2][0], "icon") if entry[2] else 0
  menu = processor.process_id(entry[3], "mnu")
  template = processor.process_id(entry[4], "pt")
  faction = processor.process_id(entry[5], "fac")
  pos = entry[9]
  txt_file.write(" 1 %d %d p_%s %s %d %d %d %d %d %d %d %d %d %f %f %f %f %f %f 0.0 %d " % (index, index, entry[0],
      pc.replace_spaces(entry[1]), icon_flags, menu, template, faction, entry[6], entry[6], entry[7], entry[8], entry[8],
      pos[0], pos[1], pos[0], pos[1], pos[0], pos[1], len(entry[10])))
  txt_file.write("".join("%d %d 0 %d " % (processor.process_id(member[0], "trp"), member[1], member[2]) for member in entry[10]))
  txt_file.write("\r\n%f\r\n" % ((3.1415926 / 180.0) * entry[11] if len(entry) > 11 else 0.0))
def process_entry(processor, txt_file, entry, index):
    icon_flags = 0 if not entry[2] else ((entry[2][1] if po.block_len(entry[2]) > 1 else 0) | processor.process_id(entry[2][0], "icon"))
    txt_file.write("pt_%s %s %d %d %d %d " % (entry[0], pc.replace_spaces(entry[1]), icon_flags, entry[3],
        processor.process_id(entry[4], "fac"), entry[5]))
    member_count = po.block_len(entry[6])
    if member_count > 6:
      raise pc.ERROR("party templates can only have a maximum of 6 members")
    members_list = ["%d %d %d %d " % (processor.process_id(troop[0], "trp"), troop[1], troop[2], troop[3] if len(troop) > 3 else 0) for troop in entry[6]]
    members_list.extend("-1 " for i in xrange(6 - member_count))
    members_list.append("\r\n")
    txt_file.write("".join(members_list))
예제 #13
0
def process_entry(processor, txt_file, entry, index):
    face_keys = entry[6]
    output_list = [
        "%s %d\r\n %s %s %s\r\n %s %d " %
        (entry[0], entry[1], entry[2], entry[3], entry[4], entry[5],
         len(face_keys))
    ]
    output_list.extend("skinkey_%s %d %d %f %f %s " %
                       (pc.convert_to_identifier(key[4]).lower(), key[0],
                        key[1], key[2], key[3], pc.replace_spaces(key[4]))
                       for key in face_keys)
    hair_meshes = entry[7]
    output_list.append("\r\n%d\r\n" % po.block_len(hair_meshes))
    output_list.extend(" %s " % e for e in hair_meshes)
    beard_meshes = entry[8]
    output_list.append("\r\n %d\r\n" % po.block_len(beard_meshes))
    output_list.extend("  %s\r\n" % e for e in beard_meshes)
    hair_textures = entry[9]
    output_list.append("\r\n %d " % po.block_len(hair_textures))
    output_list.extend(" %s " % e for e in hair_textures)
    beard_textures = entry[10]
    output_list.append("\r\n %d " % po.block_len(beard_textures))
    output_list.extend(" %s " % e for e in beard_textures)
    face_textures = entry[11]
    output_list.append("\r\n %d " % po.block_len(face_textures))
    for face in face_textures:
        hair_textures = face[2]
        hair_colors = face[3] if len(face) > 3 else []
        output_list.append(" %s %d %d %d " %
                           (face[0], face[1], po.block_len(hair_textures),
                            po.block_len(hair_colors)))
        output_list.extend(" %s " % e for e in hair_textures)
        output_list.extend(" %d " % e for e in hair_colors)
    voices = entry[12]
    output_list.append("\r\n %d " % po.block_len(voices))
    output_list.extend(" %d %s " % e for e in voices)
    output_list.append("\r\n %s %f \r\n" % (entry[13], entry[14]))
    entry_len = len(entry)
    blood_1 = processor.process_id(entry[15], "psys") if entry_len > 15 else 0
    blood_2 = processor.process_id(entry[16], "psys") if entry_len > 16 else 0
    constraints = entry[17] if entry_len > 17 else []
    output_list.append("%d %d\r\n%d\r\n" %
                       (blood_1, blood_2, po.block_len(constraints)))
    for constraint in constraints:
        output_list.append("\r\n%f %d %d " %
                           (constraint[0], constraint[1], len(constraint) - 2))
        output_list.extend(" %f %d" % e for e in constraint[2:])
    output_list.append("\r\n")
    txt_file.write("".join(output_list))
def process_entry(processor, txt_file, entry, index):
    passages = entry[8]
    txt_file.write("scn_%s %s %d %s %s %f %f %f %f %f %s \r\n  %d " %
                   (entry[0], pc.replace_spaces(entry[0]), entry[1], entry[2],
                    entry[3], entry[4][0], entry[4][1], entry[5][0],
                    entry[5][1], entry[6], entry[7], po.block_len(passages)))
    output_list = [
        " %d " % (100000 if p == "exit" else
                  0 if p == "" else processor.identifier_map.get_id("scn", p))
        for p in passages
    ]
    chest_troops = entry[9]
    output_list.append("\r\n  %d " % po.block_len(chest_troops))
    output_list.extend(" %d " % processor.identifier_map.get_id("trp", troop)
                       for troop in chest_troops)
    output_list.append("\r\n %s \r\n" %
                       entry[10] if len(entry) > 10 else "\r\n 0 \r\n")
    txt_file.write("".join(output_list))
예제 #15
0
def process_entry(processor, txt_file, entry, index):
    face_keys = entry[6]
    output_list = [
        "%s %d\r\n %s %s %s\r\n %s %d " % (entry[0], entry[1], entry[2], entry[3], entry[4], entry[5], len(face_keys))
    ]
    output_list.extend(
        "skinkey_%s %d %d %f %f %s "
        % (pc.convert_to_identifier(key[4]).lower(), key[0], key[1], key[2], key[3], pc.replace_spaces(key[4]))
        for key in face_keys
    )
    hair_meshes = entry[7]
    output_list.append("\r\n%d\r\n" % po.block_len(hair_meshes))
    output_list.extend(" %s " % e for e in hair_meshes)
    beard_meshes = entry[8]
    output_list.append("\r\n %d\r\n" % po.block_len(beard_meshes))
    output_list.extend("  %s\r\n" % e for e in beard_meshes)
    hair_textures = entry[9]
    output_list.append("\r\n %d " % po.block_len(hair_textures))
    output_list.extend(" %s " % e for e in hair_textures)
    beard_textures = entry[10]
    output_list.append("\r\n %d " % po.block_len(beard_textures))
    output_list.extend(" %s " % e for e in beard_textures)
    face_textures = entry[11]
    output_list.append("\r\n %d " % po.block_len(face_textures))
    for face in face_textures:
        hair_textures = face[2]
        hair_colors = face[3] if len(face) > 3 else []
        output_list.append(" %s %d %d %d " % (face[0], face[1], po.block_len(hair_textures), po.block_len(hair_colors)))
        output_list.extend(" %s " % e for e in hair_textures)
        output_list.extend(" %d " % e for e in hair_colors)
    voices = entry[12]
    output_list.append("\r\n %d " % po.block_len(voices))
    output_list.extend(" %d %s " % e for e in voices)
    output_list.append("\r\n %s %f \r\n" % (entry[13], entry[14]))
    entry_len = len(entry)
    blood_1 = processor.process_id(entry[15], "psys") if entry_len > 15 else 0
    blood_2 = processor.process_id(entry[16], "psys") if entry_len > 16 else 0
    constraints = entry[17] if entry_len > 17 else []
    output_list.append("%d %d\r\n%d\r\n" % (blood_1, blood_2, po.block_len(constraints)))
    for constraint in constraints:
        output_list.append("\r\n%f %d %d " % (constraint[0], constraint[1], len(constraint) - 2))
        output_list.extend(" %f %d" % e for e in constraint[2:])
    output_list.append("\r\n")
    txt_file.write("".join(output_list))
예제 #16
0
def process_entry(processor, txt_file, entry, index):
    icon_flags = (entry[2][1]
                  if po.block_len(entry[2]) > 1 else 0) | processor.process_id(
                      entry[2][0], "icon") if entry[2] else 0
    menu = processor.process_id(entry[3], "mnu")
    template = processor.process_id(entry[4], "pt")
    faction = processor.process_id(entry[5], "fac")
    pos = entry[9]
    txt_file.write(
        " 1 %d %d p_%s %s %d %d %d %d %d %d %d %d %d %f %f %f %f %f %f 0.0 %d "
        %
        (index, index, entry[0], pc.replace_spaces(entry[1]), icon_flags, menu,
         template, faction, entry[6], entry[6], entry[7], entry[8], entry[8],
         pos[0], pos[1], pos[0], pos[1], pos[0], pos[1], len(entry[10])))
    txt_file.write(
        "".join("%d %d 0 %d " %
                (processor.process_id(member[0], "trp"), member[1], member[2])
                for member in entry[10]))
    txt_file.write(
        "\r\n%f\r\n" %
        ((3.1415926 / 180.0) * entry[11] if len(entry) > 11 else 0.0))
예제 #17
0
 def add_str(self, sentence):
   full_id = pc.convert_to_identifier(sentence)
   sentence = pc.replace_spaces(sentence)
   id_len = min(len(full_id), 20)
   id_str = full_id[:id_len]
   duplicate_number = 1
   result = None
   while result is None:
     num_str = self.quick_strings.setdefault(id_str, [self.number, sentence])
     if num_str[0] == self.number:
       result = self.number
       self.number += 1
     elif num_str[1] == sentence:
       result = num_str[0]
     elif id_len < len(full_id):
       id_len += 1
       id_str = full_id[:id_len]
     else:
       id_str = "%s%d" % (full_id, duplicate_number)
       duplicate_number += 1
   return opmask_quick_string|result
 def add_str(self, sentence):
     full_id = pc.convert_to_identifier(sentence)
     sentence = pc.replace_spaces(sentence)
     id_len = min(len(full_id), 20)
     id_str = full_id[:id_len]
     duplicate_number = 1
     result = None
     while result is None:
         num_str = self.quick_strings.setdefault(id_str,
                                                 [self.number, sentence])
         if num_str[0] == self.number:
             result = self.number
             self.number += 1
         elif num_str[1] == sentence:
             result = num_str[0]
         elif id_len < len(full_id):
             id_len += 1
             id_str = full_id[:id_len]
         else:
             id_str = "%s%d" % (full_id, duplicate_number)
             duplicate_number += 1
     return opmask_quick_string | result
예제 #19
0
def process_entry(processor, txt_file, item, index):
  visible_name = pc.replace_spaces(item[1])
  item_meshes = item[2]
  output_list = [" itm_%s %s %s %d " % (item[0], visible_name, visible_name, po.block_len(item_meshes))]
  output_list.extend([" %s %d " % mesh_imod for mesh_imod in item_meshes])
  stats = item[6]
  output_list.append(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\r\n" % (item[3], item[4], item[5], item[7],
      get_weight(stats), get_abundance(stats), get_head_armor(stats), get_body_armor(stats), get_leg_armor(stats),
      get_difficulty(stats), get_hit_points(stats), get_speed_rating(stats), get_missile_speed(stats),
      get_weapon_length(stats), get_max_ammo(stats), get_thrust_damage(stats), get_swing_damage(stats)))
  item_len = len(item)
  if item_len > 9:
    output_list.append(" %d\r\n" % po.block_len(item[9]))
    output_list.extend([" %d" % processor.process_id(item_faction, "fac") for item_faction in item[9]])
    output_list.append("\r\n")
  else:
    output_list.append(" 0\r\n")
  txt_file.write("".join(output_list))
  triggers = item[8] if item_len > 8 else []
  triggers = processor.process_triggers(triggers, item[0])
  triggers.append("\r\n")
  txt_file.write("".join(triggers))
예제 #20
0
def process_entry(processor, txt_file, entry, index):
  name = get_dialog_name(entry[start_state_pos], entry[end_state_pos], entry[text_pos])
  trp_pt = entry[speaker_pos]
  flags = entry[flags_pos]
  speaker = 0
  if flags & other:
    speaker = processor.process_id(trp_pt[1], "trp") << other_bits
    flags ^= other
    trp_pt = trp_pt[0]
  if flags & party_tpl:
    speaker |= processor.process_id(trp_pt, "pt")
  else:
    speaker |= processor.process_id(trp_pt, "trp")
  speaker |= flags
  output_list = ["%s %d %d " % (name, speaker, start_states[index])]
  output_list.extend(processor.process_block(entry[conditions_pos], "%s conditions" % name))
  output_list.append("%s " % pc.replace_spaces(entry[text_pos]) if entry[text_pos] else "NO_TEXT ")
  output_list.append(" %d " % end_states[index])
  output_list.extend(processor.process_block(entry[consequences_pos], "%s consequences" % name))
  output_list.append("%s " % entry[voice_pos] if len(entry) > voice_pos else "NO_VOICEOVER ")
  output_list.append("\r\n")
  txt_file.write("".join(output_list))
def process_entry(processor, txt_file, entry, index):
  spawn_records = entry[4]
  output_list = ["mst_%s %s %d  %d\r\n%s \r\n\r\n%d " % (entry[0], entry[0], entry[1], entry[2],
      pc.replace_spaces(entry[3]), po.block_len(spawn_records))]
  for spawn_record in spawn_records:
    item_override_len = po.block_len(spawn_record[5])
    if item_override_len > 8:
      pc.ERROR("the maximum number of spawn item overrides is 8")
    output_list.append("%d %d %d %d %d %d  "% (spawn_record[0:5] + (item_override_len,)))
    output_list.extend("%d " % processor.process_id(item, "itm") for item in spawn_record[5])
    output_list.append("\r\n")
  output_list.append("%d\r\n" % po.block_len(entry[5]))
  txt_file.write("".join(output_list))
  for i, trigger in enumerate(entry[5]):
    txt_file.write("%f %f %f " % trigger[0:3])
    if trigger[0] < 0.0:
      name = "%s: %s" % (entry[0], get_trigger_name(trigger[0]))
    else:
      name = "%s: trigger #%d" % (entry[0], i)
    txt_file.write("".join(processor.process_block(trigger[3], name + " conditions")))
    txt_file.write("".join(processor.process_block(trigger[4], name + " consequences")))
    txt_file.write("\r\n")
  txt_file.write("\r\n\r\n")
예제 #22
0
def process_entry(processor, txt_file, entry, index):
  txt_file.write("str_%s %s\r\n" % (entry[0], pc.replace_spaces(entry[1])))
def process_entry(processor, txt_file, entry, index):
    txt_file.write("qst_%s %s %d %s \r\n" %
                   (entry[0], pc.replace_spaces(
                       entry[1]), entry[2], pc.replace_spaces(entry[3])))
예제 #24
0
def process_entry(processor, txt_file, entry, index):
  txt_file.write("skl_%s %s %d %d %s\r\n" % (entry[0], pc.replace_spaces(entry[1]), entry[2], entry[3], pc.replace_spaces(entry[4])))
예제 #25
0
def process_entry(processor, txt_file, entry, index):
    txt_file.write("mesh_%s %d %s %f %f %f %f %f %f %f %f %f\r\n" %
                   (entry[0:2] +
                    (pc.replace_spaces(entry[2]), ) + entry[3:12]))
예제 #26
0
def process_entry(processor, txt_file, entry, index):
  txt_file.write("mesh_%s %d %s %f %f %f %f %f %f %f %f %f\r\n" % (entry[0:2] +
      (pc.replace_spaces(entry[2]),) + entry[3:12]))