About this mod
A framework that enables people to create their own armed vehicles with ease and minimal configuration.
Vehicles will be able to mount an array of weapons from simple machine guns to artillery launchers with ease, each with their own weapon zoom, ammo capacities, and ammo types. Including penetration mechanics.
- Requirements
- Permissions and credits
- Changelogs
Description:
A framework that enables people to create their own armed vehicles with ease and minimal configuration.
Vehicles will be able to mount an array of weapons from simple machine guns to artillery launchers with ease, each with their own weapon zoom, ammo capacities, and ammo types. Including penetration mechanics.
This will work with any AVF compatible vehicle in any loaded map, provided that they are configured correctly.
Player enabled overrides allow users to modify almost any available weapon parameter to their needs.
INSTALLATION:
- ensure you have the latest experimental version of teardown (5.1 at this time), this will not work on any version <5.1.
- copy the AVF folder into your documents/teardown/mods/ folder.
- ensure that you activate it as a global mod in the mod tree, this will ensure any AVF compatible vehicle will function as intended. See fig below
quick install video:
CONTROLS:
- fire = "lmb",
- sniper Mode = "rmb",
- elevate Gun = "c",
- depress Gun = "x",
- change Weapons = "r",
- change Ammunition = "f",
- deploy Smoke = "g",
- lock Angle = "j",
- lock Rotation = "k",
Demo video of functionality:
Simple vehicle config:
To prepare your armed vehicle, this framework follows this simple concept: A vehicle has a body, a body has a chassis, and a body also may have a turret joint connected to a turret.
A vehicle body and / or a turret may then be connected to a gun joint, so long as a gunjoint is connected to your guns barrel then this script can find it.
a gun joint typically being a vertical hinge that goes up and down.
Quick config for a vehicle is as follows:
add inside tags=""
vehicle -> cfg=vehicle
body -> component=body
vox (for vehicle body) -> component=chassis
vox (for turret) -> component=turret turretGroup=mainTurret
joint (for turret joint) ->component=turretJoint
vox (for gun) -> component=gun weaponType=2A46M group=primary
vox (for gun joint) -> component=gunJoint
This will define a simple tank using a 2A46M tank gun.
The logic for this mod is as follows: You have a vehicle with a body. That body would have a main chassis, this chassis then may have joints connecting to guns, called gunJoints, and then joints connected to turrets, called "turretJoints", these "turretJoints" then may have further "turretJoints" and more importantly "gunJoints".
The below image defines how a T90 Tank is defined, with a Turret that has smoke grenade capacity on the main turret, alongside a weapon defined for the 2A46 tank gun. This gun is also configured for the gun name to show as "BAD_BOY_DISCO", and changing the first magazine of the gun from the original 125mm heat to APHR. Users can also change many other values from gun rpm, sounds, projectile velocity, calibre, tracer style, penetration depth, etc.
the first and fastest step to configure your own vehicle may be to copy the structure of the contents of the "tags=""" parts of this image onto your vehicle.
Key words for this tool are always
cfg=vehicle - tells the script that this is a player vehicle
component= - tells the script what part of the vehicle this is
@SOMETHING - the override value.
Overrides:
Simple overrides are performed by override key placed in vehicle tags, ex: tags="component=gun weaponType=2A46M group=primary t90Gun_1
@name=Bad_Boy_Disco"
would define a weapon of type 2A46M to the primary weapon group with the name "Bad_Boy_Disco"
full override list:
name = "name",
weaponType = "weaponType",
default = "default",
magazines = {
name = "name",
magazineCapacity = "magazineCapacity",
magazineCount = "magazineCount"
},
loadedMagazine = "loadedMagazine",
barrels =
{
x="x",
y="y",
z="z",
},
backBlast = {
z = "z",
force = "force"
},
sight = {
x="x",
y="y",
z="z",
},
multiBarrel = "multiBarrel",
canZoom = "canZoom",
fireControlComputer = "fireControlComputer",
zoomSight = "zoomSight",
aimReticle = "aimReticle",
highVelocityShells = "highVelocityShells",
cannonBlast = "cannonBlast",
RPM = "RPM",
reload = "reload",
recoil = "recoil",
dispersion = "dispersion",
gunRange = "gunRange",
gunBias = "gunBias",
elevationSpeed = "elevationSpeed",
smokeFactor = "smokeFactor",
smokeMulti = "smokeMulti",
soundFile = "soundFile",
mouseDownSoundFile = "mouseDownSoundFile",
loopSoundFile = "loopSoundFile",
tailOffSound = "tailOffSound",
reloadSound = "reloadSound",
reloadPlayOnce = "reloadPlayOnce",
Full Ammo Override List:
name = "name",
caliber = "caliber",
velocity = "velocity",
timeToLive = "timeToLive",
launcher = "launcher",
payload = "payload",
shellWidth = "shellWidth",
shellHeight = "shellHeight",
r = "r",
g = "g",
b = "b",
tracer = "tracer",
tracerL = "tracerL",
tracerW = "tracerW",
tracerR = "tracerR",
tracerG = "tracerG",
tracerB = "tracerB",
shellSpriteName = "shellSpriteName",
shellSpriteRearName = "shellSpriteRearNameg",
magazineCapacity = "magazineCapacity",
magazineCount = "magazineCount",
explosionSize = "explosionSize",
maxPenDepth = "maxPenDepth",
flightLoop = "flightLoop",
USAGE IN XML:
for simple modification of a gun type, use the "@ITEM=VALUE" hotkey. Items that above that are enclosed in curly brackets - {} need an initializer.
Simple gun modification:
gun barrel modification ( works for gun barrels, backblasts) these work by having the keyword E.G @barrels followed by @barrels1x to change the x value of the first barrel location. gun sights work this way but only take values with 1 as only one gun sight per gun is supported
example Below changes the technical mg in the technical playgrounds gun location and changes the first magazine to use larger tracer rounds that are green.
<vox tags = "component=gun weaponType=DSHK group=primary
@barrels
@barrels1x=.3
@barrels1y=.5
@barrels1z=-.3
@magazine1_tracer=1
@magazine1_tracerL=6
@magazine1_tracerW=3
@magazine1_tracerR=0.1
@magazine1_tracerG=1.3
@magazine1_tracerB=0.1"
density="1.2" pos="0 1.6 -.9" strength="2" rot="0.0 0 0.0" file="LEVEL/technical.vox" object="MG" prop="true">
In theory, you would never need to edit any lua with this code. It is purely XML configs on any compatible vehicle. Through simple XML tags.
While Custom gun sights and sounds may be needed but it's best to embed them within the LEVEL and have a pointer to them in your xml tags.
If you have any custom sights, or sounds, or pre-configed weapons you would like added to the base mod then i would happily include them if you give me the basic info / files, provided you can ensure they would work in normal situations through xml config.
There also is included a custom lua config file which you can utilize by wrapping an editor instance of your vehicle in the script and then modifying the values in there with named keywords to add extra weapons to fit your vehicle.
This was largely made in a day, i may still be hungover, a better description of using this will be provided with potential video application later on when i get round to it. If you have an questions or notice any issues then please don't hesitate t contact me.
CUSTOM MAPS USING AVF