View Single Post
Author Message
Prowler
Senior Member
Join Date: Nov 2004
Old 11-10-2004 , 05:03   Const.h Messages Written for AMX
Reply With Quote #1

Well i spent some time and re-wrote all the const.h SVC_TEMPENTITY messages for direct use with AMX, so all you need to do is copy/paste and then change the bits that need changing.

I will add an example on how to use each on at a later date (or rathe, an example on the ones i know how to use)

Edit(vittu):more info on TempEntity messages - http://www.qlad.net/doc/cmd_TempEnt.php
Code:
#define MSG_BROADCAST   0    //unreliable to all #define MSG_ONE       1    //reliable to one msg_entity #define MSG_ALL       2    //reliable to all #define MSG_INIT      3    //write to the init string #define MSG_PVS       4    //Ents in PVS of org #define MSG_PAS       5    //Ents in PAS of org #define MSG_PVS_R     6    //Reliable to PVS #define MSG_PAS_R     7    //Reliable to PAS #define MSG_ONE_UNRELIABLE  8    //Send to one client, but don't put in reliable stream, put in unreliable datagram  could be dropped //----------temp entity events------------------------------------------------- #define TE_BEAMPOINTS   0    //beam effect between two points message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_BEAMPOINTS) write_coord() // start position write_coord() write_coord() write_coord() // end position write_coord() write_coord() write_short() // sprite index write_byte() // starting frame write_byte() // frame rate in 0.1's write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() // noise amplitude in 0.01's write_byte() // Red write_byte() // Green write_byte() // Blue write_byte() // brightness) write_byte() // scroll speed in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_BEAMENTPOINT   1    //beam effect between point and entity message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_short() // start entity write_coord() // end position write_coord() write_coord() write_short() // sprite index write_byte() // starting frame write_byte() // frame rate in 0.1's write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() // noise amplitude in 0.01's write_byte() // Red write_byte() // Green write_byte() // Blue write_byte() // brightness write_byte() // scroll speed in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_GUNSHOT      2    //particle effect plus ricochet sound message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() message_end() //----------------------------------------------------------------------------- #define TE_EXPLOSION    3    //additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() // write_short() // sprite index write_byte() // scale in 0.1's write_byte() // framerate write_byte() // flags message_end() //The Explosion effect has some flags to control performance/aesthetic features: #define TE_EXPLFLAG_NONE    0  // all flags clear makes default Half-Life explosion #define TE_EXPLFLAG_NOADDITIVE  1  // sprite will be drawn opaque ensure that the sprite you send is a non-additive sprite #define TE_EXPLFLAG_NODLIGHTS 2 // do not render dynamic lights #define TE_EXPLFLAG_NOSOUND   4  // do not play client explosion sound #define TE_EXPLFLAG_NOPARTICLES 8  // do not draw particles //----------------------------------------------------------------------------- #define TE_TAREXPLOSION   4   // Quake1 "tarbaby" explosion with sound message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() message_end() //----------------------------------------------------------------------------- #define TE_SMOKE      5    //alphablend sprite, move vertically 30 pps message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_short() // sprite index write_byte() // scale in 0.1's write_byte() // framerate message_end() //----------------------------------------------------------------------------- #define TE_TRACER     6    //tracer effect from point to point message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_coord() // end position write_coord() write_coord() message_end() //----------------------------------------------------------------------------- #define TE_LIGHTNING    7    //TE_BEAMPOINTS with simplified parameters message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_coord() // end position write_coord() write_coord() write_byte() // life in 0.1's write_byte() // width in 0.1's write_byte() // amplitude in 0.01's write_short() // sprite model index message_end() //----------------------------------------------------------------------------- #define TE_BEAMENTS     8   //Create a beam between two entities message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_short() // start entity write_short() // end entity write_short() // sprite index write_byte() // starting frame write_byte() // frame rate in 0.1's write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() // noise amplitude in 0.01's write_byte() //colour write_byte() write_byte() write_byte() // brightness write_byte() // scroll speed in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_SPARKS     9    //8 random tracers with gravity, ricochet sprite message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() message_end() //----------------------------------------------------------------------------- #define TE_LAVASPLASH   10     //Quake1 lava splash message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() message_end() //----------------------------------------------------------------------------- #define TE_TELEPORT     11     //Quake1 teleport splash message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() message_end() //----------------------------------------------------------------------------- #define TE_EXPLOSION2   12     //Quake1 colormaped base palette particle explosion with sound message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_byte() // starting color write_byte() // num colors message_end() //----------------------------------------------------------------------------- #define TE_BSPDECAL     13     //Decal from the .BSP file message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() //x,y,z, decal position center of texture in world write_coord() write_coord() write_short() // texture index of precached decal texture name write_short() // entity index //[optional - only included if previous short is non-zero not the world] //write_short() // index of model of above entity message_end() //----------------------------------------------------------------------------- #define TE_IMPLOSION    14     //tracers moving toward a point message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_byte() // radius write_byte() // count write_byte() // life in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_SPRITETRAIL    15     //line of moving glow sprites with gravity, fadeout, and collisions message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_coord() // end position write_coord() write_coord() write_short() // sprite index write_byte() // count write_byte() // life in 0.1's write_byte() // scale in 0.1's write_byte() // velocity along vector in 10's write_byte() // randomness of velocity in 10's message_end() //----------------------------------------------------------------------------- #define TE_BEAM       16    // obsolete //----------------------------------------------------------------------------- #define TE_SPRITE     17    // additive sprite, plays 1 cycle message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_short() // sprite index write_byte() // scale in 0.1's write_byte() // brightness message_end() //----------------------------------------------------------------------------- #define TE_BEAMSPRITE   18    // A beam with a sprite at the end message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_coord() // end position write_coord() write_coord() write_short() // beam sprite index write_short() // end sprite index message_end() //----------------------------------------------------------------------------- #define TE_BEAMTORUS    19     //screen aligned beam ring, expands to max radius over lifetime message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // center position write_coord() write_coord() write_coord() // axis and radius write_coord() write_coord() write_short() // sprite index write_byte() // starting frame write_byte() // frame rate in 0.1's write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() // noise amplitude in 0.01's write_byte() //colour write_byte() write_byte() write_byte() // brightness write_byte() // scroll speed in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_BEAMDISK     20    // disk that expands to max radius over lifetime message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // center position write_coord() write_coord() write_coord() // axis and radius write_coord() write_coord() write_short() // sprite index write_byte() // starting frame write_byte() // frame rate in 0.1's write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() // noise amplitude in 0.01's write_byte() //colour write_byte() write_byte() write_byte() // brightness write_byte() // scroll speed in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_BEAMCYLINDER   21    // cylinder that expands to max radius over lifetime message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // center position write_coord() write_coord() write_coord() // axis and radius write_coord() write_coord() write_short() // sprite index write_byte() // starting frame write_byte() // frame rate in 0.1's write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() // noise amplitude in 0.01's write_byte() //colour write_byte() write_byte() write_byte() // brightness write_byte() // scroll speed in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_BEAMFOLLOW   22     //create a line of decaying beam segments until entity stops moving message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_short() // entity:attachment to follow write_short() // sprite index write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() //colour write_byte() write_byte() write_byte() // brightness message_end() //----------------------------------------------------------------------------- #define TE_GLOWSPRITE   23    //creates a glowing sprite message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_short() // model index write_byte() // scale / 10 message_end() //----------------------------------------------------------------------------- #define TE_BEAMRING     24    // connect a beam ring to two entities message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_short() // start entity write_short() // end entity write_short() // sprite index write_byte() // starting frame write_byte() // frame rate in 0.1's write_byte() // life in 0.1's write_byte() // line width in 0.1's write_byte() // noise amplitude in 0.01's write_byte() //colour write_byte() write_byte() write_byte() // brightness write_byte() // scroll speed in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_STREAK_SPLASH  25   // oriented shower of tracers message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_coord() // direction vector write_coord() write_coord() write_byte() // color write_short() // count write_short() // base speed write_short() // ramdon velocity message_end() //----------------------------------------------------------------------------- #define TE_BEAMHOSE     26    // obsolete //----------------------------------------------------------------------------- #define TE_DLIGHT     27     // dynamic light, effect world, minor entity effect message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_byte() // radius in 10's write_byte() //colour write_byte() write_byte() write_byte() // life in 10's write_byte() // decay rate in 10's message_end() //----------------------------------------------------------------------------- #define TE_ELIGHT     28    // point entity light, no world effect message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) short entity:attachment to follow write_coord() // initial position write_coord() write_coord() write_coord() // radius write_byte() //colour write_byte() write_byte() write_byte() // life in 0.1's write_coord() // decay rate message_end() //----------------------------------------------------------------------------- #define TE_KILLBEAM     99   //  kill all beams attached to entity message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_short() // entity message_end() //----------------------------------------------------------------------------- #define TE_LARGEFUNNEL    100 // create a funnel of sprites message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // funnel position write_coord() write_coord() write_short() // sprite index write_short() // flags message_end() //----------------------------------------------------------------------------- #define TE_BLOODSTREAM    101   // particle spray message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_coord() // spray vector write_coord() write_coord() write_byte() // color RED = 248 YELLOW = 196 write_byte() // speed message_end() //----------------------------------------------------------------------------- #define TE_SHOWLINE     102   // line of particles every 5 units, dies in 30 seconds message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // start position write_coord() write_coord() write_coord() // end position write_coord() write_coord() message_end() //----------------------------------------------------------------------------- #define TE_BLOOD      103    // particle spray message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() //start position write_coord() write_coord() write_coord() //spray vector write_coord() write_coord() write_byte() // color RED = 248 YELLOW = 196 write_byte() // speed message_end() //----------------------------------------------------------------------------- #define TE_DECAL      104   // Decal applied to a brush entity not the world message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // x,y,z, decal position center of texture in world write_coord() write_coord() write_byte() // texture index of precached decal texture name write_short() // entity index message_end() //----------------------------------------------------------------------------- #define TE_FIZZ       105   // create alpha sprites inside of entity, float upwards message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_short() // entity write_short() // sprite index write_byte() // density message_end() //----------------------------------------------------------------------------- #define TE_MODEL      106   // create a moving model that bounces and makes a sound when it hits message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_coord() // velocity write_coord() write_coord() write_angle() // initial yaw write_short() // model index write_byte() // bounce sound type write_byte() // life in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_EXPLODEMODEL   107   // spherical shower of models, picks from set message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // origin position write_coord() write_coord() write_coord() // velocity write_short() // model index write_short() // count write_byte() // life in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_BREAKMODEL   108   // box of models or sprites message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_coord() // size write_coord() write_coord() write_coord() // velocity write_coord() write_coord() write_byte() // random velocity in 10's write_short() // sprite or model index write_byte() // count write_byte() // life in 0.1 secs write_byte() // flags message_end() //----------------------------------------------------------------------------- #define TE_GUNSHOTDECAL   109   // decal and ricochet sound message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_short() // entity index??? write_byte() // decal??? message_end() //----------------------------------------------------------------------------- #define TE_SPRITE_SPRAY   110   // spay of alpha sprites message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_coord() // velocity write_coord() write_coord() write_short() // sprite index write_byte() // count write_byte() // speed write_byte() // noise message_end() //----------------------------------------------------------------------------- #define TE_ARMOR_RICOCHET 111   // quick spark sprite, client ricochet sound. message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_byte() // scale in 0.1's message_end() //----------------------------------------------------------------------------- #define TE_PLAYERDECAL    112   // ??? message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_byte playerindex write_coord() // position write_coord() write_coord() write_short() // entity??? write_byte() // decal number??? //[optional] //write_short() // model index??? message_end() //----------------------------------------------------------------------------- #define TE_BUBBLES      113   // create alpha sprites inside of box, float upwards message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // min start position write_coord() write_coord() write_coord() //  max start position write_coord() write_coord() write_coord() // float height write_short() // model index write_byte() // count write_coord() // speed message_end() //----------------------------------------------------------------------------- #define TE_BUBBLETRAIL    114  //  create alpha sprites along a line, float upwards message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // min start position write_coord() write_coord() write_coord() //  max start position write_coord() write_coord() write_coord() // float height write_short() // model index write_byte() // count write_coord() // speed message_end() //----------------------------------------------------------------------------- #define TE_BLOODSPRITE    115   // spray of opaque sprite1's that fall, single sprite2 for 1..2 secs this is a high-priority tent message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_short() // sprite1 index write_short() // sprite2 index write_byte() // color RED = 248 YELLOW = 196 write_byte() // scale message_end() //----------------------------------------------------------------------------- #define TE_WORLDDECAL   116   // Decal applied to the world brush message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // x,y,z, decal position center of texture in world write_coord() write_coord() write_byte() // texture index of precached decal texture name message_end() //----------------------------------------------------------------------------- #define TE_WORLDDECALHIGH 117   // Decal with texture index > 256 applied to world brush message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // x,y,z, decal position center of texture in world write_coord() write_coord() write_byte() // texture index of precached decal texture name - 256 message_end() //----------------------------------------------------------------------------- #define TE_DECALHIGH    118   // Same as TE_DECAL, but the texture index was greater than 256 message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // x,y,z, decal position center of texture in world write_coord() write_coord() write_byte() // texture index of precached decal texture name - 256 write_short() // entity index message_end() //----------------------------------------------------------------------------- #define TE_PROJECTILE   119   // Makes a projectile like a nail this is a high-priority tent message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_coord() // velocity write_coord() write_coord() write_short() // modelindex write_byte() // life write_byte() // owner  projectile won't collide with owner if owner == 0, projectile will hit any client. message_end() //----------------------------------------------------------------------------- #define TE_SPRAY      120   // Throws a shower of sprites or models message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // position write_coord() write_coord() write_coord() // direction write_coord() write_coord() write_short() // modelindex write_byte() // count write_byte() // speed write_byte() // noise write_byte() // rendermode message_end() //----------------------------------------------------------------------------- #define TE_PLAYERSPRITES  121   // sprites emit from a player's bounding box ONLY use for players! message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_byte() // playernum write_short() // sprite modelindex write_byte() // count write_byte() // variance 0 = no variance in size 10 = 10% variance in size message_end() //----------------------------------------------------------------------------- #define TE_PARTICLEBURST  122   // very similar to lavasplash. message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // origin write_short() // radius write_byte() // particle color write_byte() // duration * 10 will be randomized a bit message_end() //----------------------------------------------------------------------------- #define TE_FIREFIELD      123   // makes a field of fire. message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // origin write_short() // radius fire is made in a square around origin. -radius, -radius to radius, radius write_short() // modelindex write_byte() // count write_byte() // flags write_byte() // duration in seconds * 10 will be randomized a bit message_end() //to keep network traffic low, this message has associated flags that fit into a byte: #define TEFIRE_FLAG_ALLFLOAT  1  //all sprites will drift upwards as they animate #define TEFIRE_FLAG_SOMEFLOAT 2  //some of the sprites will drift upwards. 50% chance #define TEFIRE_FLAG_LOOP    4  //if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration. #define TEFIRE_FLAG_ALPHA   8  //if set, sprite is rendered alpha blended at 50% else, opaque #define TEFIRE_FLAG_PLANAR    16  //if set, all fire sprites have same initial Z instead of randomly filling a cube. //an example of how the flags look: write_byte(TEFIRE_FLAG_LOOP|TEFIRE_FLAG_SOMEFLOAT|TEFIRE_FLAG_ALPHA) //----------------------------------------------------------------------------- #define TE_PLAYERATTACHMENT     124 // attaches a TENT to a player this is a high-priority tent message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_byte() // entity index of player write_coord() // vertical offset  attachment origin.z = player origin.z + vertical offset write_short() // model index write_short() // life * 10 message_end() //----------------------------------------------------------------------------- #define TE_KILLPLAYERATTACHMENTS  125 // will expire all TENTS attached to a player. message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_byte() // entity index of player message_end() //----------------------------------------------------------------------------- #define TE_MULTIGUNSHOT       126 // much more compact shotgun message //This message is used to make a client approximate a 'spray' of gunfire. //Any weapon that fires more than one bullet per frame and fires in a bit of a spread is //a good candidate for MULTIGUNSHOT use. shotguns // //NOTE: This effect makes the client do traces for each bullet, these client traces ignore //      entities that have studio models.Traces are 4096 long. message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // origin write_coord() write_coord() write_coord() // direction write_coord() write_coord() write_coord() // x noise * 100 write_coord() // y noise * 100 write_byte() // count write_byte() // bullethole decal texture index message_end() //----------------------------------------------------------------------------- #define TE_USERTRACER       127 // larger message than the standard tracer, but allows some customization. message_begin(MSG_ ,SVC_TEMPENTITY) //message begin write_byte(TE_) write_coord() // origin write_coord() write_coord() write_coord() // velocity write_coord() write_coord() write_byte() //  life * 10 write_byte() //  color  this is an index into an array of color vectors in the engine. 0 - write_byte() //  length * 10 message_end()
Prowler is offline