Entity Attribute: Entity Effects Last edited 3 months ago2024-08-09 05:28:24 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.
Entity Effects are the effects that can be applied onto entities. It can be done with the addition of pev->effects in programming or adding effects key value in any entity properties in mapping.

Programming

According to the code in const.h, these are the available effects in the vanilla game.
// entity effects
#define EF_BRIGHTFIELD 1    // swirling cloud of particles
#define EF_MUZZLEFLASH 2    // single frame ELIGHT on entity attachment 0
#define EF_BRIGHTLIGHT 4    // DLIGHT centered at entity origin
#define EF_DIMLIGHT 8       // player flashlight
#define EF_INVLIGHT 16      // get lighting from ceiling
#define EF_NOINTERP 32      // don't interpolate the next frame
#define EF_LIGHT 64         // rocket flare glow sprite
#define EF_NODRAW 128       // don't draw entity
#define EF_NIGHTVISION 256  // player nightvision
#define EF_SNIPERLASER 512  // sniper laser effect
#define EF_FIBERCAMERA 1024 // fiber camera
To use these effects, simply add the effect definition in the pev->effects argument. (e.g.: pev->effects = EF_BRIGHTLIGHT)

Mapping

Mappers can easily add effects key value to use these effects for their entities (Turn off Smart Edit first). The entities must be brushed-tied (usually starts with prefix func_ and must be tied with an origin texture, similar to doors, or else its origin will be the map origin. Some point entities may also accept an effects keyvalue, with the same effect applied to them. Example of the effects:
Entity effects #1Entity effects #1
Entity effects #4Entity effects #4
Entity effects #8Entity effects #8
Entity effects #64 (rocket glow sprite hidden inside brush)Entity effects #64 (rocket glow sprite hidden inside brush)
Effect setupEffect setup

Notes

Example map

Loading embedded content: Vault Item #4505

3 Comments

Commented 2 years ago2022-10-16 20:35:24 UTC Comment #104850
Do this work on point entities? If not, need to specify that it only works on brushes.
Commented 11 months ago2023-12-18 07:50:06 UTC Comment #105759
是的。
Yes.
Commented 3 months ago2024-08-21 20:49:12 UTC Comment #106319
I can confirm at least EF_INVLIGHT (16) and EF_LIGHT (64) works on point entities.
It'd be useful to do further testing and create a table of which effects works on which type of entity.

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