Gunship Paths

Tutorial collection, comprehensive listings on main site.

Gunship Paths

Postby Tutorial on Sun Mar 06, 2005 11:42 pm

category
General Half-Life 2/Scripting

description
Shows you how to setup a gunship to follow a designated route.

keywords
gun, ship, gunship, path, paths, npc.

Unlike a lot of the other NPC's, helicopters and gunships use paths instead of nodes to decide where to go. To make a basic, square path that a gunship follows, you:

1) Make a large box and hollow it. Place an npc_combinegunship in the center of your room. Make the room big enough that the gunship will have plenty of room to fly around. They can go a fair bit off track when running away from rockets. Open up the properties box of the gunship, and set its 'Target path_track' to "path1"

Image

2) Place a path_track entity towards a corner of the room, about halfway between the ground and the ceiling. Open up the properties box and set its name to "path1". Set its 'Next Stop Target' to "path2". Hold down the shift key and drag the first path_track to a different corner of the room.

Release the left mouse button before shift, and a yellow line should now connect the two points. Thats a path, but it does not form a loop, so the gunship would follow the path to the end, then stop. Change the 'Next Stop Target' of the second point to "path3", then shift-drag again to make a third point.

Repeat this until you have four points, then set the 'Next Stop Target' of the fourth point to "path1". There should now be a yellow line connecting the path_tracks, forming a square. The gunship will follow this path.

Image

3) Whack in some lights and an info_player_start and compile. You might want to put on god mode, because the gunship will rape you pretty fast otherwise. I've noticed that if you don't fight back the gunship will sit and hover at a point, shooting at you until you shoot at it. I haven't experimented much with the settings yet, but you can.

Serever
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby Tenma on Sun Jun 19, 2005 1:22 pm

Hello Serever and all other toturial masters ^_^

I am having trouble making paths.
It seems my Strider and Combine Helicopter do not follow the path i make.
I have tried path tracks and path corners but none work.

Could it be something i haven't done well in the output/input screen?
Here's some info on what i added to the Strider:

OnFoundEnemy ant Assault
OnFoundPlayer !player ApplyRelationship (this dosen't really matter if AI_Relationship is working properly)
OnWake !player ClearTargetPath

I'm trying to make a level where you see a strider clear out the city by killing all the antlions in his surroundings as a testmap for my future plans :)
Can somebody clearly explain what i'm doing wrong?

Greets, Tenma

--------
BTW, Thanks, Serever, to point out most of the things i needed to know about. it really helped me alot. ^_^
Tenma
Member
Member
 
Joined: Sun Jun 19, 2005 1:14 pm

Postby zombie@computer on Sun Jun 19, 2005 4:58 pm

seems to me you are trying to make the player follow a path?!?
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Postby belboz on Thu Nov 03, 2005 1:45 am

combine gunships need to be told where to go else they will just hang around the first path point they find, and will only move somewhere else if you shoot it.
So you need to add output to the path point
as in on path1
OnPass nameofgunship FlyToSpecificTrackViaPath path2 0.00 No
and for the next path point
OnPass nameofgunship FlyToSpecificTrackViaPath path3 0.00 No
etc.
OnPass nameofgunship FlyToSpecificTrackViaPath path4 0.00 No
etc.
OnPass nameofgunship FlyToSpecificTrackViaPath path1 0.00 No

then the gunship will fly around in a loop and kill you. I found this out because I wanted a gunship to slide across the sky above you, then come back and attack you, then when it was dead it would try to crash on you. So when the gunship was spawned in, it hung around the first point in the path, and shot at you from there, instead of doing what it was supposed to do. But after adding the OnPass output to the path points it did what it was supposed to do. You can have a straight path of track points, and on each end of the path tell it to fly back to either the start or the end.
belboz
Dumpling
Dumpling
 
Joined: Thu Nov 03, 2005 1:25 am

Postby zombie@computer on Thu Nov 03, 2005 2:30 pm

no, you dont need to do that, but you must read carefull what teh command does. The most obvious input to make the ship fly a path only makes the ship go to the first path point. You need the input flytospecifictrackviapath or something like that, and make it target the LAST path_track. the npc will decide itself at which path_track it begins (the nearest)
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Postby InternalRage on Sun Jun 04, 2006 3:43 pm

Do you need all of them in between then? Sureley you'd only need 2, apart from sharp turns.
Damn ProZak is... sexy!
Image
User avatar
InternalRage
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Tue Jan 10, 2006 8:41 pm

Postby tharawdeal on Sun Jun 04, 2006 6:06 pm

I'm not sure of this, but if the path_track used with a helicopter is anything like the info_node (only not leaving the decision of where to go up to the AI)--then the helicopter wouldn't be able to hover unless it had a path_track to stop at, just like the AIs can only stop and shoot where info_nodes are placed.
tharawdeal
Member
Member
 
Joined: Thu May 11, 2006 12:01 pm

Postby Lolburst on Mon Nov 27, 2006 4:15 pm

I just noticed one thing, My console says: ERROR Gunship (something) Have access to bone (Something)!
WIP MAPS:

oc_storage
Lolburst
Regular
Regular
 
Joined: Tue Nov 21, 2006 3:01 pm

Postby forty-nin3 on Mon Nov 27, 2006 5:12 pm

You'll get better answers if you post the exact error.
Image
User avatar
forty-nin3
Been Here A While
Been Here A While
 
Joined: Tue Oct 17, 2006 4:56 pm
Location: Azeroth D:

Postby Lolburst on Tue Nov 28, 2006 2:10 pm

It works only when Ingame.

So compiling only makes errors for gunship.
WIP MAPS:

oc_storage
Lolburst
Regular
Regular
 
Joined: Tue Nov 21, 2006 3:01 pm

Postby dangerdan on Sun Jan 14, 2007 3:37 pm

anyone know how to do this with a prop_dynamic?

doesnt need to shoot at player, just fly over a certain area
dangerdan
Member
Member
 
Joined: Fri Dec 22, 2006 11:34 am

Crash

Postby thelinuxpenguin5 on Sun Jan 21, 2007 7:25 pm

Everything looks fine with mine, except that once HL2 launches, it crashes, w/o loading map.
thelinuxpenguin5
 

Return to Tutorials

Who is online

Users browsing this forum: No registered users