creating flying creatures

Also see the documentation for "global_flyin.scr".

To Set Up Crash Version

To set this version up in the editor, you'll need:

  • spline path for the creature to follow
  • script model using the creature you want to fly in
  • an impact mark that's either a decal, or made of brushes
  • a trigger brush

These four things HAVE to be there, it won't work right unless all four elements exist.

You use an info_splinepath to make the path the creature will follow. You CTRL+K them together so they're all linked in a chain. The only values you'll want to play with per node are the speed values. The speed value is a percentage. 1 is the default, and that's 100% (normal speed). If you want it to go faster, you increase the number (so 2 would make the object go 200% of normal speed, or twice as fast). If you want it to go slower you decrease the number towards 0, but not below (so .5 would tell the object to go 50% of normal speed, or half as fast). This is from a node-to-node basis mind you, so you can have the objects go fast between two nodes, and then slow down between two different nodes, etc.

Place a script model in the level, and set the model keyvalue towards the creature .tik you want to use (there's a nifty little model button you can use on the entity dialog).

Make an impact crater that sits on top of the ground. If you look in the example map, you'll see it's just a simple set of brushes that can go ontop of the ground. A decal FX would work really nice as well.

Make a trigger brush. THIS IS THE IMPORTANT PART. You have to place the trigger brush on top of the crater, where the creature will intersect it. Also, and again check out the example map, you don't want to make the trigger brush too tall or to big as right when the creature touches it, will it consider its self to have impacted. The IMPORTANT PART, is that you have to make sure you check the SCRIPTSLAVE flag on the trigger brush for this to work, if you don't, nothing will happen when the script model passes through it. Give the triggerbrush a unique targetname

Once you have all of that setup, here's the next IMPORTANT step. First, highlight the trigger. Now control+K the trigger to the impact crater. Then control+K the impact crater to the script model. Then control+K the script model to the first point in the spline path. IT IS VERY IMPORTANT THAT YOU LINK THESE OBJECTS TOGETHER IN THIS ORDER! The script derives the objects targetnames based on the order you link them together, so if you do not link them, or link them in the improper order, it won't work.

To Set Up Land Version

To set this version up in the editor, you'll need:

  • spline path for the creature to follow
  • script model using the creature you want to fly in
  • a trigger brush

These 3 things HAVE to be there, it won't work right unless all 3 elements exist.

The spline path is setup in the same manner as in the crash verison.

The script model is setup in the same manner as in the crash version.

The trigger brush is setup a little differently. You still need the trigger brush to intersect the path the creature will follow, but you'll want it to intersect it in the air. The goal of this version of the script is to have an alien fly in and then 'hop' off of his path and attack just above the ground. Look at the example to see what I'm talking about. Give the triggerbrush a unique targetname.

As in the crash example you'll have to control+K link all these objects together. Only this time here's the order:

  • trigger brush to script model
  • script model to first node in spline path

This concludes the radiant setup portion.

Script Setup and Threads to Launch

Here's what you need to do in your level's script file to get this to work. You'll want to include this line just after where you declare all your threads at the top of your script file (you can also check the global script synopsis document):

Dependancies:

Actual script file:


There's a setup thread you have to run for each flyin creature you've setup. So at the start of the level you'll want to run this thread:

The string value of the targetname of the trigger, is the trigger's targetname WITHOUT the '$'. The type of variation should be either the word 'crash' or 'land' without the quotes of course, and all lower case. So for example, I've setup a crash version, and the trigger brush has a targetname of crash_example, here's what the thread I would run would look like:

When in your script you're ready to activate the creature, you use this thread, again with the string value of the targetname of the trigger. Using the previous example with a trigger brush targetname of crash_example:

this will cause the creature to flyin on the path and activate. They can get shot out of the air as well and will explode when you do this (pretty cool to watch actually :).

Optional Parameters

There is a default effect to play for when the creature crashes into the ground, and gets shot out of the air. But you can override either of these by entering the following keyvalues on the trigger brush in radiant(please note, that entering a crash FX for the land version of the creature will have no effect :)

  • uservar1 - will replace the crash effect
  • uservar2 - will replace the shot out of the air effect

The Land example in the example map uses the uservar2 to set a different shot out of the air effect if you'd like to see an example. You just enter these as a standard keyvalue, and then the fx/fx-name-here.tik as the actual data.

There is also grouping options:

  • uservar3 - Group on-death thread to launch
  • uservar4 - Group number to assign to this creature

This way you can assign these guys to a group and use the onDeath thread funcitonality