VERC: Better Sprites With Env_Beam Last edited 1 year ago2022-09-29 07:54:11 UTC

I'll start of with a graphic example. Imagine our dramatic industry map has some steam vents, like pictured below:
User posted image
As the player inches towards the vents, the hiss of the steam fills his ears. Upon looking from an upward angle at the vents, they look like this:
User posted image
See that vent on the right? Has that happened to you? Yeah, happened to me too. Seems those darn sprites always face the player... and quite frankly, that?s only good for circular shaped sprites, not sprites that have to come from and go to a certain spot. Luckily, you can make sprites that don't turn on the vertical axis (like the vent on the left) and take advantage of some other wonderful features of the env_beam entity at the same time.

Prerequisite: The env_beam entity

Ok, for most of this to go off as smoothly as possible, I'm going to explain some things to those of you that are new to the env_beam. Those who are familiar with the entity may safely skip this section.

An env_beam is an entity that draws a beam between two points. You make the start and end points, usually info_targets for something like steam. Then you make the env_beam, which you set to use those targets as its start and end points. The beam itself is what is rendered in-between these points.

How it Works:

We have established that an env_beam renders a beam between two points. Now here comes the magic: the game can generate a beam to display, or you can supply it with a sprite to use. And since the top and bottom of the beam are anchored at these two points, the sprite is as well.

How To Make Smoke:

Ok, you will need three entities for this: Name one of the info_targets smoke_top and the other smoke_bottom. Now in the env_beam, add smoke_top as the starting point (don't worry, the smoke will still travel upward), and smoke_bottom as the ending point. You should end up with something similar to this:
User posted image
In the env_beam, you need to set some more things up:
  • Brightness: How "solid" you want the sprite. A value around 200 should make for some nice smoke.
  • Beam Color: This will recolor the sprite. Gray is good for smoke (pink smoke is kinda cool looking though...).
  • Life: Set this to 0, for infinite, unless you want your smoke to disappear after a time.
  • Width of Beam: You can make the sprite wider or thinner. I used 100.
  • Sprite Name: This is what sprite is displayed. I used sprites/lgtning.spr. Believe it or not, it looks like smoke when used this way.
  • Texture Scroll Rate: This is how fast the sprite scrolls down the beam. For smoke shooting out of a pipe or something, you would use a high number. As my smoke is just meandering, I used 5.
  • Frames Per 10 Seconds: Surprisingly, I haven't been able to get sprites to play any animations. Which means this trick is mostly for scrolling things, like smoke.
Now, in the flags section check start on and shade start. The latter key will make the smoke fade at the top, really enhancing the effect.

Closing Remarks/Files

Alright, now you know the basics for making sprites with env_beams. Play with it a bit, you may surprise yourself with what you can find. For reference, the Collective entity guide on env_beam can be found here.

I have included an example RMF for you to look through. It has an env_beam sprite and a normal sprite, for comparison purposes.
This article was originally published on Valve Editing Resource Collective (VERC).
The archived page is available here.
TWHL only publishes archived articles from defunct websites, or with permission. 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.