Templates
the world of mystery revealed!!!!
In this tutorial you will learn how to make different types of weapons templates and how to make them work together in the static.jkl file.
things you will need are:
the basics of templates
all templates that are based on another one, have to come after the one they are based on in the jkl.
example: when you have a create thing in a template, lets say an explosion has the creatething=+smoke or somthing. you would have to put +smoke in the jkl before the explosion you just made or it wont work.
all templates are either based on somthing unless you make a new one that will be based on none
ALL weapons templates(partical weapon and explosion) have to have typeflags=0x* these flags differ for each type so check the JKspecks or reffer to the tempref.txt file that i give you.
messages in templates
orient=(0.000000/0.000000/0.000000) this im not sure about. i think its the position at whitch the template is created. i dont suggest you play around with this too much, i dont see any point in changing it.
type=(explosion, particle, weapon)
weapon is used for the actual weapon projectile that gets troown shot or dropped ect...
partical it for making a bunch of particals apear then disapear over time(smoke is done by this)
explosion is for when a weapon hits somthing and explodes.
collide=(0,1 or 3) used for weapons
collide=0 means that it wont collide with things. im not sure how this would be usefull in a weapon template
collide=1 means that it collides when something withing a shpere of the object(see: move size)
collide=3 means that it will collide with an object if that object touches one of its faces(this is usually used for 3do architecture...i think)
creatething=(whateveryou want) means that when the thing is fired(weapon) it will creat some template that you specify. if used in an explosion then it can create stuff like smoke clouds, shockwaves fire clouds ect....
light=flex this gives your template a dynamic light value. replace flex with a number
model3d=*.3do gives your template a 3do so you can see it(weapons)
move=(none, path or physics)
none...pretty self exlanitory. it wont move.
path, this means that it will move by a specific path using frames and sutch(usually not used for weapons...somthing like an actor usually)
physics means that it moves with physical properties like mass velocity ect...
movesize=flex this is for how big the shpere in the collide message is. u want to make the flex in this about the same size as the 3do you have(jkus)
par=*.par this is for particle files like the shpere in force protection.
soundclass=*.snd this is for things like explosions making noise and when a TD hits the ground and make that *ping* sound
sprite=*.spr specifies the sprite file used for the template. usually used for explosions but can be used in a weapon in place of a 3do like force destruction has.
timer=flex this tells how long the thing will be in the game for. when the timer runs out it is removed, when this happens it will make its explosion. if there is none then it will simply cease to exist
specific messages for weapon types
airdrag=flex this is how much resistance from "air" there is on the weapon.
angvel=(x/y/z) angular velocity, i dunno.......maybe it has somthing to do with a weapon spinning?
buoyancy=flex how much buoancy the weapon has(if it floats in water)
maxrotvel=flex maximum rotational velocity. how fast it spins, possibly conected to the angvel message
mass=flex how much it weighs so if it has gravity(if it falls) in the physics flags then it tells how fast to fall.
physflags=0x* check the jkspecs or the tempref file that comes with this tutorial to figure out what the flags do
surfdrag=flex if the thing has to slide along a floor or wall this tells how much resistance it gets from that.
vel=(x/y/z) how fast it moves in each direction, i think that the "Y" vector is forward.
explode=(template*) this is for what the weapon does when it hits a wall or just explodes.
*the template would be somthing like a sprite or a dustcloud(can be used with a timed sprite to make a bullet hole that stays on the walls!!!)
if the *template is an explosion not just a bullet hit type thing you do the same for it but probably use a bigger sprite
fleshhit=(template*) this is for when your weapon hits a player or actor(non droid)
you can do cool efects by making the *template blood or somthing so that blood appears only when a player is hit
cog=*.cog this is used for linking the projectil with a cog such as 00_smoketrail.cog will leave a smoke trail behind the projectile.
trailthing=template this is used for the force lightning template, those little peices of "electricity" are 3dos trailing after the main projectile
messages for explosions
particle messages
How to make the frikin things work!!!!
I hope i didnt scare you all away with thazt crapload of messages....anyway, first off you go get the static.jkl i included with the tutorial, open it up in notepad then get in the templates section. After the _gexplosion and _gweapon templates make the templates you want, here are some examples to show you how to compile the templates yourselves (if this wont help you, go look at the tempref document i gave you and look at a weapon similar to the one you want to create, then modify it to fit your needs. be sure to put the weapons explosion and anything that the explosion creates BEFORE the template itself otherwise it wont work).
+bulletcloud none orient=(0.000000/0.000000/0.000000) type=particle timer=0.150000 typeflags=0x3f material=00gsmoke.mat range=0.006000 rate=64.000000 maxthrust=4.000000 elementsize=0.004000 count=16 ///this is for when the bullet hits the wall
+bloodcloud +bulletcloud material=bloody.mat range=0.030000 count=40 ///all i changed from the bullet cloud was: material so it looks like blood, range so its a bigger area, and count so it will be more dense. this will be used when a person gets hit by the bullet
+bulletfleshhit _gexplosion timer=0.001000 soundclass=exp_bullet.snd creatething=+bloodcloud typeflags=0x0 ///for when a person is hit
+bullethit _gexplosion timer=0.001000 soundclass=exp_bullet.snd creatething=+bulletcloud typeflags=0x0 ///for when the bullet hits somthing not living
+bullet _gweapon thingflags=0x20000001 light=0.400000 model3d=bullet.3do size=0.001000 movesize=0.001000 soundclass=bry.snd maxrotvel=0.000000 vel=(0.000000/20.000000/0.000000) explode=+bullethit fleshhit=+bulletfleshhit damage=30.000000 mindamage=10.000000 typeflags=0x20440d rate=15.000000
as you can see, i put the +bullethit under explode= and the +bulletfleshhit under the fleshhit= so it will do different things when you hit a person or a wall:)
now you can experement with all sorts of things. i hope that this helped a little to make people not totally confused about templates.
copyright 2000 GuNbOy