Hola, hago esta guía, tutorial, snnipet, como lo quieran llamar con algunos temp entity para llegar y copiar.
por que para llegar y copiar ?
simplemente por que es una paja estar haciendo los codes y borrando los //, aparte que dejo unas imágenes de como hacerlos. Ahh, y también por que no todos saben muy bien los valores de los write_* de estos codes encontrados en message_const.inc .
bueno empecemos:
Resources a usar:
PHP Code:
new g_ExpSpr, g_smokeSpr, g_lightingSpr, sprite_flare, sprite_beam, ic_particles, model_gibs, g_bubbles
new const EXPLO_SPRITE[] = "sprites/zerogxplode.spr" new const SMOKE_SPRITE[] = "sprites/steam1.spr" new const LIGHTING_SPRITE[] = "sprites/lgtning.spr"
message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id) write_byte(TE_DLIGHT) // TE id engfunc(EngFunc_WriteCoord, origin[0]) // x engfunc(EngFunc_WriteCoord, origin[1]) // y engfunc(EngFunc_WriteCoord, origin[2]) // z write_byte(70) // radius write_byte(255) // r write_byte(0) // g write_byte(0) // b write_byte(3) // life write_byte(0) // decay rate message_end()
TE_BEAMENTPOINT: Linea que une 2 entidades, una válida (classname o player) y la otra no (cualquier otro origin)
message_begin( MSG_BROADCAST,SVC_TEMPENTITY) write_byte (TE_BEAMENTPOINT) write_short(id | 0x1000) // lean el comentario de abajo :D write_coord (origin[0]) // Start X write_coord (origin[1]) // Start Y write_coord (origin[2]) // Start Z write_short(line) // Sprite write_byte (1) // Start frame write_byte (10) // Frame rate write_byte (1) // Life write_byte (5) // Line width write_byte (0) // Noise write_byte (255) // Red write_byte (0) // Green write_byte (0) // Blue write_byte (150) // Brightness write_byte (25) // Scroll speed message_end()
Quote:
Originally Posted by Kiske
En el TE_BEAMENTPOINT el write_short(id | 0x1000) es la posición desde la que sale el sprite indicado.
El 0x1000 es desde la punta del arma actual (si estás con cuchillo , granadas o la C4 en mano sale desde el centro del jugador el sprite)
new PlayerOrigin[3], EndOrigin[3] get_user_origin(id, PlayerOrigin, 1) // Origin del player get_user_origin(id, EndOrigin, 3) // Origin del AIM del player
message_begin(MSG_ONE_UNRELIABLE,SVC_TEMPENTITY {0,0,0},id) write_byte(TE_BEAMPOINTS) // TE_ write_coord(PlayerOrigin[0]) //X // starting pos write_coord(PlayerOrigin[1]) //Y write_coord(PlayerOrigin[2]) //Z write_coord(EndOrigin[0]) //X // ending pos write_coord(EndOrigin[1]) //Y write_coord(EndOrigin[2]) //Z write_short(line) // sprite index write_byte (1) // Start frame write_byte (10) // Frame rate write_byte (1) // Life write_byte (5) // Line width write_byte (0) // Noise write_byte(255) // red write_byte(0) // green write_byte(0) // blue write_byte(150) // brightness write_byte(25) // scroll speed in 0.1's message_end()
TE_TAREXPLOSION: Explosión del juego Quake2 con sonido (traducción del inc)
message_begin(MSG_PVS, SVC_TEMPENTITY, origin) write_byte(TE_EXPLOSION2) // TE_ write_coord(origin[0]) // X write_coord(origin[1]) // Y write_coord(origin[2]) // Z write_byte(188) // start color write_byte(10) // num colors message_end()
TE_IMPLOSION: partículas que se reunen en un punto determinado
message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_SPRITETRAIL) write_coord(origin[0]) // Start X write_coord(origin[1]) // Start Y write_coord(origin[2]) // Start Z write_coord(origin[0]) // End X write_coord(origin[1]) // End Y write_coord(origin[2]) // End Z write_short(sprite_flare) // sprite write_byte(5) // count write_byte(1) // life write_byte(3) // scale write_byte(34) // velocity write_byte(43) // randomness of velocity message_end()
TE_SPRITETRAIL *2: Partículas (usando un sprite) con gravedad en linea recta entre 1 origin y otro (simplemente lo que cambie fue, en vez de repetir el origin de un jugador, use 2 origins, el del jugador (punto 1) y el del aim (origin 2)).
PHP Code:
new origin[3], EndOrigin[3] get_user_origin(id, origin, 1) get_user_origin(id, EndOrigin, 3)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_SPRITETRAIL) write_coord(origin[0]) // x write_coord(origin[1]) // y write_coord(origin[2]) // z write_coord(EndOrigin[0]) // x write_coord(EndOrigin[1]) // y write_coord(EndOrigin[2]) // z write_short(sprite_flare) write_byte(30) write_byte(2) write_byte(3) write_byte(0) write_byte(0) message_end()
TE_BEAMTORUS: efecto parecido a TE_BEAMCYLINDER/TE_BEAMTORUS/TE_BEAMDISK, onda que se expande.
message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_BEAMFOLLOW) // TE id write_short(id) // entity write_short(sprite_beam) // sprite write_byte(10) // life write_byte(10) // width write_byte(255) // r write_byte(0) // g write_byte(0) // b write_byte(200) // brightness message_end()
TE_LARGEFUNNEL: efecto de partículas de color (verde y blancas creo) que se reunen en un punto, modificadas por un flag, 0 = se reunen, 1 = se expanden (o al revez creo. Ultimo write_short).
message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_BLOOD) write_coord(iOrigin[0]) // Start X write_coord(iOrigin[1]) // Start Y write_coord(iOrigin[2]) // Start Z write_coord(iOrigin[0] + 20) // End X write_coord(iOrigin[1] + 20) // End Y write_coord(iOrigin[2] + 20) // End Z write_byte(70) // color write_byte(22) // speed message_end()
TE_BREAKMODEL: model que se rompe en distintos trozos, luego desaparece.
new origin[3], EndOrigin[3] get_user_origin(id, origin, 1) get_user_origin(id, EndOrigin, 3)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); write_byte(TE_BEAMSPRITE) write_coord(origin[0]) // Start X write_coord(origin[1]) // Start Y write_coord(origin[2]) // Start Z write_coord(EndOrigin[0]) // End X write_coord(EndOrigin[1]) // End Y write_coord(EndOrigin[2]) // End Z write_short(sprite_beam) // line sprite write_short(sprite_flare) // end effect sprite message_end()
Bueno aca termina el tutorial, poco a poco iré agregando mas cosas, y si quedaron en duda respecto a los message_begin, aca les dejo una info de message_const.inc y no creo que sea necesaria traducirla.
Spoiler
PHP Code:
/* Destination types for message_begin() */ #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) #define MSG_SPEC 9 // Sends to all spectator proxies
* Disculpen los 2 mensajes de "Starting new modes (plugin de meTaLiCroSS)" y "Score Human (?)" ya que es mi servidor zombie plague de testeo, pero estaba desactivado, y los mensajes de los estúpidos bots.
* No puse todos los temp que hay ya que algunos no los sé usar muy bien ni para que sirven, a parte de que hay algunos muy parecidos, practicamente iguales o repetidos por así decirlo (lean el .inc) .
*Mañana termino el post y agrego nuevas cosas, aun no me puteen ya que es tarde y mañana tengo que salir temprano .
*Mañana Agregaré otras explicaciones, las imágenes de los efectos y otras cosas.
En el TE_BEAMENTPOINT el write_short(id | 0x1000) es la posición desde la que sale el sprite indicado.
El 0x1000 es desde la punta del arma actual (si estás con cuchillo , granadas o la C4 en mano sale desde el centro del jugador el sprite)
En el TE_SPRITETRAIL:
PHP Code:
new origin[3], EndOrigin[3] get_user_origin(id, origin, 1) get_user_origin(id, origin, 3)
->
PHP Code:
new origin[3], EndOrigin[3] get_user_origin(id, origin, 1) get_user_origin(id, EndOrigin, 3)