Shooter tutorial

Top  Previous  Next

This month we will add two armor packs and a biped enemy to our game. I am using the level that was included in the aum53.zip code last month, so make sure that you use it as well.

 

We are soon going to face a furious enemy, so we'd better get some armor first. Add an armor.mdl model to the level in the area that is indicated by the red circle.

 

aum54_template1

 

I have set the scale of the model to 1.5 but you can use any other value. Right click the model, choose "Properties" and you will see the following window:

 

aum54_template2

 

Attach the action named "PlBipedWeap00_ArmP" to the model:

 

aum54_template3

 

Set Amount__015 to 50 (each armor pack will give the player 50 armor points) and Spin__015 (the rotation speed) to 3.

 

aum54_template4

 

Duplicate the armor pack; place the second armor model as indicated in the picture below.

 

aum54_template5

 

Now build the level (update the entities) and run it; you should see the rotating armor packs.

 

aum54_template6

 

Add the badguy.mdl model to the level, as indicated in the screenshot below; set its pan to about 170 degrees.

 

aum54_template7

 

aum54_template8

 

Click the "behavior" tab, and then attach the action named "AIFPS01_Guard" to the enemy.

 

aum54_template9

 

Dismiss this window, right click the enemy again and this time choose "Behavior".

 

aum54_template10

 

We will make quite a few changes to this guy. But first, fire up Med and get the shooting vertex number: it is 686 for the badguy.mdl model.

 

aum54_template11

 

Take a look at the modified "Behavior" panel.

 

aum54_template12

 

Don't forget that you can click "?" and then one of the fields to find out what it does; however, I'll discuss the changes.

 

1) First of all, I have lowered the ForceX value; this means that the enemy will walk slower towards the player. Why did I do that? The model doesn't have a "run while shooting" animation, so it would simply slide on the floor; the smaller ForceX value makes it look more natural.

2) The "attack" animation speed was increased a lot because the enemy fires many bullets per second.

3) The enemy shoots using the 2nd weapon, generating the bullets from its 686th vertex and firing bullets several times a second.

 

Enough talk! Don't forget to press "Save" and then run the level again.

 

aum54_template13

 

The enemy is pretty tough but (fortunately) the armor pack will protect you for a few seconds.