Generate required NPCs for Ring

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

@ -13,6 +13,16 @@ maxCharacteristic = minCharacteristic + maxLevel
minScore = minCharacteristic * 60.0 minScore = minCharacteristic * 60.0
maxScore = maxCharacteristic * 60.0 maxScore = maxCharacteristic * 60.0
def getScore(level):
scorePerLevel = (maxScore - minScore) / maxLevel
return minScore + (scorePerLevel * level)
# Regen
regenTimeMin = 25.0 # in seconds, at lowest level
regenTimeMax = 100.0 # in seconds, at max level
regenTimeSittingMax = 25.0
regenTimeAi = 200.0
# Base time to settle a fight, assuming base damage and HP, and assuming all hits are perfectly successful # Base time to settle a fight, assuming base damage and HP, and assuming all hits are perfectly successful
combatTime = 8.0 combatTime = 8.0
@ -20,7 +30,7 @@ combatTime = 8.0
# Range is most powerful but requires ammo of course. # Range is most powerful but requires ammo of course.
# Perhaps allow range without ammo at melee damage levels. Or hybrid range and magic for ammo-less range # Perhaps allow range without ammo at melee damage levels. Or hybrid range and magic for ammo-less range
# For NPCs, range should have melee-like damage, since there is no special protection... # For NPCs, range should have melee-like damage, since there is no special protection...
# Can we turn melee/magic/range into a rock/paper/scissors? # Can we turn magic/melee/range into a rock/paper/scissors?
boosts = { boosts = {
"fauna": 1.0, "fauna": 1.0,
"melee": 1.0, "melee": 1.0,
@ -29,4 +39,53 @@ boosts = {
"range": 1.5, # 4.0? "range": 1.5, # 4.0?
} }
newbieLevels = {
# "a1": 1,
}
levels = {
"b1": 10, "b2": 20, "b3": 30, "b4": 40,
"c1": 60, "c2": 70, "c3": 80, "c4": 90,
"d1": 110, "d2": 120, "d3": 130, "d4": 140,
"e1": 160, "e2": 170, "e3": 180, "e4": 190,
"f1": 210, "f2": 220, "f3": 230, "f4": 240,
}
bossLevels = {
"b5": 50, "b6": 60, "b7": 70, "b8": 60,
"c5": 100, "c6": 110, "c7": 120, "c8": 110,
"d5": 150, "d6": 160, "d7": 170, "d8": 160,
"e5": 200, "e6": 210, "e7": 220, "e8": 210,
"f5": 250, "f6": 260, "f7": 270, "f8": 260,
}
def getRegionForce(level):
map = { "a": 1, "b": 2, "c": 3, "d": 4 , "e": 5, "f": 6 }
return map[level[0]]
def getForceLevel(level):
return int(level[1])
attackOffset = {
"d": 0, "j": 0, "f": 0, "l": 0, "p": 0, "g": 4
}
defenseOffset = {
"d": 0, "j": 0, "f": 0, "l": 0, "p": 0, "g": -4
}
levelOffset = {
"d": 0, "j": 0, "f": 0, "l": 0, "p": 2, "g": 2
}
levelVariance = [ -3, 3 ] # excluding upper bound, also applies to attack and defense
#oldLevels = {
# "b": { "a": 10, "b": 30, "c": 50 },
# "c": { "a": 60, "b": 80, "c": 100 },
# "d": { "a": 110, "b": 130, "c": 150 },
# "e": { "a": 160, "b": 180, "c": 200 },
# "f": { "a": 210, "b": 230, "c": 250 },
#}
# end of file # end of file

@ -2629,7 +2629,6 @@ object_bag_b.creature
object_banner_kami.creature object_banner_kami.creature
object_banner_karavan.creature object_banner_karavan.creature
object_barrier.creature object_barrier.creature
object_barrier_T.creature
object_bones.creature object_bones.creature
object_bones_b.creature object_bones_b.creature
object_bones_homin_a.creature object_bones_homin_a.creature
@ -2802,14 +2801,6 @@ object_fy_s3_termitiere_c.creature
object_fy_s3_termitiere_d.creature object_fy_s3_termitiere_d.creature
object_generic_hall.creature object_generic_hall.creature
object_giant_skull.creature object_giant_skull.creature
object_homin_body_fyros_F.creature
object_homin_body_fyros_H.creature
object_homin_body_matis_F.creature
object_homin_body_matis_H.creature
object_homin_body_tryker_F.creature
object_homin_body_tryker_H.creature
object_homin_body_zorai_F.creature
object_homin_body_zorai_H.creature
object_house_ruin.creature object_house_ruin.creature
object_hut.creature object_hut.creature
object_jar.creature object_jar.creature
@ -2846,10 +2837,6 @@ object_kitin_egg.creature
object_landslide_desert.creature object_landslide_desert.creature
object_landslide_jungle.creature object_landslide_jungle.creature
object_landslide_lake.creature object_landslide_lake.creature
object_merchant_RM_fyros.creature
object_merchant_RM_matis.creature
object_merchant_RM_tryker.creature
object_merchant_RM_zorai.creature
object_merchant_armor_fyros.creature object_merchant_armor_fyros.creature
object_merchant_armor_matis.creature object_merchant_armor_matis.creature
object_merchant_armor_tryker.creature object_merchant_armor_tryker.creature

File diff suppressed because it is too large Load Diff

@ -191,10 +191,6 @@ for curse in curseSpec:
meleeReferenceHitRate = 2.5 # 2h long sword, hits per 10s meleeReferenceHitRate = 2.5 # 2h long sword, hits per 10s
meleeReferenceDmg = 1.0 # 2h long sword meleeReferenceDmg = 1.0 # 2h long sword
regenTimeMin = 25.0 # in seconds, at lowest level
regenTimeMax = 100.0 # in seconds, at max level
regenTimeSittingMax = 25.0
egsMinDamage = None egsMinDamage = None
egsDamageStep = None egsDamageStep = None
def printEgsConfiguration(): def printEgsConfiguration():

@ -0,0 +1,241 @@
import os, zlib
from balancing_config import *
folder = r"R:\leveldesign\game_elem\creature\npc\ring"
if not os.path.isdir(folder):
os.makedirs(folder)
# cuthroat_b_melee_b_m_f.creature
# cuthroat_b_range_a_t_f.creature
# cuthroat_b, melee/range, a/b/c, f/m/t/z (race), h/f (gender)
# not used
# fyros_guard_l_c_f
# matis_guard_l_f_h
# fyros/matis/tryker/zorai (race), guard_l, b/c/d/e/f (level range), h/f (gender)
# not used
# ring_civil_light_melee_blunt_b4: civilian
# ring_guard_melee_tank_blunt_c3: guard
# ring_light_melee_blunt_c3: milicia, light armor
# ring_melee_damage_dealer_slash_b2: armsman, medium armor
# ring_melee_tank_blunt_d2: warrior, heavy armor
# ring_magic_damage_dealer_acid_d3: elementalist
# ring_magic_aoe_acid_c4: devastator
# ring_magic_curser_blind_d1: illusionist, tormentor
# ring_healer_b2 (b/c/d/e/f2 only)
# not used
# protections are 0 to 100, more melee protection for melee, and more magic protection for magic
# resists are all same as level, varied using level variance
types = {
"ring_civil_light_melee": { "action": "combat_melee", "levelOffset": 0, "attackOffset": 0, "defenseOffset": 0, "xpGain": 1.0, "hpFactor": 0.5, "attackFactor": 0.5, "meleeProtection": 20, "magicProtection": 20, "parent": "fyhc3.creature" }, # civilian
"ring_guard_melee_tank": { "action": "combat_melee", "levelOffset": 20, "attackOffset": 0, "defenseOffset": 0, "xpGain": 2.0, "hpFactor": 4.0, "attackFactor": 2.0, "meleeProtection": 60, "magicProtection": 60, "parent": "fyha3.creature" }, # guard
"ring_light_melee": { "action": "combat_melee", "levelOffset": 0, "attackOffset": 0, "defenseOffset": 0, "xpGain": 1.0, "hpFactor": 1.0, "attackFactor": 1.0, "meleeProtection": 20, "magicProtection": 20, "parent": "fyhc3.creature" }, # milicia
"ring_melee_damage_dealer": { "action": "combat_melee", "levelOffset": 0, "attackOffset": 6, "defenseOffset": -6, "xpGain": 1.5, "hpFactor": 0.5, "attackFactor": 2.0, "meleeProtection": 40, "magicProtection": 20, "parent": "fyhb3.creature" }, # armsman
"ring_melee_tank": { "action": "combat_melee", "levelOffset": 0, "attackOffset": -6, "defenseOffset": 6, "xpGain": 2.0, "hpFactor": 4.0, "attackFactor": 0.25, "meleeProtection": 60, "magicProtection": 20, "parent": "fyha3.creature" }, # warrior
"ring_magic_damage_dealer": { "action": "magic_damage", "levelOffset": 0, "attackOffset": 0, "defenseOffset": 0, "xpGain": 1.5, "hpFactor": 1.0 / boosts["magic"], "meleeProtection": 20, "magicProtection": 40, "parent": "fyhd3.creature" }, # elementalist
"ring_magic_aoe": { "action": "magic_aoe", "levelOffset": 0, "attackOffset": 0, "defenseOffset": 0, "xpGain": 1.0, "hpFactor": 1.0 / boosts["magic"], "meleeProtection": 20, "magicProtection": 20, "parent": "fyhd3.creature" }, # devastator
"ring_magic_curser": { "action": "magic_affliction", "levelOffset": 0, "attackOffset": 0, "defenseOffset": 0, "xpGain": 2.0, "hpFactor": 1.0 / boosts["magic"], "meleeProtection": 20, "magicProtection": 60, "parent": "fyhd3.creature" }, # illusionist, tormentor
}
xpVariance = 0.1
hpVariance = 0.1
attackTime = 3
attackTimeVariance = 0.2
attackVariance = 0.1
def randomValue(mod, seed):
rv = zlib.crc32(seed) & 0xffffffff
return rv % mod
def randomFloat(seed):
rv = zlib.crc32(seed) & 0xffffffff
return ((rv % 2000) * 1.0) / 2000.0
def varyFloat(value, variance, seed):
rv = randomFloat(seed)
rv = ((rv * 2.0) - 1.0) * variance
return value + (value * rv)
def varyLevel(level, seed):
rv = zlib.crc32("Level_" + seed + "_Level") & 0xffffffff
vrange = levelVariance[1] - levelVariance[0]
rv = rv % vrange
vmin = levelVariance[0]
rv = rv + vmin
res = level + rv
if res < 1:
res = 1
return res
def varyProtection(protection, seed):
rv = zlib.crc32("Protection_" + seed + "_Protection") & 0xffffffff
rv = rv % 10
rv = rv - 5
res = int(round(protection + (protection * rv * 0.01), 0))
if res < 0:
res = 0
if res > 100:
res = 100
return res
def randomMagic(seed):
rv = zlib.crc32("Magic_" + seed + "_Magic") & 0xffffffff
rv = rv % len(specialization["magic"])
return specialization["magic"][rv]
def writeNpcCreature(name, type, level, spec, actionlist):
baseLevel = levels[level] + types[type]["levelOffset"]
baseLevel = varyLevel(baseLevel, "Level_" + name)
attackLevel = varyLevel(baseLevel + types[type]["attackOffset"], "Attack_" + name)
defenseLevel = varyLevel(baseLevel + types[type]["defenseOffset"], "Defense_" + name)
avgLevel = int(round((attackLevel + defenseLevel) / 2, 0))
playerHpLevel = int(getScore(baseLevel) / 100.0)
hp = round(varyFloat(getScore(baseLevel), hpVariance, "life" + name) * types[type]["hpFactor"], 0)
regen = varyFloat(hp / regenTimeAi, hpVariance, "LifeRegen" + name)
totalTime = round(varyFloat(attackTime, attackTimeVariance, "AttackSpeed" + name), 1)
boost = boosts["melee"]
if "range" in type:
boost = boosts["range"]
attackFactor = 1.0
if "attackFactor" in types[type]:
attackFactor = types[type]["attackFactor"]
totalDamage = (getScore(baseLevel) * totalTime * boost * attackFactor) / combatTime
totalDamage = varyFloat(totalDamage, attackVariance, "NbHitToKillPlayer" + name)
hitsToKill = (playerHpLevel * 100.0) / totalDamage
with open(folder + "\\" + name + ".creature", "w") as f:
f.write("<?xml version=\"1.0\"?>\n")
f.write("<FORM Version=\"4.0\" State=\"modified\">\n")
f.write(" <PARENT Filename=\"" + types[type]["parent"] + "\"/>\n")
f.write(" <STRUCT>\n")
f.write(" <STRUCT Name=\"Basics\">\n")
f.write(" <ATOM Name=\"Fame\" Value=\"none\"/>\n")
# f.write(" <ATOM Name=\"Level\" Value=\"" + str(avgLevel) + "\"/>\n")
f.write(" <ATOM Name=\"NbPlayers\" Value=\"1\"/>\n")
f.write(" <ATOM Name=\"PlayerHpLevel\" Value=\"" + str(playerHpLevel) + "\"/>\n")
f.write(" <ATOM Name=\"NbHitToKillPlayer\" Value=\"" + str(hitsToKill) + "\"/>\n")
f.write(" <STRUCT Name=\"Characteristics\">\n")
f.write(" <ATOM Name=\"DynamicEnergyValue\" Value=\"0.002777778\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Equipment\">\n")
f.write(" <STRUCT Name=\"Body\">\n")
f.write(" <ATOM Name=\"Color\" Value=\"0\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Legs\">\n")
f.write(" <ATOM Name=\"Color\" Value=\"0\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Arms\">\n")
f.write(" <ATOM Name=\"Color\" Value=\"0\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Hands\">\n")
f.write(" <ATOM Name=\"Color\" Value=\"0\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Feet\">\n")
f.write(" <ATOM Name=\"Color\" Value=\"0\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Head\">\n")
f.write(" <ATOM Name=\"Color\" Value=\"0\"/>\n")
f.write(" </STRUCT>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"MovementSpeeds\">\n")
f.write(" <ATOM Name=\"WalkSpeed\" Value=\"1.66\"/>\n")
f.write(" <ATOM Name=\"RunSpeed\" Value=\"6\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <ATOM Name=\"life\" Value=\"" + str(int(hp)) + "\"/>\n")
f.write(" <ATOM Name=\"AttackSpeed\" Value=\"" + str(totalTime) + "\"/>\n")
f.write(" <ATOM Name=\"LifeRegen\" Value=\"" + str(regen) + "\"/>\n")
f.write(" <ATOM Name=\"AttackLevel\" Value=\"" + str(attackLevel) + "\"/>\n")
f.write(" <ATOM Name=\"DefenseLevel\" Value=\"" + str(defenseLevel) + "\"/>\n")
f.write(" <ATOM Name=\"XPLevel\" Value=\"" + str(baseLevel) + "\"/>\n")
f.write(" <ATOM Name=\"TauntLevel\" Value=\"" + str(varyLevel(baseLevel, "TauntLevel" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"RegionForce\" Value=\"" + str(getRegionForce(level)) + "\"/>\n")
f.write(" <ATOM Name=\"ForceLevel\" Value=\"" + str(getForceLevel(level)) + "\"/>\n") # TODO
if "magic" in type:
f.write(" <ATOM Name=\"DodgeAsDefense\" Value=\"true\"/>\n")
else:
f.write(" <ATOM Name=\"DodgeAsDefense\" Value=\"false\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"3d data\">\n")
f.write(" <ATOM Name=\"Scale\" Value=\"1\"/>\n")
f.write(" <ATOM Name=\"ForceDisplayCreatureName\" Value=\"false\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Properties\">\n")
f.write(" <ATOM Name=\"LootHarvestState\" Value=\"NONE\"/>\n")
f.write(" <ATOM Name=\"XPGainCoef\" Value=\"" + str(round(varyFloat(types[type]["xpGain"], xpVariance, "XPGainCoef" + name), 2)) + "\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Protections\">\n")
f.write(" <ATOM Name=\"PiercingFactor\" Value=\"" + str(varyProtection(types[type]["meleeProtection"], "PiercingFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"SlashingFactor\" Value=\"" + str(varyProtection(types[type]["meleeProtection"], "SlashingFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"BluntFactor\" Value=\"" + str(varyProtection(types[type]["meleeProtection"], "BluntFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"RotFactor\" Value=\"" + str(varyProtection(types[type]["magicProtection"], "RotFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"AcidFactor\" Value=\"" + str(varyProtection(types[type]["magicProtection"], "AcidFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"ColdFactor\" Value=\"" + str(varyProtection(types[type]["magicProtection"], "ColdFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"FireFactor\" Value=\"" + str(varyProtection(types[type]["magicProtection"], "FireFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"PoisonFactor\" Value=\"" + str(varyProtection(types[type]["magicProtection"], "PoisonFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"ElectricityFactor\" Value=\"" + str(varyProtection(types[type]["magicProtection"], "ElectricityFactor" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"ShockFactor\" Value=\"" + str(varyProtection(types[type]["magicProtection"], "ShockFactor" + name)) + "\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Resists\">\n")
f.write(" <ATOM Name=\"Fear\" Value=\"" + str(varyLevel(baseLevel, "Fear" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Sleep\" Value=\"" + str(varyLevel(baseLevel, "Sleep" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Stun\" Value=\"" + str(varyLevel(baseLevel, "Stun" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Root\" Value=\"" + str(varyLevel(baseLevel, "Root" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Blind\" Value=\"" + str(varyLevel(baseLevel, "Blind" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Snare\" Value=\"" + str(varyLevel(baseLevel, "Snare" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Slow\" Value=\"" + str(varyLevel(baseLevel, "Slow" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Acid\" Value=\"" + str(varyLevel(baseLevel, "Acid" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Cold\" Value=\"" + str(varyLevel(baseLevel, "Cold" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Electricity\" Value=\"" + str(varyLevel(baseLevel, "Electricity" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Fire\" Value=\"" + str(varyLevel(baseLevel, "Fire" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Poison\" Value=\"" + str(varyLevel(baseLevel, "Poison" + name)) + "\"/>\n")
f.write(" <ATOM Name=\"Rot\" Value=\"" + str(varyLevel(baseLevel, "Rot" + name)) + "\"/>\n")
f.write(" </STRUCT>\n")
if "magic" in types[type]["action"]:
f.write(" <ATOM Name=\"action_cfg\" Value=\"0010f\"/>\n")
f.write(" <ARRAY Name=\"nuke_cfg\">\n")
f.write(" <ATOM Value=\"" + actionlist + "\"/>\n")
f.write(" </ARRAY>\n")
else:
f.write(" <ATOM Name=\"action_cfg\" Value=\"1000f\"/>\n")
f.write(" <ARRAY Name=\"melee_cfg\">\n")
f.write(" <ATOM Value=\"" + actionlist + "\"/>\n")
f.write(" </ARRAY>\n")
f.write(" <ATOM Name=\"creature_level\" Value=\"" + str(avgLevel) + "\"/>\n")
f.write(" </STRUCT>\n")
f.write("</FORM>\n")
f.flush()
for type in types:
for level in levels:
if "combat" in types[type]["action"]:
for spec in specialization["melee"]:
sn = spec
if sn == "piercing":
sn = "pierce"
if sn == "slashing":
sn = "slash"
name = type + "_" + sn + "_" + level
writeNpcCreature(name, type, level, spec, types[type]["action"] + ".actionlist") # TODO: Specialized melee (blunt adds chance for stun, slash adds chance for extra damage, pierce adds chance to go through armor, 1:9 action list)
elif types[type]["action"] == "magic_affliction":
for spec in specialization["curse"]:
name = type + "_" + spec + "_" + level
magic = randomMagic(name)
writeNpcCreature(name, type, level, spec, types[type]["action"] + "_" + spec + "_" + magic + ".actionlist") # TODO: Specialized melee (blunt adds chance for stun, slash adds chance for extra damage, pierce adds chance to go through armor, 1:9 action list)
elif "magic" in types[type]["action"]:
for spec in specialization["magic"]:
name = type + "_" + spec + "_" + level
writeNpcCreature(name, type, level, spec, types[type]["action"] + "_" + spec + ".actionlist") # TODO: Specialized melee (blunt adds chance for stun, slash adds chance for extra damage, pierce adds chance to go through armor, 1:9 action list)
# end of file

@ -0,0 +1,91 @@
import os, zlib
folder = r"R:\leveldesign\game_elem\creature\npc\3dset"
if not os.path.isdir(folder):
os.makedirs(folder)
matrix = [
{ "fy": "fyros", "ma": "matis", "tr": "tryker", "zo": "zorai" },
{ "f": "female", "h": "female" },
{ "a": "ah", "b": "am", "c": "al", "d": "ac" },
{ 1: "", 2: "_2", 3: "_3" },
{ "": 0, "mid": 1, "old": 2 },
]
texture = [
"Lacustre/Low Quality/Young",
"Desert/Medium Quality/Normal",
"Jungle/High Quality/Old",
]
# ic t ah b _2
def randomValue(mod, seed):
rv = zlib.crc32(seed) & 0xffffffff
return rv % mod
for race in matrix[0]:
for gender in matrix[1]:
for armor in matrix[2]:
for quality in matrix[3]:
for age in matrix[4]:
itemPrefix = "ic" + matrix[0][race][0] + matrix[2][armor]
itemPrefixPants = itemPrefix
if armor == "d":
itemPrefix = "ic" + matrix[0][race][0] + "al"
itemSuffix = matrix[3][quality] + ".sitem"
itemTexture = texture[quality - 1]
visageTexture = texture[matrix[4][age]]
visageName = race + "_visage.sitem"
setName = race + gender + armor + str(quality) + age + ".creature"
hairColor = randomValue(6, "HairColor_" + setName) + 1
eyesColor = randomValue(8, "EyesColor_" + setName) + 1
parentName = "_" + matrix[0][race] + "_" + matrix[1][gender] + ".creature"
with open(folder + "\\" + setName, "w") as f:
f.write("<?xml version=\"1.0\"?>\n")
f.write("<FORM Version=\"4.0\" State=\"modified\">\n")
f.write(" <PARENT Filename=\"" + parentName + "\"/>\n")
f.write(" <STRUCT>\n")
f.write(" <STRUCT Name=\"Basics\">\n")
f.write(" <ATOM Name=\"Fame\" Value=\"" + matrix[0][race] + "\"/>\n")
f.write(" <STRUCT Name=\"Equipment\">\n")
f.write(" <STRUCT Name=\"Body\">\n")
f.write(" <ATOM Name=\"Item\" Value=\"" + itemPrefix + "v" + itemSuffix + "\"/>\n")
f.write(" <ATOM Name=\"Texture\" Value=\"" + itemTexture + "\"/>\n")
f.write(" <ATOM Name=\"Color\" Value=\"White\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Legs\">\n")
f.write(" <ATOM Name=\"Item\" Value=\"" + itemPrefixPants + "p" + itemSuffix + "\"/>\n")
f.write(" <ATOM Name=\"Texture\" Value=\"" + itemTexture + "\"/>\n")
f.write(" <ATOM Name=\"Color\" Value=\"White\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Arms\">\n")
f.write(" <ATOM Name=\"Item\" Value=\"" + itemPrefix + "s" + itemSuffix + "\"/>\n")
f.write(" <ATOM Name=\"Texture\" Value=\"" + itemTexture + "\"/>\n")
f.write(" <ATOM Name=\"Color\" Value=\"White\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Hands\">\n")
f.write(" <ATOM Name=\"Item\" Value=\"" + itemPrefix + "g" + itemSuffix + "\"/>\n")
f.write(" <ATOM Name=\"Texture\" Value=\"" + itemTexture + "\"/>\n")
f.write(" <ATOM Name=\"Color\" Value=\"White\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Feet\">\n")
f.write(" <ATOM Name=\"Item\" Value=\"" + itemPrefix + "b" + itemSuffix + "\"/>\n")
f.write(" <ATOM Name=\"Texture\" Value=\"" + itemTexture + "\"/>\n")
f.write(" <ATOM Name=\"Color\" Value=\"White\"/>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"Face\">\n")
f.write(" <ATOM Name=\"Item\" Value=\"" + visageName + "\"/>\n")
f.write(" <ATOM Name=\"Texture\" Value=\"" + visageTexture + "\"/>\n")
f.write(" <ATOM Name=\"Color\" Value=\"Beige\"/>\n")
f.write(" </STRUCT>\n")
f.write(" </STRUCT>\n")
f.write(" </STRUCT>\n")
f.write(" <STRUCT Name=\"3d data\">\n")
f.write(" <ATOM Name=\"HairColor\" Value=\"Color " + str(hairColor) + "\"/>\n")
f.write(" <ATOM Name=\"EyesColor\" Value=\"Color " + str(eyesColor) + "\"/>\n")
f.write(" </STRUCT>\n")
f.write(" </STRUCT>\n")
f.write("</FORM>\n")
f.flush()

@ -1,9 +1,40 @@
import os
sitemPath = "R:\\leveldesign\\game_elem\\creature"
fileMap = {}
def listPathExt(path, ext):
for p in os.listdir(path):
fp = path + "\\" + p
if os.path.isdir(fp):
listPathExt(fp, ext)
elif os.path.isfile(fp):
if fp.lower().endswith(ext):
fileMap[p] = fp
listPathExt(sitemPath, ".creature")
knownMissing = {}
with open("missing_sheets.txt", "r") as r:
for l in r:
knownMissing[l.strip()] = True
with open("creature_list.txt", "w") as w: with open("creature_list.txt", "w") as w:
with open("creature_list_r2.txt", "r") as r: with open("creature_missing.txt", "w") as wm:
for l in r: with open("creature_list_r2.txt", "r") as r:
w.write(l) for l in r:
with open("creature_list_wk.txt", "r") as r: if not l.strip() in knownMissing:
for l in r: w.write(l)
if len(l.strip()) > 0 and not l.startswith(";"): if not l.strip() in fileMap:
w.write(l) wm.write(l)
with open("creature_list_wk.txt", "r") as r:
for l in r:
if len(l.strip()) > 0 and not l.startswith(";"):
if not l.strip() in knownMissing:
w.write(l)
if not l.strip() in fileMap:
wm.write(l)
wm.flush()
w.flush()

Loading…
Cancel
Save