Halfwit-2 : Half-Life 2 Bits and Pieces


Current Status

- Tutorials : 97
- Projects : 12
- Materials : 37
- Resources : 15

With a little help from....

- TrebTreb          (Site)
- Stadric             (Site)
- Steve Newman (Site)
- Sepulverture
- Zogger
- Boomstick123
- Scoobs
- Avego
- Anders
- Andreason
- Bornstein
- Danial
- Wise
- nudel
- YoMother
- Senji
- Gronblad
- Manefesto
- Drax
- Meathead
- Raidenator
- Zyx
- Sp00n             (Site)
- Mynameisme
 
Tutorials
Important entities referenced in this tutorial.
Click on the entity for more info from the Valve Developer Site.


scripted_sequences | npc_alyx | npc_barney


35. Scripted Sequences


All basic tutorials are exactly that: basic. They are step by step guides through each operation, hopefully fully illustrated. Experienced mappers may find these tedious, but they are essentially designed for newbies :-)




    In this tutorial I have tried to show how to set up scripted_sequences. These are set pieces of animation that are included in the game models. In this example Alyx will walk to a spot, do a cartwheel and then go and sit. Barney at the same time will go to a spot, wave and then go and sit down. You can see the various sequences available for each model in the Model Viewer.

    model viewer

  1. The model viewer is in c:\program files\valve\steam\steamapps\yourname\sourcesdk\bin and is called hlmv.exe. If you run it this screen will open:



  2. Click on file | load model and it will open the root directory of models where many of them are kept. Double click on one and they will appear in the viewer.



  3. Click on the Sequences tab, and in the drop down there is a long list of animations. Click on one and it will be shown in the viewer.

    If you do a search here,there is some more information.

  4. Open Hammer and either load up a room or make one 512 x 512 x 256h, texture it and put an Info_player_start in and some lights if you want them.

  5. Click on the Entity tool and put and NPC_Alyx and an NPC_Barney in the map on the right hand side.



  6. Open the Properties for NPC_Barney and give it the Name barney

  7. Open the Properties for NPC_Alyx and give it the Name alyx

  8. Click on the Entity tool and select scripted_sequence

  9. Place four of these in the map, roughly as in the picture



  10. Select the scripted_sequences and name them script_1 2 3 4 as shown.

  11. Open the Properties for script_1

    Target NPC      barney

    Action Animation      wave

    Move to Position      Walk

    Next Script     script_2

  12. Open the Properties for script_2

    Target NPC      barney

    Action Animation      sit_chair

    Post Action Ide Animation      sit_chair

    Move to Position     run

  13. Open the Flags tab and check Loop in Post Idle (This ensures that Barney remains seated)

  14. Open the Properties for script_3

    Target NPC      alyx

    Action Animation      flipleft

    Move to Position      Walk

    Next Script     script_4

  15. Open the Properties for script_4

    Target NPC      alyx

    Action Animation      sit_chair

    Post Action Ide Animation      sit_chair

    Move to Position     run

  16. Open the Flags tab and check Loop in Post Idle (This ensures that Alyx remains seated)

  17. Just to the left of script_2 and 4 make small brushes, 16 x 32 x16 high. These are where Barney and Alyx will sit.

    We'll put a trigger in and set up the inputs and outputs.

  18. Click on the Entity tool and place a weapon_shotgun

  19. Open the Properties and click on Outputs, click Add. Enter the following:





    These start both the scripted_sequences

  20. Open the Properties of script_1 click on Outputs click Add enter the following:



  21. Open the Properties of script_3 click on Outputs click Add enter the following:



  22. Compile and run the map.



Click to Comment on this tutorial or Click to Complain

The next tutorial is "36. Citizen Screams and Runs" and can be found here.


Return to the top of the page