Quake DeveLS - Temporary Entities
Tutorial: ViDMaSTeR
Information: WolfWings, ShockMan, and Nightbringer
Difficulty: Relatively
Easy
1)
{Byte count, Position origin, Dir direction, Byte color}TE_LASER_SPARKS - Particles obey gravity
To set the color to whatever you want, set the color to 0x000000pp where pp is the index number in the palette in hexadecimal value... ie.from 00 to ff.
Hexadecimal explaination:
0-9 is 0 to 9. a = 10, b = 11, c = 12, d = 13, e = 14, f = 15. So if you want for example 126 you take 126/16=7.875. That makes the first number 7 and the second will be whats left (126 - 7*16 = 14). And since 14 is equal to e the final value will be 7e.
2) {Short self-g_edicts,
Position start, Position end}
- Creates a string of models
TE_GRAPPLE_CABLE - The CTF grappling hook cable. Uses the model in models/ctf/segment/tris.md2
TE_MEDIC_CABLE_ATTACK - The medic's cable. Uses /models/monsters/parasite/segment/tris.md2 as it's model.
TE_PARASITE_ATTACK - The parasite's tentacle. Uses /models/monsters/parasite/segment/tris.md2 as it's model.
3) {Position start, Position
end}
- Spawns a trail from {start} to {end}
TE_BFG_LASER - Spawns a green laser
TE_BUBBLETRAIL - Spawns a trail of bubbles
TE_PLASMATRAIL - Spawns random green arcs
TE_RAILTRAIN - Spawns a blue spiral trail filled with white smoke
4) {Position origin, Dir direction}
- Spawns at {origin} and moving
towards {direction}
TE_BLASTER - Spawns a blaster splash
TE_BLOOD - Spawns a spurt of red blood
TE_BULLET_SPARKS - Same as TE_SPARKS, with a bullet puff and richochet sound
TE_GREENBLOOD - Spawns a spurt of green blood
TE_GUNSHOT - Spawns a grey splash of particles, with a bullet puff
TE_SCREEN_SPARKS - Spawns a large green/white splash
TE_SHIELD_SPARKS - Spawns a large blue/violet splash
TE_SHOTGUN - Spawns a small grey splash of particles, with a bullet puff
TE_SPARKS - Spawns a red/gold splash of particles
5) {Position origin}
- Spawns at {origin}
TE_BFG_BIGEXPLOSION - Spawns a BFG particle explosion
TE_BFG_EXPLOSION - Spawns a BFG explosion sprite
TE_BOSSTPORT - Spawns a mushroom-cloud particle effect
TE_EXPLOSION1 - Spawns a mid-air-style explosion
TE_EXPLOSION2 - Spawns a nuclear-style explosion
TE_GRENADE_EXPLOSION - Spawns a grenade explosion
TE_GRENADE_EXPLOSION_WATER - Spawns an underwater grenade explosion
TE_ROCKET_EXPLOSION - Spawns a rocket explosion
TE_ROCKET_EXPLOSION_WATER - Spawns an underwater rocket explosion
Note: The last four EXPLOSION entries overlap to some degree. TE_GRENADE_EXPLOSION is the same as TE_EXPLOSION2, TE_ROCKET_EXPLOSION is the same as TE_EXPLOSION1, and both of the EXPLOSION_WATER entries are the same, visually.
To send off a temporary entity: (where TE_* is the name, from the above list, of the temporary entity you want to spawn.)
gi.WriteByte (svc_temp_entity);
gi.WriteByte (TE_*);
Then, follow it with the listed series of gi.Write* commands for the last block of effects such as the explosions. Example:
gi.WritePosition(self->s.origin);Entity Effects: (entity_state_t->effects)
Effects are things handled on the client
side (lights, particles, frame animations) that happen constantly on the given entity.
An entity that has effects will be sent to the client even if it has a zero index model.
EF_ROTATE - rotate around Z axis
Entity Rendering Flags: (entity_state_t->renderfx flags)
RF_VIEWERMODEL - don't draw through eyes, only mirrors
The above three flags are used internally to take account of the various modelindex, gunindex, and similair model settings, so the user doesn't, for instance, see their own player model unless they look in a mirror.
RF_MINLIGHT - always have some light
RF_CUSTOMSKIN (theoretically) allows for dynamically-generated skins on models in single-player games. In practice, it's far too much of a speed hit, and makes the server unstable. No use in network games, as there's no facility for transmitting the dynamically-generated skin. Also, due to it's obvious model-dependance, there's no general-purpose capability for this, except perhaps some sort of team-related usage. Never used to my knowledge in the Id 3.14 source code. I think they may have been thinking about making some sort of effect similair to the Goldeneye 007 one where the enemies get bloody wherever you shoot them.
This site, and
all content and graphics displayed on it, |