Welcome Back! Please login below. If you are not yet a member, why not register? Enjoy!

Join the forum, it's quick and easy

Welcome Back! Please login below. If you are not yet a member, why not register? Enjoy!

Would you like to react to this message? Create an account in a few clicks or log in to continue.
A vehicle that drives itself!  Npc_vehicledriver at work! 31We have now opened a new Build server! IP: 188.165.193.102:27016A vehicle that drives itself!  Npc_vehicledriver at work! 31

3 posters

    A vehicle that drives itself! Npc_vehicledriver at work!

    Chip
    Chip
    Map Designer
    Map Designer


    Number of posts : 88
    Age : 30
    Location : Wisconsin
    In-Game Name : Chip Jones

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 1000 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-10-11
    Points : 51
    Reputation : 3

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty A vehicle that drives itself! Npc_vehicledriver at work!

    Post by Chip Wed Oct 15, 2008 2:06 am

    http://developer.valvesoftware.com/wiki/Npc_vehicledriver

    Ever wondered what the npc_vehicledriver was or did? The name kind of explains it all. But, Chip, how is it used?

    Well it works like any other npc, if you have worked with them before. This guy will control the vehicle of who's name you enter into the "Vehicle to Drive" keyvalue. He can follow a chain of path_corners you set. You could make a racing map with this!

    Let us begin then!

    First, using the entity tool (for those who don't know) place an npc_vehicledriver and a prop_vehicle_* (Any vehicle, jeep, airboat, jalopy, whatever!).

    The vehicle driver should be a rollermine, and the vehicle a little red square. The square means it has no model set yet, so lets set one!

    For the World Model keyvalue for the vehicle, select the corresponding model in the Model Viewer:
    models/buggy.mdl
    models/vehicle.mdl (The jalopy, for ep2)
    models/airboat.mdl


    A vehicle that drives itself!  Npc_vehicledriver at work! 261d8e109d98ee3b8edd505f39774a35


    Give it a name, something like vehicle_1.



    Now on to the driver!

    Give him a Name like vehicle_1_driver. (Organized names help if you have huge maps with tons of named entities.)
    Scroll down to the Vehicle to Drive keyvalue, and put in the name of your vehicle. In our case this is vehicle_1.

    See the keyvalue "Target Path Corner"? This is the first corner it goes to in a path that tells him where to drive around! Set it to pathcor_1 . It will be red until we make that entity, so do not worry.

    A vehicle that drives itself!  Npc_vehicledriver at work! 6d79926ca04550de8fed99421a5f80ef




    Now on to the path!

    Alright so, what is a path_corner?

    It is, technically, where the npc has to go. They can be chained together to make a path! That is what we will do here.

    So, place a path corner where you want the path to start. Give it a name, pathcor_1

    Here you make your decision, do you want a chain to make a loop or a path, or do you want the vehicle to only go to one place?

    If you want a loop, see below. If not, skip to the GREEN text below in this post which states the end of the extra section.

    --------------------------------------------

    For "New Stop Target", make that pathcor_2 . Again, it will be red until the entity is made.

    It will look like this:
    A vehicle that drives itself!  Npc_vehicledriver at work! 833f65b32a8c8374dc16fc811cfed0d7

    Now, in the "Top 2d View" (The top right hammer view panel) select your path_corner, and shift drag it to make a copy. There should be a line connecting them. If not, try again. Keep doing this until your path is complete.

    On the last one, open up the properties menu and for "Next stop target" set that to pathcor_1 IF you want it to go back to the beginning. If you want it to end there, make it blank.

    Extra section ends HERE

    Now to make that car actually START around the track!

    If you want to use a button, see PART ONE. If want it to start on map load, see PART TWO.

    PART ONE

    This assumes you know how a button works, if not, see a tutorial site mentioned in the sticky --or-- request I add it if the need is dire.

    Basically, it should look like this:
    A vehicle that drives itself!  Npc_vehicledriver at work! 50f89d65e6c6b046feef1b6ac82bb7c4

    That's it. Skip past PART TWO.



    PART TWO
    So you want it to start when the map loads?

    Place a logic_auto. Open up the properties.

    A vehicle that drives itself!  Npc_vehicledriver at work! Ce79eb31817bc06342f8330c732f7a7f

    No need to fiddle with keyvalues with a logic_auto! The OnMapSpawn fires the output AS SOON AS THE MAP LOADS.


    End Parts

    Now, sprinkle about some info_node's. These are little markers that npc's use to tell where they can and can't go. See this page for perfered placement.
    http://developer.valvesoftware.com/wiki/Nodegraph

    Start your map! If you followed the tutorial, it should work! They are kind clumsy, and so you should give them a relatively straight path with wide turns or at least a lot of crash room!



    -Chip


    Last edited by Chip on Wed Oct 15, 2008 1:32 pm; edited 1 time in total
    liam6478
    liam6478
    A Legend To The Server!
    A Legend To The Server!


    Number of posts : 693
    Age : 28
    Location : UK, bristol
    In-Game Name : LI4M

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue2 / 1002 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-05-27
    Points : 490
    Reputation : 8

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by liam6478 Wed Oct 15, 2008 2:51 am

    thank you chip very good tutorial
    gold star for you ^_^
    Chip
    Chip
    Map Designer
    Map Designer


    Number of posts : 88
    Age : 30
    Location : Wisconsin
    In-Game Name : Chip Jones

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 1000 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-10-11
    Points : 51
    Reputation : 3

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by Chip Wed Oct 15, 2008 2:57 am

    liam6478 wrote:thank you chip very good tutorial
    gold star for you ^_^
    *Takes gold star and stows into pocket*

    A hundred bucks for anyone who knows who is in my avatar.
    The Erik
    The Erik
    Operator / Moderator
    Operator / Moderator


    Number of posts : 1545
    Age : 32
    Location : Hillerød, Denmark
    In-Game Name : [BS] The Erik

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue43 / 10043 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-06-08
    Points : 816
    Reputation : 38

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by The Erik Wed Oct 15, 2008 1:26 pm

    very nice Very Happy
    i see hammer haven't changed a lot since 1.5..
    i used to make maps for CS 1.6..
    Chip
    Chip
    Map Designer
    Map Designer


    Number of posts : 88
    Age : 30
    Location : Wisconsin
    In-Game Name : Chip Jones

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 1000 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-10-11
    Points : 51
    Reputation : 3

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by Chip Wed Oct 15, 2008 1:30 pm

    The Erik wrote:very nice Very Happy
    i see hammer haven't changed a lot since 1.5..
    i used to make maps for CS 1.6..
    Cool.
    The Erik
    The Erik
    Operator / Moderator
    Operator / Moderator


    Number of posts : 1545
    Age : 32
    Location : Hillerød, Denmark
    In-Game Name : [BS] The Erik

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue43 / 10043 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-06-08
    Points : 816
    Reputation : 38

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by The Erik Wed Oct 15, 2008 1:40 pm

    but i definetely think that a gu driving a car around, would be a fun addition to any map (at least something to crash and burn! ) lol!
    Chip
    Chip
    Map Designer
    Map Designer


    Number of posts : 88
    Age : 30
    Location : Wisconsin
    In-Game Name : Chip Jones

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 1000 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-10-11
    Points : 51
    Reputation : 3

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by Chip Wed Oct 15, 2008 1:56 pm

    The Erik wrote:but i definetely think that a gu driving a car around, would be a fun addition to any map (at least something to crash and burn! ) lol!
    Yeah. They can race, and you can tell it different places to go in different inputs by changing the path track you give in parameter override.

    And they can crash, probably run people over if they are in the way, I haven't checked is ai_relationship does anything with these, could be fun Surprised
    The Erik
    The Erik
    Operator / Moderator
    Operator / Moderator


    Number of posts : 1545
    Age : 32
    Location : Hillerød, Denmark
    In-Game Name : [BS] The Erik

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue43 / 10043 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-06-08
    Points : 816
    Reputation : 38

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by The Erik Wed Oct 15, 2008 2:17 pm

    but if they crash, will they get back on track Question
    Chip
    Chip
    Map Designer
    Map Designer


    Number of posts : 88
    Age : 30
    Location : Wisconsin
    In-Game Name : Chip Jones

    Credits Credits :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 1000 / 100A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Warnings! Warnings! :
    A vehicle that drives itself!  Npc_vehicledriver at work! Left_bar_bleue0 / 100 / 10A vehicle that drives itself!  Npc_vehicledriver at work! Right_bar_bleue

    Registration date : 2008-10-11
    Points : 51
    Reputation : 3

    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by Chip Wed Oct 15, 2008 2:34 pm

    They try. You can probably have them stop on take damage or something similar.

    Sponsored content


    A vehicle that drives itself!  Npc_vehicledriver at work! Empty Re: A vehicle that drives itself! Npc_vehicledriver at work!

    Post by Sponsored content


      Current date/time is Sun Apr 28, 2024 12:26 pm