Sunday, June 1, 2014

Temp Entity Events - Một Số Sự Kiện Thực Thể


Temp Entity Events (Half-Life 1)

Add Main Description Here.

Contents

 [hide

Message Types

Sets the type of message the temp entity is transmitted in.
MSG_ types that can be used for dest field in message_begin are as follows:
#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

TempEnt Events

Add Description Here.

0: TE_BEAMPOINTS

Creates a beam between two points.

Options
OptionRangeDefaultDescription
StartX Y Z (coords)Origin of primary entity, or 0 0 0Starting point of the beam
EndX Y Z (coords)Origin of secondary entity, or 0 0 0Ending point of the beam
Spritesprite path"sprites/laserbeam.spr"The sprite to use in the beam
FrameStart0-2550The frame to start with in the sprite
FrameRate0-2550The frame rate to show the sprite at, in 0.1s (10 = 1 fps)
Life0-25550The length of time the beam shall remain, in 0.1s (50 = 5 seconds)
Width0-25510The width of the beam in 0.1s
Noise0-25510The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s
ColorR G B255 255 255The color of the beam in the RBG triplet value
Brightness0-255127The brightness of the beam
Scroll0-2550The scroll speed of the beam, in 0.1s (??)

Format
#define TE_BEAMPOINTS 0  // beam effect between two points


message_begin(MSG_ ,SVC_TEMPENTITY)
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()

1: TE_BEAMENTPOINT

Creates a beam between the primary entity and a point.

Options
OptionRangeDefaultDescription
Start EntityID of EntityPrimary entity idStarting point of the beam from the id's origin
EndX Y Z (coords)Origin of secondary entity, or 0 0 0Ending point of the beam
Spritesprite path"sprites/laserbeam.spr"The sprite to use in the beam
FrameStart0-2550The frame to start with in the sprite
FrameRate0-2550The frame rate to show the sprite at, in 0.1s (10 = 1 fps)
Life0-25550The length of time the beam shall remain, in 0.1s (50 = 5 seconds)
Width0-25510The width of the beam in 0.1s
Noise0-25510The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s
ColorR G B255 255 255The color of the beam in the RBG triplet value
Brightness0-255127The brightness of the beam
Scroll0-2550The scroll speed of the beam, in 0.1s (??)

Format
#define TE_BEAMENTPOINT 1 // beam effect between point and entity


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_BEAMENTPOINT)
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()

2: TE_GUNSHOT

Creates a particle effect plus a ricochet sound.

Options
OptionRangeDefaultDescription
PosX Y Z (coords)Origin of primary entity, or 0 0 0Position of the gunshot effect

Format
#define TE_GUNSHOT 2  // particle effect plus ricochet sound


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_GUNSHOT)
write_coord() // start position
write_coord()
write_coord()
message_end()

3: TE_EXPLOSION

Creates an additive sprite, 2 dynamic lights, flickering particles, explosion sound, and moves the sprite vertically.

Options
OptionRangeDefaultDescription
PosX Y Z (coords)Origin of primary entity, or 0 0 0Position of the explosion effect
Spritesprite path"sprites/zerogxplode.spr"The additive sprite to use in the explosion
Scale0-2551The scale of the sprite in the explosion, in 0.1s
FrameRate0-2550The frame rate to show the sprite at, in 0.1s (10 = 1 fps)
Flags0-150Sets flags for the explosion, you may also add these together:
  • 0: Default Half-Life explosion
  • 1: Sprite will be drawn opaque
  • 2: Do not render the dynamic lights
  • 4: Do not play the explosion sound
  • 8: Do not draw the particles

Format
#define TE_EXPLOSION 3  // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_EXPLOSION)
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()

4: TE_TAREXPLOSION

Creates the Quake 'tar' explosion.

Options
OptionRangeDefaultDescription
PosX Y Z (coords)Origin of primary entity, or 0 0 0Position of the effect

Format
#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_TAREXPLOSION)
write_coord() // start position
write_coord()
write_coord()
message_end()

5: TE_SMOKE

Creates a rising alphablend sprite at 30 pps.

Options
OptionRangeDefaultDescription
PosX Y Z (coords)Origin of primary entity, or 0 0 0Position of the smoke effect
Spritesprite path"sprites/steam1.spr"The alphablend sprite to use for smoke
Scale0-2551The scale of the smoke, in 0.1s
FrameRate0-2550The frame rate to show the sprite at

Format
#define TE_SMOKE 5   // alphablend sprite, move vertically 30 pps


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_SMOKE)
write_coord() // start position
write_coord()
write_coord()
write_short() // sprite index 
write_byte() // scale in 0.1's 
write_byte() // framerate 
message_end()

6: TE_TRACER

Creates a tracer effect from one point to another.

Options
OptionRangeDefaultDescription
PosX Y Z (coords)Origin of primary entity, or 0 0 0Starting point of the tracer
EndX Y Z (coords)Origin of secondary entity, or 0 0 0Ending point of the tracer

Format
#define TE_TRACER 6   // tracer effect from point to point


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_TRACER)
write_coord() // start position
write_coord()
write_coord()
write_coord() // end position 
write_coord()
write_coord()
message_end()

7: TE_LIGHTNING

Simplified options for TE_BEAMPOINTS - Lightning effect.

Options
OptionRangeDefaultDescription
PosX Y Z (coords)Origin of primary entity, or 0 0 0Starting point of the lightning
EndX Y Z (coords)Origin of secondary entity, or 0 0 0Ending point of the lightning
Life0-25550The length of time the lightning shall remain, in 0.1s (50 = 5 seconds)
Width0-25510The width of the lightning in 0.1s
Noise0-25510The noise amplitude of the lightning, this controls how much it distorts, again in 0.1s
Spritesprite path"sprites/laserbeam.spr"The sprite to use in the lightning

Format
#define TE_LIGHTNING 7  // TE_BEAMPOINTS with simplified parameters


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_LIGHTNING)
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()

8: TE_BEAMENTS

Creates a beam between the primary entity and another entity.

Options
OptionRangeDefaultDescription
Start EntityID of EntityPrimary entity idStarting point of the beam from the id's origin
End EntityID of EntitySecondary entity idEnding point of the beam to the id's origin
Spritesprite path"sprites/laserbeam.spr"The sprite to use in the beam
FrameStart0-2550The frame to start with in the sprite
FrameRate0-2550The frame rate to show the sprite at, in 0.1s (10 = 1 fps)
Life0-25550The length of time the beam shall remain, in 0.1s (50 = 5 seconds)
Width0-25510The width of the beam in 0.1s
Noise0-25510The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s
ColorR G B255 255 255The color of the beam in the RBG triplet value
Brightness0-255127The brightness of the beam
Scroll0-2550The scroll speed of the beam, in 0.1s (??)

Format
#define TE_BEAMENTS 8  // Create a beam between two entities


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_BEAMENTS)
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() // red
write_byte() // green
write_byte() // blue
write_byte() // brightness
write_byte() // scroll speed in 0.1's
message_end()

TODO: add rest, I'll get this done eventually.

0 nhận xét:

Post a Comment