Combine Dropship

Tutorial collection, comprehensive listings on main site.

Combine Dropship

Postby Tutorial on Sun Nov 06, 2005 12:25 pm

category
General Half-Life 2/Scripting

description
Quite in-depth look at making a dropship flyover and drop off 4 soldiers who will then assault a designated point.

keywords
combine, drop, ship, dropship, npc_combinedropship.

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:

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

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:

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.

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:

Image

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

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:

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:

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:

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:

Image

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

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;

Image

Image

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

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:

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:

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:

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:

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.

Image

Now go into the math_counter and add the following outputs:

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.

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
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby Rustvaar on Sun Nov 06, 2005 12:33 pm

Cracking.

Good use of pictures and nice simple explanations.

Nice one Blink :)
User avatar
Rustvaar
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Sat Jul 02, 2005 9:34 pm
Location: The Land of Fail and Procrastination

Postby ShaDoW on Sun Nov 06, 2005 1:00 pm

Very grand, looks real well written and informative.

Guess I'll be trying this one out tonight.
User avatar
ShaDoW
Senior Member
Senior Member
 
Joined: Fri Apr 08, 2005 11:01 pm
Location: Belgium

Postby Viceman on Thu Nov 24, 2005 7:24 am

I liked this tutorial.. i liked it very much. ;-)
User avatar
Viceman
Regular
Regular
 
Joined: Fri Dec 31, 2004 5:52 am

Postby Opheliar on Sat Nov 26, 2005 1:48 pm

It wont work for me... i cant see the lines between path 1 and 2, and between 3 and 4... plus, it only flyes maddly in circles when i start the map.
Opheliar
Dumpling
Dumpling
 
Joined: Wed Nov 16, 2005 9:27 pm

Postby Ark_Gamer on Thu Dec 22, 2005 11:34 pm

This is all well and good, but how do you rig a trigger so the dropship dosn't run through the sequence as soon as you run the level?
A man walks into a bar with a giraffe. They both get pissed, and the giraffe falls over. The man goes to leave and the bartender says "Aye, you can't leave that lyin' there!" The man says, "It's okay, it's not a lion. It's a giraffe."
Ark_Gamer
Regular
Regular
 
Joined: Thu Dec 22, 2005 11:33 pm
Location: Bloomington, IN

Postby Blink on Fri Dec 23, 2005 12:26 am

Ark_Gamer wrote:This is all well and good, but how do you rig a trigger so the dropship dosn't run through the sequence as soon as you run the level?


Use the npc_template, look in the vmf and you can see it is triggered by the logic_auto, just trigger it when you want.
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Postby Ark_Gamer on Fri Dec 23, 2005 1:58 am

Right then. Second question: It seems to have a problem with overshooting the second track point, then circling around and landing at a different angle. It takes a long time, and really screws up the sequence. How can I make it follow a smooth landing pattern?
A man walks into a bar with a giraffe. They both get pissed, and the giraffe falls over. The man goes to leave and the bartender says "Aye, you can't leave that lyin' there!" The man says, "It's okay, it's not a lion. It's a giraffe."
Ark_Gamer
Regular
Regular
 
Joined: Thu Dec 22, 2005 11:33 pm
Location: Bloomington, IN

Postby Grantax on Tue Mar 14, 2006 1:43 pm

Is there no easier way to do this? (I mean, less entities)

BTW: I doubt you need 4 relation entities to make the combines like the player, I think you only need 1, and set the subjects to npc_combine_s...
But I have no idea :P
Grantax
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Tue Mar 14, 2006 1:33 pm
Location: Norway

Postby Grantax on Sat Mar 18, 2006 12:00 am

I've been experiencing around with it.
I ended up with:
6 Combines coming from the dropship, lining up, leaning to the wall, then assault at the same time, npc clip brush closes (func_wall_toggle) the exit, so they won't go back again.

Meanwhile, a rebel comes out of a crack in a wall by a town behind the house, he turns, and waves. He sits down behind the building, while waiting for the three other rebels coming out from the crack. They lean into the house, then assault at the same time. (The house is now 'hollow', with windows, and a door, which closes behind them, so they won't exit again).

I've also made alot of math_counters and trigger_relays, so that if you kill anyone too early, everything will work as it should. (A combine dying before he get's to the rally point will add 1 to the counter, that counts how many combines are ready to assault, and other things..)

After the combines have went into the yard, a helicopter comes by, dropping 4 more combines. (Since rebels are SO much better than the combines)

The battle goes on forever, because when all combines die (exept the ones coming with the helicopter) a new dropship will arrive.
When all rebels die, new rebels will come from the town.

Image
Image
Image


Please just watch it =D
I can upload the .vmf if anyone wants it..
http://www.home.no/grantax/downloads/dropship2.bsp
Didn't zip it, it's only 1 mb.
Grantax
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Tue Mar 14, 2006 1:33 pm
Location: Norway

Postby thefilthelement on Tue Apr 04, 2006 2:47 pm

Is there a way to make the dropship stay landed after dropping off the soldiers? Also, no matter where I put the path the ship goes there, flies way up and slowly comes back down.
thefilthelement
Regular
Regular
 
Joined: Mon Jan 16, 2006 11:39 am

Postby DieparBaby on Thu May 11, 2006 2:45 pm

Wow what a great tutorial. Can't wait to finish it.

And Grantax, your map sounds awesome.
DieparBaby
Member
Member
 
Joined: Tue May 09, 2006 2:19 pm

Postby marnamai on Tue Feb 13, 2007 2:07 pm

How can I prevent the dropship to fly in at high speed and passing its dropoff point.

Now it does that then hovers backwards, it looks really odd.
User avatar
marnamai
Veteran
Veteran
 
Joined: Thu Nov 10, 2005 12:17 pm
Location: Belgium

Postby angrysully on Thu Jun 28, 2007 3:59 pm

I thought this was a sweet tut. After I did everything said in the tut, i compiled and tested my map. When the drop ship swoops down and hovers, the combine instantly die and appear under the ship, maybe the drop off point is to close to the the path. Anyways, after they die, the drop ship just kind of stays there hovering.
angrysully
Just Joined
Just Joined
 
Joined: Thu Jun 28, 2007 3:54 pm

Postby Dwin on Fri Jul 06, 2007 3:44 pm

Grantax, how did you manage to get newly spawned soldiers to do the assault? In my tests, when you introduce new soldiers to the assault, they are only able to rally at the rally points but unable to proceed to the assault points. When you type developer 2 in console, a message displays with something along the lines of failing to get to the assault point.
Dwin
Regular
Regular
 
Joined: Mon Sep 05, 2005 12:12 am
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users