XvT Conversion 1.1 Readme
Some Intro
It took about a month to write most of the code for this conversion, but unfortunately, it takes a lot more than
code to make a good patch. I was hoping at the beginning to release just the cogs, and then let the users
add the models and sounds. But as I got into making the conversion, I wanted to add models and sounds to
make it playable for testing and beta versions. The models I got from GoZ Studios (many thanks to SpaceBoy),
but there's not really a good source for sounds. The sounds I used during testing were taken right out of XvT
(which I own).
If you want to use this conversion in a level, you'll need to take the essential cogs, and add them to your level.
And then you'll need to add the master.tpl, static.jkl, items.dat, and jkstrings.uni entries - everything you need to
do to these files is explained below with a section for each file. The rest of this readme is devoted to explaining
what values you need to give to these cogs. The templates to use for your objects are at the bottom of this
readme. The models and sounds will be left up to you.
Included Cogs
| Included Cogs |
| Level Cogs |
| capital_ai | Level cog to control a capital ship's AI. |
| fighter_ai | Level cog that controls enemy fighters' AI. |
| turret_ai | Level cog for a turret's AI. |
| debris | Level cog that creates debris in space. |
| fighter_player | Level cog that controls the player's fighter. |
| Class Cogs (optional) |
| class_awing | Class cog to create an A-wing's smoke. |
| class_corvette | Class cog to create a Corvette's smoke. |
| class_n1 | Class cog that creates an N1's smoke. |
| class_torp | Class cog that homes torpedos. |
| class_xwing | Class cog that creates an X-wing's smoke. |
| class_z95 | Class cog that creates a Z95's smoke. |
| Inventory Cogs |
| weap_chaff | Inventory cog for firing chaff. |
| weap_player | Inventory cog for the player's weapons. |
| weap_target | Inventory cog for the player's crosshair. |
A Few Things First
Some Explanation
Before I go right into the Cog's variables, I want to point out that the AI and player cogs use a lot of the same variables
and some of them are kind of cryptic - even the ones that aren't still require some knowledge of how the cog works
to give a good value to the cog. So I want to go over a few things about the cogs and about the conversion in general before
I go on to the cogs' variables.
Teams:
A ship's team is used by other ships to determine if it's an enemy. Ingame, the team is found by looking
at the object's user data. A team of -1 means nothing, a team of 0 means the object is neutral, a team of 1 means it's on
the player's team, and a team of 2 means that the object is on the AI's team. The 1 and 2 teams aren't hardcoded (or at least
they shouldn't be :-)), but 0 and -1 are.
Health & Shields:
All ships have both health (or hull) and shields. Turrets have only health. While a ship has shields,
they will be automatically increased every 0.01 seconds by adding the shieldRecharge value to the shield value. ShieldRecharge
should be a very small value - between 0.01 and 0.08. Otherwise, you'll never be able to kill the ship. Fighters typically have 100
health and 100 shields. You can vary this to make fighters like the Z95 easier to kill than the X-wing. Of course, capital ships should
have a whole lot more health and shields. How much more is up to you - I'd start off with a 1000/1000. Turrets shouldn't get much
more health than fighters do. They should be about the same size, but since they won't be protected by their capital ship's
shielding, it's only fair that they get a little more health - say 120.
Masses:
The different masses that templates use cannot be taken for granted. A thing's mass is a very simple way
for a cog to tell what type a thing is. There are only a few objects in the conversion that use their mass value (such as
missiles). Here's a chart with the mass values that the XvT Conversion uses:
| Mass Ranges |
| 0 | Ghosts |
| 1-10 | Lasers |
| 11-50 | Missiles |
| 51-100 | Fighters |
| 101-110 | Turrets |
| 111-500 | Various ships |
| 501-1000 | Capital ships |
| 1001-10000 | Large capital ships |
These mass ranges are used by the AI logic for determining how to attack a target (you can't attack a capital ship the same way
you attack a fighter), and by the player's targetting cog for finding valid targets.
Turning Rates:
All of the ships in this conversion have a turningRate variable that controls how much they are allowed
to look in a new direction every 0.01 seconds. For capital ships, the variable is usually 0.02, and for fighters it's 0.05. The player's
steering is different because of the way the player turns. Fighter_player finds out where the player wants to go by finding out
where the walkplayer is looking (the fighter you see ingame is not a walkplayer). Then the walkplayer's movements are transferred
to the player's fighter.
Speeds:
The speed variable that the ship cogs need you to set is the maximum speed. The AI fighters and the capital ships
will always travel at their max speed. A typical speed for a fighter is 4, and a typical speed for a capital ship is 1 for a large ship or
2 for a faster one. You need to be carefull about making some fighter's faster than others. Let's say you make the A-wing go at a
speed of 5: it will have an easy time running away from you, and it will keep running until it either gets a long way away from you or
you stop chasing it.
AI Logic:
My AI decides what to do every 0.01 seconds with no thought of what it was doing the previous hundredth of a second.
There are seven things the AI knows how to do: attack, find, chase, avert, evade, wait, and avoid. The attack mode is pretty
self-explanatory: the AI looks at you and fires its lasers/missiles. The AI will go to the find mode when it knows there's a target, but
the target is outside of its distToFind - the AI will wait until it sees the target. The AI will go to the chase mode when it comes in behind
its target at less than the distMaxToAttack - then it will fire its lasers and do its best not be shaken. The AI will go to the avert mode when
it gets less than the distToAvert distance to its target and the target is in front of it. For the avert mode, the AI will veer off in the opposite
direction of its target. The AI goes to the evade mode when its target comes up behind it at less than distToEvade. For the evade mode,
the AI will choose random directions to try to shake its target. The AI will go to the wait mode when it does not have a target. And lastly,
the AI will go to the avoid mode when its ranging projectile finds something in front of it that's not its target. If the ranging projectile is
hitting the target, the AI will wait for the avert mode instead of avoiding. The avoid mode is very helpful in keeping the AI from running
into capital ships and other fighters.
The main thing that the AI logic looks at to decide which mode to go to is the distance and facing direction of other fighters/ships. These distances are
very important. Say for example, that you've noticed the AI seem to fly straight when you're chasing them. That's probably because the
distToEvade distance is too short. By raising that distance, the AI will realize that you're still chasing it instead of trying to get to its
distMinToAttack.
Firing Offsets:
When I first wrote the fighter cogs, I had a different version for every fighter and then one for the player and one
for the AI. That turned out to be a terrific mess of code because I had too many copies of the same thing. So I took out all the fighter-specific
code and tried to make the fighter cogs as generic as possible. The downside is that it puts a lot more work on the user. The worst thing
is probably figuring out the firing offsets. The best way I've found is to open up Joke, and - using the different view tabs - hold your mouse
cursor over where you want the laser to appear to get that part of the coordinate. Look at the top to get X and Y, and look at the side to get
Z.
Elite AI:
I had more fun writing this part of the conversion than anything else. Elite is a boolean variable in the AI cogs that allows
you to create AI with a lot more firing skill than others. Elite AI turrets aren't as good as they could be, but that's because of a problems
with attaching the turret to its capital ship.
Debugging:
Most of my level cogs have a verbose variable in them for debugging. It's not local because at one time these cogs
were small enough that I could read all of the debug messages at once. But as they are now, especially for the fighter AI, you'll need to enclose
parts of the code with 'verbose=1;' and 'verbose=0;'.
Models, Sounds, Etc:
Sadly, I am not distributing any models, sounds, or other effects like explosion sprites with these cogs. I'll
leave it up to the user to find these. It's been my plan from the beginning to release a cog pack for users to implement in their levels. Even
as I began making testable versions of this conversion, I've never been able to get really good sounds or sprites because it's really hard
to get people to help. I have no experience with making sounds, little with models, and I flat out suck at graphics, so unless I get a
dedicated someone to help, this conversion is going to remain a set of cogs. But, I want everyone who uses these cogs to get their
models from GoZ Studios to keep some kind of conformity.
JED Loves Stupid:
When you use JED to build your space level's jkl file, you'll need to open it up and change two
things. First, go to the templates section and change the first template. Make sure it's either a base template or something that you won't
need - like bubbles. Second go down to the placed things section and make sure it's high enough to support all of the things that will be in the
level (600 is a good setting for small levels). Remember that smoketrails, lasers, and all of the ghosts that you never see take up a lot
of things, so you will easily hit that thing limit if you try to add too many ships. If you find yourself hitting the thing limit too easily, the first thing
you should do is go to the smoketrail templates and shorten their timers.
Making Fighter Class Cogs:
The fighter class cogs make the smoketrails because the fighter_ai cogs don't know where to make
the smoke appear. Much the same with finding the laser offsets, you'll need to find offsets for engines when you make a class cog. The
capital ships' class cogs work the same way, but they create a damaging projectile so that fighters will be damaged if they come into their
smoketrail (for testing purposes, give the damaging projectile a 3do). Note that if you don't want to bother with smoketrails, you can delete
the class cogs and remove them from the fighters' templates. Only missiles need their class cogs. Smoketrails were only meant to be
temporary anyway - I used them as a substitute for models without an animated engine mat.
Your Space Level:
Your space level needs to be one huge sector. Just zoom out in your editor and make the default sector something
like 1000 JKUs cubed. The wall surfaces need to be given the 0x204 flags so they're impassable sky surfaces. Then you'll need to give the surfaces
some sort of stars mat. When adding ships, don't go overboard. If you want a whole lot of ships, you're going to need to take out features like
smoketrails so you won't hit the thing limit - if you do, you'll notice that your lasers don't appear and not that much smoke is coming out of your
engines. The thing limit should be set to about 600.
Adding The Level Cogs
capital_ai.cog
capital:
this thing is the capital ship that the cog will control.
waypoint0:
this vector is the first waypoint that the capital ship will go to.
waypoint1:
second waypoint.
waypoint2:
third waypoint.
waypoint3:
fourth waypoint.
cycleWaypoints:
if you set this int to 1, the capital ship will go back to the first waypoint
after it reaches the last one. If set to 0, then the capital ship will stop at the last waypoint.
numWaypoints:
this int is the number of waypoints that you are using (so if you're using
up to waypoint2, you would set numWaypoints to 3).
useWaypoints:
set this int to 1 if you want the capital ship to travel to waypoints.
endLevelOnDeath:
set this int to 1 if you want the level to end as a success when the capital ship explodes.
respawnOnDeath:
set this int to 1 if you want the capital ship to respawn.
verbose:
this is for testing only. set this int to 1 if you want to see the debug messages.
team:
this is the team for the capital ship.
maxHealth:
this is the max health (hull value) for the capital ship.
maxShields:
this is the max shield value for the capital ship.
shieldRecharge:
this flex determines how quickly the capital ship will recharge its shields. Every 0.01 seconds this amount
will be added to the shield value until the max value is reached. A typical value would be 0.05.
afterDeathWaitTime:
this flex is how long the cog will wait after the capital ship's explosion before ending the level or
respawning the ship.
beforeStartWaitTime:
this flex is how long the cog will wait before doing anything (typically set to 0).
maxSpeed:
this is the maximum move speed for the capital ship (though AI always travel at their maxSpeed). This flex
is typically set to something like 2.
turningRate:
this flex determines how quickly the capital ship can turn - such as when it reaches a waypoint and turns
to face the next one. A typical setting for a capital ship would be 0.02.
minSoundDist:
this flex is the maximum distance for the player to hear the ship's sounds at full volume.
maxSoundDist:
this flex is maximum distance for the player to hear the ship's sounds at all.
explode:
this is the template to use for the ship's explosions.
engineSound:
this is the sound to use for the capital ship's engine noise.
As with a lot of the user-defined arrays in my cogs, if you need more variables in the array, just add them. As long as you give a valid numWaypoints
variable, the cog won't care how many waypoint vectors there are. It is easily possible to make the capital ship turn and move too slowly to ever "reach"
(come within a half-JKU of) a waypoint. This would normally happen when you place the capital ship right beside its first waypoint - the ship would
then continually turn to face the waypoint, but because of its speed, the capital ship would keep going in circles. For this reason, make sure you place
the ship far enough away for it to be able to face the waypoint before passing it.
For a capital ship's explosion, sprites seem especially lame. I wanted to have either one 3do or several to represent the burned hull and debris from the
ship. But since I don't have anyone to do the modeling, only sprites are implemented.
fighter_ai.cog
fighter:
this thing is the AI fighter to control.
priFireOffset0:
this vector is the first offset from the center of the ship for the primary weapons to be created at.
priFireOffset1:
second offset.
priFireOffset2:
third offset.
priFireOffset3:
fourth offset.
altFireOffset0:
this vector is the first offset from the center of the ship for the secondary weapons to be created at.
altFireOffset1:
second offset.
altFireOffset2:
third offset.
altFireOffset3:
fourth offset.
team:
this is the team which the fighter will be on.
numPriFires:
this is the number of firing points for the primary weapon (the lasers). So if you entered firing offsets
up priFireOffset3, then you would enter 4 for this int.
numAltFires:
this is the number of firing points for the secondary weapon (the missiles). Usually set to 1.
priMaxAmmo:
this is the number of rounds for the primary weapon (the lasers). Usually to -1 for infinity.
altmaxAmmo:
this is the number of rounds for the secondary weapon (the missiles). Usually set to 5.
maxChaffAmmo:
this is the number of chaff bursts you're given.
endLevelOnDeath:
set this int to 1 and the level will end as a success on the AI's death.
verbose:
this int is for debug only. Set to 1 if you want to see the debug messages.
respawnOnDeath:
set this int to 1 and the AI will respawn after the afterDeathWaitTime.
elite:
set this int to 1 to make the AI elite.
maxHealth:
this is the max health value (hull value) for the AI. Typically 100.
maxShields:
this is the max shield value for the AI. Typically 100.
shieldRecharge:
this flex is for recharging the AI's shields. Every 0.01 seconds, this flex will be added to the
AI's shields. It's typically set to 0.01.
priFireWait:
this flex is the firewait for the primary weapon (lasers).
altFireWait:
this flex is the firewait for the secondary weapon (missiles).
priLockonTime:
this flex is the amount of time it takes for the primary weapon to lock on to a target. Typically set to -1 for lasers.
altLockonTime:
this flex is the amount of time it takes for the secondary weapon to lock on. Typically set to 3 for missiles.
minLockonDot:
this flex determines how closely the AI must be looking at an enemy to get a lock. Typically set to 0.9.
maxLockonDist:
this flex is the maximum distance that an AI can be to get a lock.
afterDeathWaitTime:
this flex is how long the cog will wait before respawning the AI or ending the level.
minSoundDist:
this flex is the maximum distance for the player to hear the fighter's sounds at full volume.
maxSoundDist:
this flex is maximum distance for the player to hear the fighter's sounds at all.
beforeStartWaitTime:
this is how long the cog will wait before doing anything. Typically set to 0.
turningRate:
this flex determines how quickly the fighter can turn. A typical setting would be 0.05.
priWeapTemp:
this is the weapon template for the primary weapon.
altWeapTemp:
this is the weapon template for the secondary weapon.
explode:
this is the template for the fighter's explosion.
priFireSound:
this is the firing sound for the primary weapon.
altFireSound:
this is the firing sound for the secondary weapon.
chaffFireSound:
this is the firing sound for triggering a chaff burst.
chaffBurstSound:
this is the firing sound for a chaff burst.
engineSound:
this is the fighter's engine sound.
You will need at least one priFireOffset and altFireOffset, but you can remove the extras. For example, the released fighter cogs have four altFireOffsets.
This is just in case you don't use missiles for your secondary weapon. You only need one offset for missiles, so you can remove the three extra variables
and set numAltFires to 1. The reverse is also true: if you need more firing offsets, you can add them.
When the secondary weapon is fired, the cog will send a message to the projectile's class cog with target information. This is because the missile class
cogs need to know which fighter to target. So, you can use any laser template for either primary or secondary fire, but only the secondary can be used
for missiles.
turret_ai.cog
turret:
this is the turret to control.
capital:
this is the capital ship that the turret belongs to.
turret_weap:
this is the weapon template that the turret will fire.
explode:
this is the explosion template for the turret.
verbose:
this is for debug only. set to 1 to see the debug messages.
elite:
set this int to 1 to make the turret elite.
fireWait:
this flex is the firewait for the turret.
distToAttack:
this is the max distance that the turret will attack at.
maxHealth:
this is the max health value (hull value) for the turret.
fireSound:
this is the firing sound for the turret.
fireKey:
this is the animation for the turret to use when firing.
Turrets don't have a velocity, instead they have their position reset to match their capital ship's offset. This keeps them from ever colliding with their ship.
But because they move without a velocity, some of the aiming code in this conversion will be slightly off. But there isn't much of a noticeable effect.
A turret doesn't have to be paired with a capital ship. If you want to have a station or container with turrets, this cog will work without any changes.
debris.cog
The debris level cog only needs to be added to the level. It has no variables that need to be set.
fighter_player.cog
fighter:
this is the player's fighter.
priFireOffset0:
this vector is the first offset from the center of the ship for the primary weapons to be created at.
priFireOffset1:
second offset.
priFireOffset2:
third offset.
priFireOffset3:
fourth offset.
altFireOffset0:
this vector is the first offset from the center of the ship for the secondary weapons to be created at.
altFireOffset1:
second offset.
altFireOffset2:
third offset.
altFireOffset3:
fourth offset.
team:
this is the player's team - usually 1.
numPriFires:
this is the number of firing points for the primary weapon (the lasers). So if you entered firing offsets
up priFireOffset3, then you would enter 4 for this int.
numAltFires:
this is the number of firing points for the secondary weapon (the missiles). Usually set to 1.
priMaxAmmo:
this is the number of rounds for the primary weapon (the lasers). Usually to -1 for infinity.
altmaxAmmo:
this is the number of rounds for the secondary weapon (the missiles). Usually set to 5.
maxChaffAmmo:
this is the number of chaff bursts you're given.
endLevelOnDeath:
if set to 1, then the player will die and the mission will end as a failure. if set to 0, then the player will respawn.
verbose:
for testing only. Set to 1 if you want to see the debug messages.
maxHealth:
this is the max health value (hull value) for the fighter. Typically 100.
maxShields:
this is the max shield value for the fighter. Typically 100.
shieldRecharge:
this flex is for recharging the fighter's shields. Every 0.01 seconds, this flex will be added to the
fighter's shields. It's typically set to 0.01.
priFireWait:
this flex is the firewait for the primary weapon (lasers).
altFireWait:
this flex is the firewait for the secondary weapon (missiles).
priLockonTime:
this flex is the amount of time it takes for the primary weapon to lock on to a target. Typically set to -1 for lasers.
altLockonTime:
this flex is the amount of time it takes for the secondary weapon to lock on. Typically set to 3 for missiles.
minLockonDot:
this flex determines how closely the AI must be looking at an enemy to get a lock. Typically set to 0.5 for the player.
maxLockonDist:
this flex is the maximum distance that an AI can be to get a lock.
maxSpeed:
this is the max speed for the fighter. typically set to 4.
maxYawSpeed:
this is the max rate at which the player can look from side to side. typically set to 100.
maxPitchSpeed:
this is the max rate at which the player can look up and down. typically set to 100.
camSpeed:
this is the speed of the camera following the player's fighter. typically set to 10.
camUpDist:
this is the distance that the camera will be above the player's fighter.
camBackDist:
this is the distance that the camera will be behind the player's fighter.
intFrontDist:
this is how far in front of the fighter's center the internal camera will be.
intRightDist:
this is how far to the right of the fighter the internal camera will be.
intUpDist:
this is how far above the fighter the internal camera will be.
priWeapTemp:
this is the weapon template for the primary weapon.
altWeapTemp:
this is the weapon template for the secondary weapon.
explode:
this is the template for the fighter's explosion.
priFireSound:
this is the firing sound for the primary weapon.
altFireSound:
this is the firing sound for the secondary weapon.
chaffFireSound:
this is the firing sound for triggering a chaff burst.
chaffBurstSound:
this is the firing sound for a chaff burst.
engineSound:
this is the fighter's engine sound.
This cog works in almost the same way that fighter_ai works. Most of the variables are the same and the values are equivalent.
Level Templates
The templates below should be entered into the level's .jkl file. Or if you're using JED, the master.tpl file. You will need to provide all of the 3dos mentioned
below for these templates to work. The cogs that these templates use are included.
_fighter none orient=(0/0/0) thingflags=0x401 light=0.8 type=debris move=physics physflags=0x2 airdrag=0.05 collide=3 size=3 movesize=0.3
z95_fighter _fighter mass=100 model3d=z95.3do cog=class_z95.cog
awing_fighter _fighter mass=100 model3d=awing.3do cog=class_awing.cog
xwing_fighter _fighter mass=100 model3d=xwing.3do cog=class_xwing.cog
n1_fighter _fighter mass=100 model3d=n1.3do cog=class_n1.cog
_fighter is a base template for other fighters. In the template names that I write, the base template is always listed in the template's name, hence the
underscore. Z95, awing, xwing, and n1 are the useable fighter templates that you'll assign to the fighter cogs. These aren't the only ones you can
use, feel free to create your own templates - just make sure that they have the right mass and that they have a class cog made for them.
_turret none orient=(0/0/0) thingflags=0x401 light=0.8 type=debris move=physics physflags=0x2 airdrag=0.05 collide=3 size=1 movesize=0.3
laser_turret _turret mass=101 model3d=laser_turret.3do puppet=turret.pup
_turret is the base for turrets, and laser_turret is the template you'll give to turret_ai.cog.
_capital none orient=(0/0/0) thingflags=0x401 light=0.8 type=debris move=physics physflags=0x2 airdrag=0.05 collide=3
corvette_capital _capital mass=1000 model3d=corvette.3do cog=class_corvette.cog size=16 movesize=0.01
_capital is the base template for capital ships and corvette_capital is an example template. Note that movesize is set to 0.01. Even though
the capital ship is set to face collide, the fighters will collide with the capital ships if they're moving (using movesize). Size will work apart
from movesize so I'm using that instead.
_laser none orient=(0/0/0) thingflags=0x1 light=3 type=weapon collide=1 move=physics timer=10 mass=5 physflags=0x200 maxrotvel=90 damageclass=0x2
size=0.01 movesize=0.01 typeflags=0x20440d
+red_laser _laser model3d=bry0.3do soundclass=bry.snd creatething=+smflash vel=(0/8/0) explode=+laserhit fleshhit=+laserhit damage=30 mindamage=10
rate=15
+turret_laser _laser model3d=turret_laser.3do soundclass=bry.snd creatething=+lgflash vel=(0/8/0) explode=+laserhit fleshhit=+laserhit damage=40
mindamage=15 rate=10
_laser is the base template for lasers. +red_laser is used as the rebel fighters' laser, and +turret_laser is used by rebel capital ships' turrets. The '+'
is used before the template so that it's easy to see they're projectiles.
_missile none orient=(0/0/0) type=debris thingflags=0x401 light=0.5 move=physics physflags=0 collide=1 mass=20
+torp_missile _missile mass=20 vel=(0/4.5/0) size=0.05 movesize=0.05 model3d=torp.3do cog=class_torp.cog
_missile is the base template for any kind of missile. +torp_missile is the weapon template for torpedos. In XvT reality, there are a lot more
missiles than just protons (the same with lasers), but I never took the time to make a whole bunch of missiles and lasers when only a few
would be used. The class cog is pretty much the same for all. All you need to do is change the speed and damage. The torp class will
reset the speed of the missile, but it will use the vel template setting.
Static Templates
The templates below need to be put in the static.jkl. The bold text below tells you what resources you need to provide for these templates.
_ghost none orient=(0/0/0) type=ghost mass=0
+simple_ghost _ghost move=path
+timed_ghost _ghost move=path timer=0.01
+cam_ghost _ghost type=weapon move=physics collide=0 size=0.001 movesize=0.001
_ghost is the base template for all ghosts. +simple_ghost is used to mark a point, +timed_ghost is used so that the ghost will be automatically
removed from the game after 0.01 seconds instead of using DeleteThing(). +cam_ghost is used specifically for the camera which follows
the player's fighter.
_damage none orient=(0/0/0) type=weapon collide=1 move=physics timer=1 mass=0 damageclass=0x2 typeflags=0x1
+fuel_damage _damage timer=1.3 size=0.01 movesize=0.01 damage=5 mindamage=1 typeflags=0x400d rate=30
_damage is base template for creating things that damage. +fuel_damage is designed to be fired along with a capital ship's smoketrail
so that you'll be damaged if you try to follow the ship too closely.
_smoke none orient=(0/0/0) thingflags=0x1 type=particle move=physics timer=0.2 physflags=0x20000 angvel=(0/0/90) typeflags=0x3e range=0.03
elementsize=0.005 count=8 mass=0
+fuel_smoke _smoke vel=(0/0/0) material=dstructparts.mat count=16 range=0.05 light=0.7
+torp_smoke _smoke vel=(0/0/0) material=dstructparts.mat light=0.5
+big_smoke _smoke vel=(0/0/0) material=dstructparts.mat elementsize=0.05 count=16 range=0.3 timer=0.2 light=1
_smoke is the base template for smoketrails. +fuel_smoke is for fighters, +torp_smoke is for missiles, and +big_smoke is for capital ships.
_sprite none orient=(0/0/0) type=weapon move=physics timer=0.01 mass=0
+reticle_sprite _sprite sprite=reticle.spr
+reticle2_sprite _sprite sprite=reticle2.spr
_sprite is a base template for sprites that should appear in front of the camera. The two reticles are for the red and green crosshairs. Provide reticle.spr
and reticle2.spr.
_ranger none orient=(0/0/0) thingflags=0x400 timer=0.2 type=weapon move=physics size=0.5 movesize=0.5 collide=1 typeflags=0xd mass=0
+basic_ranger _ranger vel=(0/100/0)
+up_ranger _ranger vel=(0/100/30)
+right_ranger _ranger vel=(30/100/0)
+sight_ranger _ranger vel=(0/50/0) size=0.001 movesize=0.001
_ranger is a base template for the ranging projectiles that AI use to find out if anything is in front of them. +basic_ranger goes straight, +up_ranger goes up,
and +right_ranger goes right. Only straight, right, and up are needed because if the AI is trying to evade, and it can't go right or up, then it will try left or down
regardless. If there is anything that's left or down, then the AI would have crashed anyway. +sight_ranger is used by turrets to make sure that they can see
their target.
_round none orient=(0/0/0) thingflags=0x401 light=1 timer=1 type=weapon move=physics size=0.2 movesize=0.2 collide=1 typeflags=0xd mass=0
+chaff_round _round damage=10 vel=(0/0/0) sprite=chaff.spr
_round is the base template for chaff rounds. +chaff_round is the projectile that's used. Provide a chaff.spr.
_trash none orient=(0/0/0) thingflags=0x1 light=0.5 timer=10 type=weapon move=physics collide=0 size=0 movesize=0 angvel=(90/90/90) mass=0
+trash1 _trash model3d=trash.3do
_trash is the base template for the debris that seems to float around the player's fighter. +trash1 is the template that's used by debris.cog. Provide
a trash.3do.
Items.dat Additions
You'll need to add this text into your items.dat.
weap_player 116 1 1 0x0 cog=weap_player.cog
weap_target 117 1 1 0x120 cog=weap_target.cog
weap_chaff 118 1 1 0x120 cog=weap_chaff.cog
cog_player 119 0 999 0x0
thing_player 120 0 999 0x0
thing_target 121 -1 999 0x0
Insert this after the last goal bin and before the hotkeyOffset.
JKStrings.uni
XvTC uses several new hotkeys that you'll need to bind before you can play. To bind these keys, you'll need to edit the jkstrings.uni file.
Take the original and add it to your ui folder. Then open it up and look for "ACTIVATE16" on line 722. Paste this text right below it:
"ACTIVATE17" 0 "Next Target"
"ACTIVATE18" 0 "Fire Chaff"
This will make two new hotkeys appear in the keyboard controls box. These will correspond to the new items.dat bins that you added above.
Known Bugs
1) hitting escape and clicking restart while in a game will crash. This is because JK doesn't load everything the same way
as it does when you first load the level. I'm not exactly sure what part of the load process crashes, but it doesn't really matter as you can go to the
menu and load the level again and it will work fine. You won't be able to save games either.
2) If you don't hit any keys for a while when you're playing, JK will try to start the player's idle animations. You'll see the camera flicker when that
happens. Press a key and it will stop.