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 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

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 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.