Shadow Warrior: vehicle "how to"




1.draw your vehicle. In this example the vehicle's
walls are in YELLOW so you can see them more clearly.
The vehicle's top is north (up) on the picture.
Your vehicle CAN NOT use more than 30 sectors.

2.draw a box around your vehicle, this box must link to
NO OTHER WALLS. This "outer box" is in DARK RED on the
picture and is pointed by a GREEN arrow.

3.one of your "outer box" wall MUST HAVE a LOTAG of 504.
You just need to tag one wall of the "outer box".
This "outer box" tells the game that all sectors inside
it are a SECTOR OBJECT and must move together.

4.now that we have defined the sectors being part of our
vehicle, we need to define a "virtual box" to tell the
game which sprites will move with it. (this "vb" will
also be used as clip-box by the game)
To define the "vb" we need two ST1 sprites. You must place
one in the upper left corner of your vehicle, the other
one in the lower right corner of your vehicle. These two
ST1 must define a "virtual box" big enough to contain the
whole vehicle AND ITS "OUTER BOX" + any sprites you want to
move with the vehicle. In our example, the two "vb" ST1s
are pointed by RED ARROWS.

5."virtual box" tags.
the upper left ST1 (BOUND_SO_UPPER) must have a hitag of X
the lower right ST1 (BOUND_SO_LOWER) a hitag of X+1
X being >= 500 and X being a multiple of 5
(minimal values are 500 & 501, max values are 595 & 596)
If you don't get what i mean here are some correct values:
- 500 & 501 - 505 & 506 - 510 & 511 - 515 & 516

6.let's decide which sector will be the "center sector",
this "cs" will be the sector around which the vehicle will
pivot (don't worry, in my example it is not really in the
center, it is near the center and it works just fine).

7.tagging the "center sector" (named "cs"):
- give your "cs" a hitag of 98, it means "player drivable"
- give your "cs" a lotag equal to your BOUND_SO_LOWER, in
our example 511.

8.let's decide which sector will be the "active sector",
that is: where do i have to stand and push SPACE to drive
the vehicle.
Put a ST1 with hitag=1 (SECT_OPERATIONAL) in choosen sector.

9.now we have to define how our vehicle will behave. A good
thing is to put all following ST1s in your "center sector"


•first put a ST1 with hitag=16 (SO_ANGLE). The angle of this
ST1 indicates where's the front of the vehicle (The vehicle
will move in this direction when you use UP ARROW KEY).

•put a ST1 with hitag=76 (SO_MAX_DAMAGE). This sets the max
amount of damage the vehicle can take before breaking.
TAG 2 = max amount (here 200 which equals 3-4 rockets)
TAG 5 = initial damage setting (0 = perfect, -1 = broken).

•put a ST1 with hitag=77 (SO_RAM_DAMAGE). This tells how
much damage you make when hitting something with your vehicle.
TAG 2 = damage amount done by driving into something (this
is the damage done to the OTHER OBJECT, you can't
kill your own vehicle by driving into walls)
note: ST1 77 is optional. To kill actors you don't need it.
you can use it to destroy a sector_object wall.
(In my example, TAG2=0 because i don't need it).

•put a ST1 with hitag=147 (SO_DRIVABLE_ATTRIB). This is not
needed but provides some additional infos that helps to make
the vehicle behave more like a real one. For detailed infos
please see SPRITAGS.TXT on your Shadow Warrior CD.
TAG 2 = 0 (angular speed, 0=default)
TAG 3 = 10 (angular slide)
TAG 4 = angle (can be anything, isn't used by this ST1)
TAG 5 = 0 (match for triggering effects)
TAG 6 = 0 (speed, 0=default)
TAG 7 = 10 (speed slide)
BOOL1: 1 = shake screen on hit
BOOL2: 1 = use additonal match tag with TAG 5...
BOOL3: 1 = remote controled
BOOL4: 1 = rectangular clipping. You can set this to 1 if
your "outer box" is rectangular (ONLY 4 WALLS).


10.aaaah... at this point our vehicle is drivable and fully
defined, but i guess you want to add smoke, sound and
ammos, so here we go.

11.adding smoke:
put a ST1 with hitag=69 (SPAWN_SPOT) where you want smoke
to come out of your vehicle when it is broken. Tags are as
following:
TAG 2 = match. Make shure it does MATCH NOTHING.
TAG 3 = 3 (MUST BE 3, or it won't work, or will spawn crap)
TAG 6 = 3 (must be equal to TAG3)

12.adding sound:
put a ST1 with hitag=134 (SOUND_SPOT) anywhere on the vehicle.
(strangly, vehicles do not make any sound where your not in)
TAG 2 = match. Make shure it does MATCH NOTHING.
TAG 4 = idle sound (you are on the vehicle, but do not move)
TAG 5 = drive sound (you move the vehicle)
BOOL2: MUST be set to 1.
My usual value for TAG4 and TAG5 is 147.

13.adding weapons to our vehicle:
put a ST1 with hitag=62 (SHOOT_POINT) where you want the
bullets to come out.
TAG 2 = match stuff, usually set this to 0.
TAG 3 = ammo type (see SPRITAGS.TXT for a complete list)
i usually use machine gun = 1.
TAG 4 = shoot angle (don't point inside the vehicle, haha)
TAG 5 = delay until next fire, usually 80 or 6 for m-gun.
note: you can have multiple SHOOT_POINTs, very cool.

You should also put a gun barrel somewhere. In my example
the gun barrel is the sprite pointed by a BLUE ARROW.

14.THE END. Load SW and enjoy your new vehicle.


vehicle "how to" by Yves Bresson ;)
 
Download this "how to" in txt format (zipped with picture)