Generate craftable underwear sheets

merge/2021-11-19
kaetemi 3 years ago
parent 725206c678
commit fe9d945265
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -34,7 +34,7 @@ if preserveIndex and os.path.isfile("sbrick_index.tsv"):
table = loadTsv("sbrick_index.tsv")
for entry in table:
e = filter(None, entry)
entryName = e[0] + str(int(e[1])).zfill(4) # + name
entryName = e[0] + str(int(e[1], 10)).zfill(4) # + name
if "__missing" in e:
e.remove("__missing")
sbrickMap[entryName] = e + [ "__missing" ]
@ -75,8 +75,8 @@ for sbrick in fileMap:
#print(indexInFamily)
#print(name)
#print(sitem)
templateName = familyId.lower() + str(int(indexInFamily)).zfill(2)
entryName = familyId + str(int(indexInFamily)).zfill(4) # + name
templateName = familyId.lower() + str(int(indexInFamily, 10)).zfill(2)
entryName = familyId + str(int(indexInFamily, 10)).zfill(4) # + name
entry = [ familyId, indexInFamily ]
if name:
entry += [ name ]

@ -130,16 +130,31 @@ def findBrickFamily(tags):
t.remove("ranged")
if "caster" in t and "light" in t:
t.remove("light")
if "refugee" in t and "light" in t:
t.remove("light")
res = findTreeEntry(brickFamilyTree, t)
return res
sbrickIndex = loadTsv("sbrick_index.tsv")
sbrickLookup = {}
sbrickAlloc = {}
for entry in sbrickIndex:
names = entry[2:]
for name in names:
sbrickLookup[name] = entry
family = entry[0]
index = int(entry[1], 10)
if not family in sbrickAlloc:
sbrickAlloc[family] = {}
sbrickAlloc[family][index] = True
def allocFamilyIndex(family):
for i in range(1, 64):
if not i in sbrickAlloc[family]:
sbrickAlloc[family][i] = True
return i
return None
sitemTags = {}
sitemPath = "Y:\\ryzomcore4\\leveldesign\\game_element\\sitem"
@ -171,6 +186,10 @@ def generateParents():
strippedTags.remove("melee")
if "ranged" in strippedTags:
strippedTags.remove("ranged")
if "light" in strippedTags and "caster" in strippedTags:
strippedTags.remove("light")
if "light" in strippedTags and "refugee" in strippedTags:
strippedTags.remove("light")
if "shared" in tags:
parentTags[name] = strippedTags
displayName = " ".join(strippedTags)
@ -503,6 +522,10 @@ def generateSitems():
strippedTags.remove("hands")
if "light" in strippedTags and "caster" in strippedTags:
strippedTags.remove("light")
if "light" in strippedTags and "refugee" in strippedTags:
strippedTags.remove("light")
if "light" in strippedTags and "underwear" in strippedTags:
strippedTags.remove("light")
if "hq" in strippedTags:
strippedTags.remove("hq")
#strippedTags = [ "high quality" ] + strippedTags
@ -728,14 +751,17 @@ def generateSitems():
sbrickEntry = sbrickLookup[name]
else:
print("New sbrick entry: " + sbrickName + ", Family: " + brickFamily)
if sbrickEntry[0] != brickFamily:
if sbrickEntry and sbrickEntry[0] != brickFamily:
print("Brick family changed: " + sbrickName + ", New: " + brickFamily + ", Old: " + sbrickEntry[0])
sbrickEntry = None
sbrickIndex = None
if sbrickEntry:
sbrickIndex = int(sbrickEntry[1])
sbrickIndex = int(sbrickEntry[1], 10)
else:
exit("TODO: Find unused sbrick index for the family")
sbrickIndex = allocFamilyIndex(brickFamily)
if sbrickIndex:
sbrickEntry = [ brickFamily, str(sbrickIndex) ]
print(sbrickEntry)
minMat = 2
randMat = 4

@ -378,3 +378,11 @@ iccalg tr_hom_underwear_hand tr_hof_underwear_hand armor gloves hands
iccalp ge_hom_armor02_pantabottes ge_hof_armor02_pantabottes common light armor pants
iccals ge_hom_armor02_armpad ge_hof_armor02_armpad common light armor sleeves
iccalv ge_hom_armor02_gilet ge_hof_armor02_gilet common light armor vest
icfauwv tr_hom_underwear_gilet fy_hof_underwear_gilet underwear armor vest
icfauwp fy_hom_underwear_pantabottes fy_hof_underwear_pantabottes fyros underwear armor pants
icmauwv tr_hom_underwear_gilet ma_hof_underwear_gilet underwear armor vest
icmauwp ma_hom_underwear_pantabottes ma_hof_underwear_pantabottes matis underwear armor pants
ictauwv tr_hom_underwear_gilet tr_hof_underwear_gilet underwear armor vest
ictauwp tr_hom_underwear_pantabottes tr_hof_underwear_pantabottes tryker underwear armor pants
iczauwv tr_hom_underwear_gilet zo_hof_underwear_gilet underwear armor vest
iczauwp zo_hom_underwear_pantabottes zo_hof_underwear_pantabottes zorai underwear armor pants

