Weapons are a class of items that are a primary feature of the Transcendence universe. They come in many varieties and flavors, and modding new weapons can be very enjoyable.
The first thing to understand about weapons is that they are items, which means that they use the same format as the other items, with the addition of a weapon element in the item element:
Code: Select all
<ItemType UNID="&unid;"
***standard item attributes here***
>
<Image imageID="&rsItems1;" imageX="96" imageY="0" imageWidth="96" imageHeight="96"/>
<Weapon
***weapon specific attributes here***
>
***weapon sub-elements here***
</Weapon>
</ItemType>
When I highlight something in green, it is because it is an attribute or parameter from the element I am discussing. For instance if I am describing the usage of an item name, I would show name = "[string]" which represents the actual xml attribute. I will include case and formatting for most samples like this.
When I place ***[text]*** in a code container around a line of text, it is because I have removed code for brevity, as in the above example.
When I use [] to surround a word such as the above [string], it means that you would replace that with the correct type of usage- in the case of a string, that means that you would place a string in there for the name, such as name = "Periculi Hyper-Omni-Mega-MaxiDestroyer Cannon"
When I use [n] that indicates a number value is required, and I will usually give the range if there is one: [n 1-10] means any number between 1 and 10.
I have put together a list reference of the weapon elements and attributes that I found in various places in the xml files, that you can look at in this post. I will be explaining these weapon parameters in the sections below in more detail.
This is a tutorial about the Weapon element, to begin modding new weapons it is assumed that you have an understanding of basic item element structures and what is required to place them in the game through extensions.
Firstly, in order to best explain weapons I will be breaking this tutorial into sections that deal with the weapon classes in the game.
Weapon Classes
Weapons have some basic classes that define the properties of the weapon and provide guidelines to what is expected in the <Weapon> element.
These basic weapon classes are:
Beam Weapons - there are many beam weapons in the game, it one of the most common weapon types.
Particle Weapons - There are 3 weapons in the vanilla game that use this class. Particle weapon fire is many small particles often spreading out as the go, and can therefore be very deadly.
Missile Weapons - there are many missile weapons in the game, and the missiles come in a wide variety from cannon shot to rockets to mines.
Area Weapons - there are only a few of these in the game, and for good reason- they can be very devastating! The Domina powers are the easiest way for the player to find an area based weapon, although many missiles and mines make use of an area effect when they explode.
In the weapon element you will always find the attribute type. This refers to the basic weapon class, so you can have either:
type = "beam" or
type = "particles" or
type = "missile" or
type = "area"
And nothing else will do for that attribute.
Common Attributes
There are attributes that all weapon classes share, beyond the usual item attributes.
Installation Types
Weapons must be installed to use. This isn't an actual attribute in the weapon element but it is an important part of weapons, because:
Installed weapons come in two flavors: Primary and Launcher.
Primary installation allows multiple weapons and you can switch them with the W key. Primary installation is the default type of installation.
Playerships can only install one Launcher weapon at a time,
but launcher style weapons can have multiple ammo types that you cycle
through with the Tab. I will explain launcher weapons further into this tutorial.
A weapon that is a launcher style weapon must have this attribute:
launcher = "true". Any type of weapon can be given this attribute, even though all the launchers in the game are currently 'missile' launcher types.
Device Slots
Device Slots - all weapons use device slots, and unless specifically defined in the weapon element, 1 slot is used. To alter the default use of 1 slot place deviceSlots = "[n]" in the weapon element with a number that represents the slots you wish to use. This number can also be a 0, so no slots get used.
Charges
Charges - any weapon can make use of a charge limitation. Charge number and maxCharges can be defined in the item attributes and the attribute charges = "true" added in the weapon element.
Counters
There are two types of counters that I have found, and they use a set of attributes to determine the counter effect:
counter = "[string]"
counterActivate = "[n]"
counterUpdate = "[n]"
counterUpdateRate = "[n]"
The two types of counters are temperature and capacitor. Both counters place an additional graphic on screen in the center bottom of the HUD when they are in effect. Temperature counters reflect overheating and if the counter goes too high, the weapon can get damaged.
Capacitor counters reflect energy stored in the weapon. The weapon cannot fire continuosly, and when the capacitor is empty it shoots with a very low fireRate.
Counter activate sets a number for starting the counter, depending on the type of counter. I believe they both correspond to weapon shots.
Counter update is a time delay to update (reduce temperature or raise capacitor level). Update rate is the amount on the counter to alter it by for the update cycle.
Configuration
Weapons can use a variety of configurations which control the weapon fire pattern. Configurations can be defined using two different methods: The configuration = "[string]" value is an easy alternative to using the <Configuration> element. I will discuss the <Configuration> element later, for now I will explain a little about the configuration attribute for the <weapon> tag. I found these stock configurations:
dual - this is what makes dual weapons have two shots. The distance between the weapon fire is set.
alternating This is much like a dual weapon shot, but alternates one side to the other for each shot.
wall This produces a 'wall' of weapon shots, travels in a straight line from the source
spread[n] {2 - 5} range for the [n]. The spread weapon fire has an angle applied to the multiple shots that is set for the spread value.
Omni Directional
Any weapon can be given the omni-directional attribute, which allows it to auto-target and fire in any direction. This attribute is: omnidirectional = "true". Omni weapons have a great advantage over normal directional weapons, and are adjusted in the game to be either higher levels than the normal weapon they represent, or less powerful versions of the normal weapon.
(it isn't a common attribute, really- Area weapons don't need the omnidirectional attribute because they cover areas!)
Multi Target
In weapons that fire more than a single shot, the multiTarget = "true" attribute can be set to allow the weapon fire to target more than one target. When applied to a spread3 such as with the IM90 type weapon, each of the 3 shots can seek it's own target if there is one available.
Repeating
Weapons can have the repeating = "[n]" attribute set to fire more than one shot when the trigger is pulled. This stacks with any spread or configuration effects.
Recoil
Weapons can have a recoil effect applied through the attribute recoil = "[n]" I am unsure what the value represents, does anyone know? (most recoil weapons I found had low recoil values such as 2 or 3 - it may be similar to the damage effects table, see below)
Damage -
This is one of the most important weapon attributes, but not all weapons use this attribute in the same fashion. I will explain more about the usage of Damage in weapons in the weapon class explanations, but all the weapons share the same 16 damage values, and can make use of the additional damage effects.
The 16 basic damage types in the game are found in Transcendence xml and are:
Code: Select all
DAMAGE TYPES
laser
kinetic
particle
blast
ion
thermo
positron
plasma
antimatter
nano
graviton
singularity
dark acid
dark steel
dark lightning
dark fire
Whenever you see damage = it is expecting a certain format to be entered. This format is: damage = "[type]:[dice]; [effect]"
[type] must be one of the sixteen types listed above. When placing dark matter damage types in the [type], the format is darkAcid, darkSteel, darkLightning, darkFire. All the other types use the format they are shown in in the code box above.
[dice] expects one of several things- you can have just a number in there such as 1. And the weapon will have a base damage of 1. You can put a dice range in the format [n]d
Damage doesn't need anything other than [type] and [dice] to function well, but there are the additional damage effects which can be applied, and even multiple ones can be applied, separated by a ;.
Like this: damage = "laser:2d10+2; mining3; WMD1; EMP1;" (nice laser, bro)
Damage Effects -
The damage effects that I have found are:
WMD[n] - Weapon of Mass Destruction effect targets station hulls and can destroy wrecks
[quote="digdug"]* WMD0 = 0%
* WMD1 = 4%
* WMD2 = 10%
* WMD3 = 20%
* WMD4 = 34%
* WMD5 = 52%
* WMD6 = 74%
* WMD7 = 100%
The WMD value is used only against stations with multiHull="true", wrecks, and ships with "non-critical" armor segments.
[/quote]
momentum[n] - this effect pushes the target, imparting momentum based on the [n] of the damage amount.
radiation[n] - this effect irradiates the target
EMP[n] - this effect can stun ships
mining[n] - this effect is used for mining from minable targets.
device[n] - this effect will destroy or damage internal devices
disintegration[n] - now you see it, *poof*, now you don't.
shatter[n] - this is a new effect in the Domina powers set. similar to disintegrate, causes targets to "shatter".
I am going to go with digdug's explanation of WMD[n] damage ratios transferred for the special effects unless someone with more experience modding weapons corrects this factor. According to this definition, only values 1 through 7 are used. I have included a quote above that you can use as reference for the effects.
There may be more effects, let me know if you discover something that I missed!
Fire Rate -
Weapon fire has a delay that defines how fast the weapon can be fired. This attribute is fireRate = "[n]". The lower the number is the faster the weapon will fire. All weapons need this attribute to be included in the weapon element. The value is pause time in ticks between 2 shots of the weapon.
(found by Betel) To get the firerate per second as displayed ingame you have to:
60/firerate = firerate per second
if the firerate is odd, add 1 to the firerate (so a firerate of 9 is the same as a firerate of 10)
Life Time-
Weapon fire also has a governing life time attribute, that is combined with it's speed to establish the weapon range. Launcher style missile weapons do not use the life time attribute in the weapon element, but they do it in the missile being fired instead. This attribute is lifetime = "[n]". The higher the number the longer the weapon fire will remain active. The value is in ticks.
A weapon of speed 100 travels in Transcendence space at 2 ls/tick.
With this it's possible to calculate the travel distance of any weapon accurately.
Power Use -
Like most every other installed device, weapons make use of a power usage attribute. This attribute governs the power used when the weapon is fired, although there seems to be a little power usage when weapons are idle. This attribute is powerUse = "[n]". The value is in hundredth of kilowatts, so a value of "50" means 5MW.
Placement
All of the above listed attributes would go in the <Weapon> element like this:
[code]
<Weapon
type = "beam"
damage = "darkFire:10d25; WMD9; EMP9; mining9; shatter2"
fireRate = "20"
lifetime = "40"
charges = "true"
powerUse = "4000"
>
[/code]
Notice that all these attributes are inside the weapon <Weapon > itself. This is important! These attributes are a part of the weapon , which can also have sub elements between the opening and closing tags.
And that's about all the shared attributes of weapons. Now we need to look into the specifics of the weapon classes, in the series of posts below.