Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

PLACING SCRIPTED_SEQUENCES

A Tutorial for Half-Life 2

Members see zero ads. Membership is 100% free

A tutorial on scripting.

This tutorial will take you through the steps of making a scripted sequence. For those of you who don't know what that is, a scripted sequence is an entity that allows an npc to play a string of certain animations (or just one, if you choose) back-to-back. PLACING SCRIPTED_SEQUENCES: For realism, place the script directly on the ground. It it is off the ground, the npc will instantaneously appear at the script's altitude, play the animation, and return to ground level. Make the script accessible to the npc. If he can't get to it, he won't play it. Any npc can use scripts, as long as it has animations. I will be using a fast zombie to demonstrate. Lets say I want to make him do his roar thing before he attacks me. Here's what you do: 1. Select the scripted_sequence entity and place it on the map. Name it "fastzombie_script_01". You can either have the zombie perform the roar where you placed the script, or you can have him do it where he is when the script is started. 2. Place an npc_fastzombie on the map. Name him "fastzombie_01". Lets make him run to the spot where he should roar. Place him somewhere where he is able to easily access the scripted_sequence. Set his sleep state key value to this - Sleep State: Waiting for input, ignore PVS. 3. Make a trigger_once brush entity. When you walk through this trigger, the zombie will run to the script and play it. But first, lets go back to the script. 4. Select your script again. The fast zombie roar animation is called "BR2_Roar". Go to the script's key values, and type "BR2_Roar" without the quotes in the action animation value. Set the Target NPC to fastzombie_01. Make sure the Move to Position value is set to Run. Go to the scripts flags and select only the No Interruptions and Priority Script flags. 5. Now go back to the trigger you placed. Select the outputs tab and add these outputs: OUTPUT 1 My output named: OnStartTouch Targets entities named: fastzombie_01 Via this input: Wake OUTPUT 2 My output named: OnStartTouch Targets entities named: fastzombie_script_01 Via this input: BeginSequence After delay in seconds of: 0.10* *You must have AT LEAST a 0.01 second delay because an npc can't wake and script at the same time. You should have successfully created a scripted sequence, mapper. Thanks for reading, and good luck with your animations. THE SLUMPRISE ANIMATION The slumprise animation sequence is a very useful tool in zombie maps. It is the animation that you saw when a zombie was sleeping and wakes up to surprise you in Half-Life 2. It can be used by all zombies. If you want to use a normal zombie, it is actually a prefab already in hammer. There are slumprise animations for fast zombies and poison zombies too. Use the zombie prefab to see how they work.

Comments

Sign up to access this!
  • DarkSlayer443 avatar
    DarkSlayer443 Joined 11y ago
    Offline
    408 points Ranked 47320th
    access_time 10y
    Pros: great tutorial, understood it all perfectly, Cons: not great on the eys Improvements: add some html to make it more readable and easier on the eyes! Notes: used your tut and it was clear to follow, very useful!
    Mapper avatar
    Mantra
    Mapper
    URL to post:
  • Logan Dougall avatar
    Logan Dougall username pic Joined 13y ago
    Admin
    Offline
    Half Life Storm Flag Affiliation: Half Life Storm
    20,221 points Ranked 254th
    40 medals 3 legendary 9 rare
    • Achieved Admin clearance Medal icon
    • 500 posts awarded Exemplary Feedback Medal icon
    • 10 years a member Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    Logan Dougall avatar
    Logan Dougall
    Half Life Storm Flag
    Affiliation
    Half Life Storm
    Admin
    access_time 11y
    Should this not be in the mapping section as it has nothing to do with coding for HL2?
    • Agree x 1
    Structural Designer / Dad :)
    URL to post:
  • TheGrymoire avatar
    TheGrymoire Joined 12y ago
    Offline
    5,837 points Ranked 1121st
    access_time 11y
    Posted by papercoffee
    Posted by Point Blank A tut without HTML is like a baverian cream dog without cream!
    What de hell is a "baverian cream dog" ?? Btw. good tutorial.
    ? D:
    Fractals in Nature avatar
    Mantra
    Fractals in Nature
    URL to post:
  • papercoffee avatar
    papercoffee Joined 11y ago
    Offline
    2,992 points Ranked 19751st
    11 medals 1 legendary 1 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Became a Studio Leader Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    access_time 11y
    Posted by Point Blank A tut without HTML is like a baverian cream dog without cream!
    What de hell is a "baverian cream dog" ?? Btw. good tutorial.
    Coffee_addicted avatar
    Mantra
    Coffee_addicted
    URL to post:
  • Static Frost avatar
    Static Frost Joined 11y ago
    Offline
    771 points Ranked 42264th
    access_time 11y
    Good tutorial, very useful. Four letters: H T M L. When it comes to tutorials, HTML is essencial. A tut without HTML is like a baverian cream dog without cream!
    Banana Hammock!! avatar
    Mantra
    Banana Hammock!!
    URL to post:
  • Logan Dougall avatar
    Logan Dougall username pic Joined 13y ago
    Admin
    Offline
    Half Life Storm Flag Affiliation: Half Life Storm
    20,221 points Ranked 254th
    40 medals 3 legendary 9 rare
    • Achieved Admin clearance Medal icon
    • 500 posts awarded Exemplary Feedback Medal icon
    • 10 years a member Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    Logan Dougall avatar
    Logan Dougall
    Half Life Storm Flag
    Affiliation
    Half Life Storm
    Admin
    access_time 11y
    Small note, don't add criteria that don't apply :P How can I rate this submissions animations when its just words and pictures heh :P Thats meant for skins, models etc. Anyways, its a good tutorial, nice to see some scripting ones coming in for a change. Would have been nice to have referenced the images you added a bit more, ie "Make the script accessible to the npc. If he can't get to it, he won't play it. (See Screenshot X)". And throwing in some HTML formatting to add emphasis to words and important info to highlight them helps along with your numbering system.
    Bold Blue Class Italics Red Class Underline Green Class Code Class Orange
    • Unordered List items
    • 2
    1. Ordered List Items
    2. 2
    Quote for the code.
    Some term definition/explanation would also be good "Sleep State: Waiting for input, ignore PVS" - PVS means? Just a little bit of explanation/extra like what you've got at the start and end there; So that the tutorials a bit more informative rather than just the steps needed to make this one particular sequence. I'd be interested in reading more about scripted sequences/advanced uses if your thinking of writing some since you break it down nicely. Still, really well done tutorial and made for a nice read this morning.
    Structural Designer / Dad :)
    URL to post:
  • Dr. Whoop DSc avatar
    Dr. Whoop DSc Joined 11y ago
    Offline
    35,274 points Ranked 127th
    access_time 11y
    Pros: Very helpful. Easy to read. Improvements: Make the text have pritty colours :D
    URL to post:
  • Dragon DirectX 11 avatar
    Dragon DirectX 11 Joined 11y ago
    Offline
    access_time 11y
    Pros: Looks like a good tutorial, I didn't get lost so that is a good sign. Cons: Make some more advanced scripting tutorials. Improvements: Show more scripts for other npcs Notes: pretty good tutorial
    F-A-I-L-E-D
    URL to post:

Embed

menu
Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Key Authors
Nathan Grove
Unknown

Submitter

Naythynn avatar
Naythynn Joined 11y ago
Offline
1,018 points Ranked 25010th
Naythynn
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • favorite 5
  • remove_red_eye 10.8k
  • mode_comment 12
  • access_time 11y
  • access_time 8y

More from Submitter

menu

WiPs by Submitter

menu

More Scripting Tutorials