Vlatitude Archive: Scripting Tutorial Part 3 Last edited 5 years ago2019-04-25 09:34:20 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.
Download example

In this tutorial I will tell you how to make a zombie rip through a wall. I expect that you have read Vlad's previous two scripting tutorials. The only new things introduced here will be the func_breakable entity.

Ok first we need to make a hole in the wall for the zombie to rip through. This is the hardest part because you have to align all the textures to get them to look right. In the example map, which comes from part of my unfinished single player level, we have the zombie rip through a cinder block wall.
User posted image
You can see the screenshot of the hole without the func_breakable. As you can see I've aligned my textures to make it look realistic. Now we need to place a func_breakable entity to cover up the hole. As you might have guessed, it's a brush based entity. First make a brush to cover the hole and texture it appropriately, then tie it to the func_breakable entity. Now go into the func_breakable's properties and give it a name of zombie_script_breakable. For Material type we want Cinder Block and there's one last important thing we need to do. Go into the flags and check Only Trigger. If this isn't checked then you would be able to break the wall before the script is finished.
User posted image
Above is a top down view of the level. We'll start describing things from the top down. First is the trigger_once with a target of zombie_script_ss. Second is the func_breakable which we talked about above. It has a name of zombie_script_breakable. Third is the scripted_sequence entity. It has a name of zombie_script_ss, a target of zombie_script_breakable, a Target Monster of zombie, an Action Animation of busting_through_wall, and a Move to Position of Walk. In the flags we have No Interruptions checked. This makes the script uninteruptable. And lastly we have the zombie whose only important attribute is a name of zombie.

Now for a walk through. When you walk towards the wall you go through the trigger_once which triggers the scripted_sequence. The zombie walks to the scripted_sequence and performs the busting_through_wall animation. After he's done with the animation, the func_breakable is triggered and the wall busts open.
This article was originally published on 69th Vlatitude.
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.

Comments

You must log in to post a comment. You can login or register a new account.