Can't render this file because it has a wrong number of fields in line 5.

@ -172,6 +172,8 @@ BCFAEA 12 bcfals_3 icfals_3 bcfaea10_3
BCFAEA 13 bcfalv icfalv bcfaea11
BCFAEA 14 bcfalv_2 icfalv_2 bcfaea11_2
BCFAEA 15 bcfalv_3 icfalv_3 bcfaea11_3
BCFAEA 16 bcfauwv icfauwv
BCFAEA 17 bcfauwp icfauwp
BCFAEB 16 bcfamb icfamb bcfaea12
BCFAEB 17 bcfamb_2 icfamb_2 bcfaea12_2
BCFAEB 18 bcfamb_3 icfamb_3 bcfaea12_3
@ -591,6 +593,8 @@ BCMAEA 12 bcmals_3 icmals_3 bcmaea10_3
BCMAEA 13 bcmalv icmalv bcmaea11
BCMAEA 14 bcmalv_2 icmalv_2 bcmaea11_2
BCMAEA 15 bcmalv_3 icmalv_3 bcmaea11_3
BCMAEA 16 bcmauwv icmauwv
BCMAEA 17 bcmauwp icmauwp
BCMAEB 1 bcmamb icmamb bcmaea12
BCMAEB 2 bcmamb_2 icmamb_2 bcmaea12_2
BCMAEB 3 bcmamb_3 icmamb_3 bcmaea12_3
@ -1197,6 +1201,8 @@ BCTAEA 12 bctals_3 ictals_3 bctaea10_3
BCTAEA 13 bctalv ictalv bctaea11
BCTAEA 14 bctalv_2 ictalv_2 bctaea11_2
BCTAEA 15 bctalv_3 ictalv_3 bctaea11_3
BCTAEA 16 bctauwv ictauwv
BCTAEA 17 bctauwp ictauwp
BCTAEB 1 bctamb ictamb bctaea12
BCTAEB 2 bctamb_2 ictamb_2 bctaea12_2
BCTAEB 3 bctamb_3 ictamb_3 bctaea12_3
@ -1536,6 +1542,8 @@ BCZAEA 12 bczals_3 iczals_3 bczaea10_3
BCZAEA 13 bczalv iczalv bczaea11
BCZAEA 14 bczalv_2 iczalv_2 bczaea11_2
BCZAEA 15 bczalv_3 iczalv_3 bczaea11_3
BCZAEA 16 bczauwv iczauwv
BCZAEA 17 bczauwp iczauwp
BCZAEB 1 bczamb iczamb bczaea12
BCZAEB 2 bczamb_2 iczamb_2 bczaea12_2
BCZAEB 3 bczamb_3 iczamb_3 bczaea12_3

Can't render this file because it has a wrong number of fields in line 6.

@ -282,8 +282,12 @@ with open("shape_list.txt", "r") as f:
tags = parse(name)
if name.startswith("tr_hof_underwear_") and not name.endswith("_gilet") and not name.endswith("_pantabottes"):
tags.remove("tryker")
if name.startswith("zo_hof_underwear_") and not name.endswith("_gilet") and not name.endswith("_pantabottes"):
tags.remove("zorai")
if name.startswith("tr_hom_underwear_") and not name.endswith("_pantabottes"):
tags.remove("tryker")
if name.startswith("zo_hom_underwear_") and not name.endswith("_pantabottes"):
tags.remove("zorai")
# gen = generate(tags)
# if gen != name:
#{ tags += [ "invalid" ]

