<< Creating Slayer’s Ban Hammer from scratch – The TRE
object_weapon_melee_2handed_custom_banhammer = object_weapon_melee_2handed_custom_shared_banhammer:new { playerRaces = { "object/creature/player/bothan_male.iff", "object/creature/player/smc_female.iff", "object/creature/player/smc_male.iff", "object/creature/player/talz_male.iff", "object/creature/player/talz_female.iff", "object/creature/player/togruta_female.iff", "object/creature/player/togruta_male.iff", "object/creature/player/weequay_male.iff", "object/creature/player/weequay_female.iff", "object/creature/player/nautolan_male.iff", "object/creature/player/nautolan_female.iff", "object/creature/player/nightsister_female.iff", "object/creature/player/nightsister_male.iff", "object/creature/player/nikto_male.iff", "object/creature/player/nikto_female.iff", "object/creature/player/quarren_male.iff", "object/creature/player/quarren_female.iff", "object/creature/player/ishi_tib_male.iff", "object/creature/player/ishi_tib_female.iff", "object/creature/player/hutt_female.iff", "object/creature/player/hutt_male.iff", "object/creature/player/gran_male.iff", "object/creature/player/gran_female.iff", "object/creature/player/gotal_male.iff", "object/creature/player/gotal_female.iff", "object/creature/player/aqualish_female.iff", "object/creature/player/aqualish_male.iff", "object/creature/player/bith_female.iff", "object/creature/player/bith_male.iff", "object/creature/player/chiss_female.iff", "object/creature/player/chiss_male.iff",
"object/creature/player/devaronian_female.iff", "object/creature/player/devaronian_male.iff", "object/creature/player/bothan_female.iff", "object/creature/player/bothan_male.iff", "object/creature/player/human_male.iff", "object/creature/player/human_female.iff", "object/creature/player/ithorian_male.iff", "object/creature/player/ithorian_female.iff", "object/creature/player/moncal_male.iff", "object/creature/player/moncal_female.iff", "object/creature/player/rodian_male.iff", "object/creature/player/rodian_female.iff", "object/creature/player/sullustan_male.iff", "object/creature/player/sullustan_female.iff", "object/creature/player/trandoshan_male.iff", "object/creature/player/trandoshan_female.iff", "object/creature/player/twilek_male.iff", "object/creature/player/twilek_female.iff", "object/creature/player/wookiee_male.iff", "object/creature/player/wookiee_female.iff", "object/creature/player/zabrak_male.iff", "object/creature/player/zabrak_female.iff" }, attackType = MELEEATTACK, damageType = LIGHTSABER, armorPiercing = HEAVY,
xpType = "combat_meleespecialize_2handed",
certificationsRequired = { },
creatureAccuracyModifiers = { "2handed_accuracy" },
defenderDefenseModifiers = { "melee_defense" },
defenderSecondaryDefenseModifiers = { "counterattack" },
defenderToughnessModifiers = { "2handed_toughness" },
speedModifiers = { "2handed_speed" },
damageModifiers = { },
-- The values below are the default values. To be used for blue frog objects primarily
healthAttackCost = 1,
actionAttackCost = 1,
mindAttackCost = 1,
forceCost = 0,
pointBlankRange = 0,
pointBlankAccuracy = 100,
idealRange = 5,
idealAccuracy = 100,
maxRange = 5,
maxRangeAccuracy = 100,
minDamage = 10000,
maxDamage = 45000,
attackSpeed = 0.1,
woundsRatio = 100,
numberExperimentalProperties = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalProperties = {"XX", "XX", "SR", "SR", "SR", "SR", "SR", "SR", "SR", "XX", "SR", "XX", "SR", "SR", "SR"},
experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "exp_durability", "expRange", "expRange", "null", "expRange", "null", "expEffeciency", "expEffeciency", "expEffeciency"},
experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "hitpoints", "zerorangemod", "maxrangemod", "midrange", "midrangemod", "maxrange", "attackhealthcost", "attackactioncost", "attackmindcost"},
experimentalMin = {0, 0, 1000, 10000, 0.1, 10, 10000, 10, 10, 25, 10, 50, 0, 0, 0},
experimentalMax = {0, 0, 10000, 100000, 1.0, 100, 100000, 100, 100, 45, 100, 100, 0, 0, 0},
experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_weapon_melee_2handed_custom_banhammer, "object/weapon/melee/2handed/custom/banhammer.iff")
The first line :
object_weapon_melee_2handed_custom_banhammer = object_weapon_melee_2handed_custom_shared_banhammer:new {
the next statement defines the player species that can use this weapon. after that we have 3 lines
attackType = MELEEATTACK,
damageType = LIGHTSABER,
armorPiercing = HEAVY,
as this is the admin Banhammer we’ve set them to uber values.
certificationsRequired = { },
creatureAccuracyModifiers = { "2handed_accuracy" },
defenderDefenseModifiers = { "melee_defense" },
defenderSecondaryDefenseModifiers = { "counterattack" },
defenderToughnessModifiers = { "2handed_toughness" },
speedModifiers = { "2handed_speed" },
damageModifiers = { },
-- The values below are the default values. To be used for blue frog objects primarily
healthAttackCost = 1,
actionAttackCost = 1,
mindAttackCost = 1,
forceCost = 0,
pointBlankRange = 0,
pointBlankAccuracy = 100,
idealRange = 5,
idealAccuracy = 100,
maxRange = 5,
maxRangeAccuracy = 100,
minDamage = 10000,
maxDamage = 45000,
attackSpeed = 0.1,
woundsRatio = 100,
as it’s admin, again, we’ve removed any requirement to be certified for this weapon. The modifiers are pretty irrelevant here as the weapon’s not going to be used in real combat, but you can examine other weapons’ modifiers and see how they work.
The next part, I’ll freely admit, I’m not sure why it’s here, as the experimental values are usually part of the draft schematic for when the weapon is crafted.
numberExperimentalProperties = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalProperties = {"XX", "XX", "SR", "SR", "SR", "SR", "SR", "SR", "SR", "XX", "SR", "XX", "SR", "SR", "SR"},
experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "exp_durability", "expRange", "expRange", "null", "expRange", "null", "expEffeciency", "expEffeciency", "expEffeciency"},
experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "hitpoints", "zerorangemod", "maxrangemod", "midrange", "midrangemod", "maxrange", "attackhealthcost", "attackactioncost", "attackmindcost"},
experimentalMin = {0, 0, 1000, 10000, 0.1, 10, 10000, 10, 10, 25, 10, 50, 0, 0, 0},
experimentalMax = {0, 0, 10000, 100000, 1.0, 100, 100000, 100, 100, 45, 100, 100, 0, 0, 0},
experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}
and finally, the bit that adds the weapon template and tells the server what these values apply to
ObjectTemplates:addTemplate(object_weapon_melee_2handed_custom_banhammer, "object/weapon/melee/2handed/custom/banhammer.iff")
Ok, so we’ve created a text file on the server.
The server now needs to include it in its system edit a file called serverobjects.lua in the same folder as the file you’ve just created. Add the following line :
includeFile("custom_content/weapon/melee/2handed/custom/banhammer.lua")
this tells the server to include your weapon object.
However, the server doesn’t yet know about the serverobjects.lua file, so in each folder above this one, we need another serverobjects.lua file that points to the one below it.
bin/scripts/objects/custom_content/weapon/melee/2handed/serverobjects.lua needs to contain a line such as
includeFile("custom_content/weapon/melee/2handed/custom/serverobjects.lua")
bin/scripts/objects/custom_content/weapon/melee/serverobjects.lua needs to contain a line such as
includeFile("custom_content/weapon/melee/2handed/serverobjects.lua")
bin/scripts/objects/custom_content/weapon/serverobjects.lua needs to contain a line such as
includeFile("custom_content/weapon/melee/serverobjects.lua")
bin/scripts/objects/custom_content/serverobjects.lua needs to contain a line such as
includeFile("custom_content/weapon/serverobjects.lua")
bin/scripts/objects/serverobjects.lua needs to contain a line such as
includeFile("custom_content/serverobjects.lua")
and so on. Most of these will already be in place in the future.
The next file to create is the objects.lua file, in the same folder as your new weapon object file. If you ware working in a folder which already has objects in it, then this file will most likely already exist. into this file goes the following information:
object_weapon_melee_2handed_custom_shared_banhammer = SharedWeaponObjectTemplate:new {
clientTemplateFileName = "object/weapon/melee/2handed/custom/shared_banhammer.iff"
}
ObjectTemplates:addClientTemplate(object_weapon_melee_2handed_custom_shared_banhammer, "object/weapon/melee/2handed/custom/shared_banhammer.iff")
That’s it for declaring the TANO for the new weapon.