Spawn
This is the tutorial to teach you how to create a Spawning items. The bunny.map also has a
trap shoot to shoot at flying bunnies. To view this map in
Shadow Warrior download bunny.zip
 Fig 1. 3D view of barrel we want to spawn an item from.
| |
1. As shown in Fig 1. I use picnum 713 for the barrel that I want to explode and spawn a
medical kit out. You will note that I place the ST1 sprite for the explosion to be about
half way up the height of the barrel.
 Fig 2. 2D view of sprites involved.
| |
2. Since this is a novice tutorial, you should know how to insert and tag sprites. So, we
won't have to cover how to do that. As shown in Fig 2. above, insert two ST1 sprites. A
SPAWN_SPOT (HiTag 69), and a
SPAWN_ITEMS (HiTag 149). Give both of the these ST1 sprites a LoTag (match tag value) of 9. The barrel is given a LoTag of 271 for a
TAG_SPRITE_HIT_MATCH. Give the barrel sprite a HiTag of 9 for our match tag value.
3. For the barrel sprite
Enter these values:
- TAG3 = 32 - Default value
- TAG7 = 3 - React to any weapon hit, including shurikens, sword, and fist
- TAG8 = 2 - Force the sprite to be visible
When the barrel is destroyed it will activate all matched tags. In our case the next two ST1 sprites.
This sprite will give us the explosion when the barrel is destroyed.
4. For the SPAWN_SPOT sprite
Enter these values:
- TAG3 = 6 - Standard explosion
- TAG4 = Angle of the explosion
- TAG5 = 0 - Time delay
- TAG6 = 6 - Same as TAG3
- TAG8 = 0 - Default value
- TAG9 = 0 - Default value
- TAG10= 0 - Increase size of shraps
This sprite will give us the explosion when the barrel is destroyed.
5. Ok, the SPAWN_ITEMS ST1 sprite is our main sprite used for spawning
items. How you decided to trigger them will be up to you. In this
tutorial we are using the barrel with a LoTag of 257 and a HiTag match
value for our trigger. If you download the bunny.zip file from above,
you will find that I use switches for triggering guns, ammo, and (of
course) bunnies to shoot at. For the SPAWN_ITEMS sprite
Enter these values:
- TAG3 = 58 - Portable Medkit
- TAG4 = Set the angle to throw the item
- TAG7 = 40 - Velocity of item
- TAG8 = 50 - Jump velocity
- BOOL1 = 0 - Kill the ST1 sprite after it's trigger
- BOOL2 = 0 - Zero since BOOL1 will kill this sprite
Check over these values in the bunny.map for the different SPAWN_ITEMS
sprites in the map. You will notice that the ones for throwing out the
bunnies has a BOOL3 = 1. This basically will vary the velocity of the
item thrown.
Back to my Shadow Warrior site.