@ -10,8 +10,10 @@ scheme = {
"_g": "parent generic",
},
{
# family
"f": "fyros",
"m": "matis",
"m2": "matis two",
"t": "tryker",
"z": "zorai",
"c": "common",
@ -23,27 +25,27 @@ scheme = {
"hb": "high tribe",
},
{
# item type
"a": "armor",
"a_h": "heavy armor base",
"a_m": "medium armor base",
"a_l": "light armor base",
"a_c": "caster armor base",
"ar": "refugee armor",
"auw": "light underwear armor",
"aus": "light sexy underwear armor",
"ar": "light refugee armor",
"ah": "heavy armor",
"am": "medium armor",
"al": "light armor",
"ac": "light caster armor",
"ar2": "second refugee armor",
"ah2": "second heavy armor",
"am2": "second medium armor",
"al2": "second light armor",
"ac2": "second light caster armor",
"ar3": "third refugee armor",
"ah3": "third heavy armor",
"am3": "third medium armor",
"al3": "third light armor",
"ac3": "third light caster armor",
"ar4": "fourth refugee armor",
"ah4": "fourth heavy armor",
"am4": "fourth medium armor",
"al4": "fourth light armor",

@ -479,7 +479,7 @@ zo_hom_civil01_lead_armpad zorai male light armor civil01 lead event sleeves
zo_hom_civil01_lead_bottes zorai male light armor civil01 lead event boots
zo_hom_civil01_lead_gilet zorai male light armor civil01 lead event vest
zo_hom_civil01_pantabottes zorai male light armor civil01 pants
zo_hom_underwear_gilet zorai male underwear armor vest
zo_hom_underwear_gilet male underwear armor vest
zo_hom_underwear_pantabottes zorai male underwear armor pants
zo_hom_visage zorai male incomplete _visage
baton magie incomplete _baton magie

Can't render this file because it has a wrong number of fields in line 5.

@ -390,3 +390,11 @@ iccalg.sitem
iccalp.sitem
iccals.sitem
iccalv.sitem
icfauwv.sitem
icfauwp.sitem
icmauwv.sitem
icmauwp.sitem
ictauwv.sitem
ictauwp.sitem
iczauwv.sitem
iczauwp.sitem

@ -24,3 +24,13 @@ iccalg.sitem
iccalp.sitem
iccals.sitem
iccalv.sitem
; underwear
icfauwv.sitem
icfauwp.sitem
icmauwv.sitem
icmauwp.sitem
ictauwv.sitem
ictauwp.sitem
iczauwv.sitem
iczauwp.sitem

@ -1,7 +1,7 @@
_c_ah _c_ah parent shared unspecified heavy armor
_c_al _c_al parent shared unspecified light armor
_c_am _c_am parent shared unspecified medium armor
_c_ar _c_ar parent shared unspecified refugee armor
_c_ar _c_ar parent shared unspecified light refugee armor
_c_m1bm _c_m1bm parent shared unspecified melee one-handed blunt mace
_c_m1pd _c_m1pd parent shared unspecified melee one-handed piercing dagger
_c_m1ps _c_m1ps parent shared unspecified melee one-handed piercing spear

Can't render this file because it has a wrong number of fields in line 5.

@ -378,3 +378,11 @@ iccalg iccalg item crafted common light armor gloves hands
iccalp iccalp item crafted common light armor pants
iccals iccals item crafted common light armor sleeves
iccalv iccalv item crafted common light armor vest
icfauwv icfauwv item crafted fyros light underwear armor vest
icfauwp icfauwp item crafted fyros light underwear armor pants
icmauwv icmauwv item crafted matis light underwear armor vest
icmauwp icmauwp item crafted matis light underwear armor pants
ictauwv ictauwv item crafted tryker light underwear armor vest
ictauwp ictauwp item crafted tryker light underwear armor pants
iczauwv iczauwv item crafted zorai light underwear armor vest
iczauwp iczauwp item crafted zorai light underwear armor pants

Can't render this file because it has a wrong number of fields in line 5.

@ -9,6 +9,26 @@ def loadTsv(filename):
shapeParsed = loadTsv("shape_parsed.tsv")
sitemParsed = loadTsv("sitem_parsed.tsv")
boostTags = {
"underwear": 4,
"vest": 2,
"gloves": 2,
"pants": 2,
"sleeves": 2,
"helmet": 2,
"boots": 2,
# "hands": 2,
}
unmatchTags = {
# "tryker": 2,
# "matis": 2,
# "zorai": 2,
# "fyros": 2,
# "karavan": 2,
# "kami": 2,
}
def findMatch(name, sitem):
mostMatches = 0
leastUnmatches = 0
@ -27,14 +47,23 @@ def findMatch(name, sitem):
if tag not in matched:
matched[tag] = True
if tag in sitem:
matches += 1
if tag in boostTags:
matches += boostTags[tag]
else:
matches += 1
matching += [ tag ]
else:
unmatches += 1
if tag in unmatchTags:
unmatches += unmatchTags[tag]
else:
unmatches += 1
unmatching += [ tag ]
for tag in sitem:
if tag not in matched:
unmatches += 1
if tag in unmatchTags:
unmatches += unmatchTags[tag]
else:
unmatches += 1
unmatching += [ tag ]
if matches > mostMatches:
mostMatches = matches
@ -70,6 +99,8 @@ with open("match_sitem_shape.tsv", "w") as f:
if not tag in femaleTags and tag != "male":
matches = False
# print(tag)
if not matches and femaleShape[0].endswith("_hof_underwear_gilet") and maleShape[0] == "tr_hom_underwear_gilet":
matches = True
if matches:
f.write(sitem[0] + "\t" + maleShape[0] + "\t" + femaleShape[0])
for tag in maleShape[1:]:

Loading…
Cancel
Save