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
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.
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:
My output named: OnStartTouch
Targets entities named: fastzombie_01
Via this input: Wake
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.
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!
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 ClassItalics Red ClassUnderline Green ClassCode Class Orange
Unordered List items
Ordered List Items
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.
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