Tutorials

Combine Dropship



You should all remember the scenes in Half-Life 2, where a combine dropship lands and drops several soldiers and then departs. Well we are going to look at recreating that scene for ourselves with the added use of assault entities to make our soldiers move on after landing.

Let’s run through our desired effect:

news post image
news post image
news post image
news post image
news post image
news post image

Our first task is to create somewhere for this event to happen, you will need a large area for this dropship to work effectively in as it is a huge entity and also needs space to fly around. I create a basic box as shown.

news post image

After the dropship lands we also want something for our combine to do, in this example I have set up a crude house with a wall, something like the below:

news post image

Ok, time to move on. Let’s setup the dropship and it’s flight path. Place the npc_combinedropship in the far corner so it has some distance to cover and give it a name, in this case it is dropship1.

news post image

Now, the dropship will follow path_track entities to reach it’s destination so we need to add these, one can be placed a 100 or so units in front of the dropship and the next one up the other end of the map, roughly where you want the landing zone to be.

An important thing to remember here is the naming of the path_track. Logic suggests that you name the first track something like path1, then call the next one path2 and request the dropship to fly to path1. Well it doesn’t work like that. We need to set the paths up as mentioned but tell the dropship to fly to the furthest one first, it merely uses the other tracks as navigation on the way. Set it up like the below:

news post image

Now go into the properties of the dropship entity and set the Target path_track field to path2:

news post image

So, we now have a dropship that will fly from one part of the map to the other, well almost. We just need to add some outputs to the path_tracks. It won’t take long.

First open up the path_track closest, the one we called path1. Now add the following output:

news post image

This ensures the dropship flies to path2 as it passes path1 and that it won’t spin madly in mid-air.

Our final addition is in path2. Remember that path2 is our destination path_track and will be where the dropship lands, so add the following output to whichever path_track is the last in your line:

news post image

What this means is that when the dropship reaches this point it will commence the landing animation and hover above the ground while the soldiers disembark. The 4 value is how many soldiers we will be dropping off.

Ok now it starts to get a little bit more complicated but stay with me. We now need to use the info_target entities and also set some fields in the dropship itself.

The first thing you require is an info_target for the landing point, this should be a few units in front of the last path_track and obviously at ground level. I have called this landing_area1.

Now we are having 4 soldiers jump out in this tutorial, so for this you need to add 4 soldiers to the map, in the form of the npc_combine_s entity. They can be placed anywhere, but near the landing area is convenient. Make sure you go into flags and tick Template NPC so that it doesn’t spawn instantly.

Finally we need 4 more info_targets around the landing area, as these will be where the combine soldier moves to after jumping out, these are referred to as dustoff points, so place them accordingly and also name them. You should have a layout similar to the below:

news post image

Also a reference image for how far apart the landing point and last path corner should be, if these aren’t about right the transfer from flying animation to landing animation is not very smooth, so tweak these as you see fit:

news post image

Now open up the properties of the combine dropship and scroll to the bottom area:

news post image

We need to set a few things here, first on the list is the Land target name, this is the info_target you specified for being the landing point.

Next we have Name of Template NPC 1. As you can see there are 6 but we are only using 4 soldiers here, so put the names of the soldier entities in here.

Beneath that we have the dustoff points, now these are the other 4 info_targets you placed down and will be where the soldiers move to after disembarking. So if your Template NPC 1 was soldier1 and the Name of dustoff point for NPC 1 was dustoff1 he would run to that after getting out, you can use this to spread your soldiers out or make sure they all stay in a specific place.

Make sure Crate type is Soldier Crate as well.

Now, we have made the ship fly, land and drop off the troops. Our last point is to add a logic_relay somewhere in the map, and also setup the exit path_tracks for the ship. We will be using the logic_relay soon, so plonk it in the map, and also set up the path_tracks like the below;

news post image

news post image

Now open up the dropship properties and add the following outputs:

news post image

The first one tells the ship to fly to the last waypoint after dropping the troops and the second one tells the logic_relay to trigger, which in a minute, we will be using to start off the next stage.

You will need to add the same output you used in path1 to the path3 entity. It’s basically the same setup.

Right, time to move onto the small house and setup the assault points. Before we go any further it would be advisable to familiarise yourself with assault points in general, so you understand the process. You can read a full breakdown here: http://developer.valvesoftware.com/wiki/Assaults

Ok, so have a look at the image below to get an idea of the setup:

news post image

We have the ai_goal_assault, which begins the whole process and it purely there for entity information.

The assault_rallypoint is where the troops will run to and await the final assault command.

The assault_assaultpoint is where the troops will assault to, shooting at any targets. You may see the math_counter I have added there, this is because I want the troops to all get to their points first before assaulting, so I will target the math_counter with a single increment each time one of the troops reaches his rally_point, when it gets 4 increments it will trigger the assault points, this is to ensure they all move as one group.

Our first task is to go back to the logic_relay and add the following outputs:

news post image

This basically activates our ai_goal_assaults as soon as the troops dustoff, which is required so that the troops then run to their designated rally point. You can see from the images I have added one per troop, which you will need. It also helps with individual placement of the combine.

The next option is to open up the ai_goal_assaults themselves, as I said, we have one per soldier so you will need to set the options each time:

news post image

Name: Anything will do, here it is goal_assault1, and then 2,3 etc
Actor(s) to effect: Here you put the name of the soldier, soldier1 in this case.
Rally Point Set: This is what rally point the troop will run to, they are locate by the wall.
Search Type: Entity Name
Active: Yes
Assault Cue: Entity System Input – This means it waits for a trigger once at the rally point.

The next entity is the assault_rallypoint:

news post image

Take notice of the name and the Assault Point, these are the only fields you really need. The assault point should be the name of the assault_assaultpoint you want the soldier to run to.

Now, I mentioned the math_counter earlier. We want the rally_point to add a single increment when the soldier arrives, once we have 4 we can then tell them all to assault together.

news post image

Now go into the math_counter and add the following outputs:

news post image

As you can see, when the entity receives the Hit Max command (in this case 4 increments, which you specify in the math_counter itself) it tell the ai_goal_assault to begin the assault process, and the troops will storm the house.

news post image

You can tweak many stages of this to create your own version of the process, use the attached example map as reference.

Click for example map

-Blink

View comments ( 24 )

Back to top