CRE8OR - game maker for anim8or

 


ENEMIES
- CHARACTERIZATION -


   We'll start out wit a project similar to last time. Download this: Lizard Alien 2 . It's a modified version for the purpose of showing how to make a enemy. I've added all the basic movements so we can start learning about modes and sequences. You might want to review the last tutorial.

NOTE: EVERYTHING IS CASE SENSITIVE


NOTE: Models are used in the tutorial for the purpose of teaching, these models are not allowed to be used elsewhere without consent.

Now let's begin. Start up Cre8or and open Lizard Alien 2.
If you run it there's another Lizard thing that it going to be the enemy.

 

Now lets add some events:

Now add the "Step Event"

Now add three modes:


Add these three mode:

"Normal"

"GoToPlayer"

"Attack"


These are essentially all the important modes.
Normal - Acts normal
GoToPlayer - Player was too close, so go to him
Attack - In range enough to throw some punches

The the create event set the mode to Normal:


In the step event add "Stand Straight" (Use sequence 0) and "Apply Damping"

 

In our enemy's normal mode I want him to run around in circles which is basically running forward and turning.



Now make him turn:



If you run this now, he shoud just run in circles.

I want him to switch modes when the player comes to close.



If the player's distance is less than 250 then it's time for the enemy to run towards the player. By swtiching the mode:



Now in the "GoToPlayer" mode the lizard will run forwards:



And also turn towards our main character:



Speed is how fast he turns.

If you run it now, and approach the enemy, the enemy runs at you and plows right into without stopping. We need to make it so that if the enemy is very close it will start attacking. And also if we run away he should go back to running around in circles.



IF we run away and the distance is greater than 300, than we'll reset the mode.



Now if the distance is less than 90, the enemy should start attacking:

 

Set the mode:

 

Now that he is attacking we still want him to turn towards the main character just not move foward, so go ahead and add the:

We now want the enemy to start punching so let's set the seqeunce:


However, if you walk away the enemy will still stand and puch the air, so let's make the enemy go back to "GoToPlayer" if you try to get away.

Set the mode:

 

I want the main character to be pushed back by the enemy so....

Now go to the Enemy_Punch sequence



Now add an event "Frame 14"

Now add the push back, "Alien_Lizard.instance_of()" means the first object of "Alien_Lizard"

 

Now it's time to fight back!
Go to the Alien_Lizard Object, add the keyboard <Ctrl> event


Set the sequence to "2"


Now I want the player to push back the enemy, but we have to make sure that the player faces the enemy otherwise you could just press <Ctrl> and the enemy woul randomly be pushed back.

Add event Frame 14:

We'll use "If In Range 2" which will give us quallity checking:

First is "Enemy_Lizard"

Then is 20.0 units away

And last is "Facing" which gives use the ability to see if our main character is facing the other character. A value of 0 means that the character could be facing it from anywhere between in-front to off-the-side. A value of -1 means it can be facing anthing. A value of 1.0 means it is absolutely facing, this never happens though. A value of 0.3 - 0.5 is a good range.

This automatically adds a varaible called "other" which is the object that is in range.



So we push back the person who we're facing.

That's all for now!

Tutorials Page




Copyrights (C) 2007 Keith Tabert
Thanks to R. Steven Glanville for Anim8or, Robin