Difference between revisions of "Zh cn:Temp Entity Events (Half-Life 1)"

From AlliedModders Wiki
Jump to: navigation, search
(消息类型)
(6: TE_TRACER)
Line 404: Line 404:
 
message_begin(MSG_ ,SVC_TEMPENTITY)
 
message_begin(MSG_ ,SVC_TEMPENTITY)
 
write_byte(TE_TRACER)
 
write_byte(TE_TRACER)
write_coord() // start position
+
write_coord() // 起始点
 
write_coord()
 
write_coord()
 
write_coord()
 
write_coord()
write_coord() // end position
+
write_coord() // 终止点
 
write_coord()
 
write_coord()
 
write_coord()
 
write_coord()
 
message_end()</pre>
 
message_end()</pre>
 
+
用这个消息可以很轻松的制造出一条trace轨迹。
 
+
看到上面的参数是不是觉得有点少,就这么两个点能做出让人满意的效果?
 +
别急,控制台输入 tracer ,你会看见诸如traceralpha的好几个cvar,就是由它们控制了trace的样子。
 +
列举几个来自hlsdk的颜色示例:
 +
tracerred/tracergreen/tracerblue
 +
color24 gTracerColors[] =
 +
{
 +
{ 255, 255, 255 }, // White
 +
{ 255, 0, 0 }, // Red
 +
{ 0, 255, 0 }, // Green
 +
{ 0, 0, 255 }, // Blue
 +
{ 0, 0, 0 }, // Tracer default, filled in from cvars, etc.
 +
{ 255, 167, 17 }, // Yellow-orange sparks
 +
{ 255, 130, 90 }, // Yellowish streaks (garg)
 +
{ 55, 60, 144 }, // Blue egon streak
 +
{ 255, 130, 90 }, // More Yellowish streaks (garg)
 +
{ 255, 140, 90 }, // More Yellowish streaks (garg)
 +
{ 200, 130, 90 }, // More red streaks (garg)
 +
{ 255, 120, 70 }, // Darker red streaks (garg)
 +
};
  
 
== 7: TE_LIGHTNING ==
 
== 7: TE_LIGHTNING ==

Revision as of 07:05, 6 September 2015

Warning: This template (and by extension, language format) should not be used, any pages using it should be switched to Template:Languages

View this page in:  English  Russian  简体中文(Simplified Chinese)

'消息'就是服务器发送给客户端的一个信号(数据段) ,是它告知客户端信息有更变。


新增的主要描述在这里。 此页面由 lein神上 翻译

消息类型

设置临时实体消息的传输类型。

MSG_ types 将被用于 dest 填入 message_begin 中 ,下面是它的类型:

#define MSG_BROADCAST		0	// 发送给所有人(不真实的数据流)
#define MSG_ONE			1	// 只发送给一个人(msg_entity)
#define MSG_ALL			2	// 发送给单个客户端(使用真实的数据流)
#define MSG_INIT		3	// 此消息类型在服务器创建的时候发送,以通知客户端注册消息。
#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	// 发送给单个客户端, 但不会使用真实数据流。 (可以被drop)
#define MSG_SPEC		9	// 发送给观察者

注:UNRELIABLE意味着并不是立即发送的真实数据流,不能保证消息一定送达到客户端。

   Reliable 发送的消息准确可靠,但是注意不要 在同一时刻大量发送,会炸服。

临时实体 事件

你可以在这里添加描述


0: TE_BEAMPOINTS光束效果

在两个点之间创建一条光束.


参数解释

参数 范围 默认 叙述
起始点 X Y Z (coords型数据) 点的X Y Z 坐标, or 0 0 0 光线出发位置
终止点 X Y Z (coords型数据) 点的X Y Z 坐标, or 0 0 0 光线结束位置
Sprite SPR文件路径 "sprites/laserbeam.spr" 光线所用到的SPR文件
起始帧 0-255 0 开始播放的帧数,一般填0即可
帧率 0-255 0 每0.1s秒执行多少帧, (10 = 1 fps)
Life 0-255 50 每一帧持续的时间, (50 = 5 seconds)
宽度 0-255 10 光线宽度
抖动率 0-255 10 这个参数决定0.1秒内的抖动频率
颜色饱和度 R G B 255 255 255 这个参数决定SPR的RGB颜色饱和度
通透度 0-255 127 SPR文件的通透度,可以当作Alpha透明度来处理
传输速度 0-255 0 就是光线怎么"动"过去什么的, in 0.1s (??)


Format

#define TE_BEAMPOINTS 0		// 在两个点之间创建一条光束.


message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_BEAMPOINTS)
write_coord()	// 起始点
write_coord()
write_coord()
write_coord()	// 终止点
write_coord()
write_coord()
write_short()	// SPR文件索引
write_byte()	// 起始帧
write_byte()	// 帧率
write_byte()	// 持续时间
write_byte()	// 宽度
write_byte()	// 抖动率 in 0.01's
write_byte()	// 红色饱和度
write_byte()	// 绿色饱和度
write_byte()	// 蓝色饱和度
write_byte()	// 通透度
write_byte()	// 传输速度
message_end()


1: TE_BEAMENTPOINT光束效果

创建一条光束从一个实体到一个点.


参数解释

参数 范围 默认 叙述
起始实体 entityid 实体的ID值 发出光线的实体
结束点 X Y Z (coords型数据) 点的X Y Z 坐标, or 0 0 0 光线结束位置
Sprite SPR文件路径 "sprites/laserbeam.spr" 光线所用到的SPR文件
起始帧 0-255 0 开始播放的帧数,一般填0即可
帧率 0-255 0 每0.1s秒执行多少帧, (10 = 1 fps)
Life 0-255 50 每一帧持续的时间, (50 = 5 seconds)
宽度 0-255 10 光线宽度
抖动率 0-255 10 这个参数决定0.1秒内的抖动频率
颜色饱和度 R G B 255 255 255 这个参数决定SPR的RGB颜色饱和度
通透度 0-255 127 SPR文件的通透度,可以当作Alpha透明度来处理
传输速度 0-255 0 就是光线怎么"动"过去什么的, 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()	// SPR文件索引
write_byte()	// 起始帧
write_byte()	// 帧率
write_byte()	// 持续时间
write_byte()	// 宽度
write_byte()	// 抖动率 in 0.01's
write_byte()	// 红色饱和度
write_byte()	// 绿色饱和度
write_byte()	// 蓝色饱和度
write_byte()	// 通透度
write_byte()	// 传输速度
message_end()


2: TE_GUNSHOT枪击效果

创建粒子效果和子弹音效。.


参数解释

参数 范围 默认 叙述
Pos X Y Z (coords) Origin of primary entity, or 0 0 0 Position 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.


参数解释

参数 范围 默认 叙述
Pos X Y Z (coords) Origin of primary entity, or 0 0 0 Position of the explosion effect
Sprite sprite path "sprites/zerogxplode.spr" The additive sprite to use in the explosion
Scale 0-255 1 The scale of the sprite in the explosion, in 0.1s
FrameRate 0-255 0 The frame rate to show the sprite at, in 0.1s (10 = 1 fps)
Flags 0-15 0 Sets 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.


参数解释

参数 范围 默认 叙述
Pos X Y Z (coords) Origin of primary entity, or 0 0 0 Position 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

Option Range Default Description
Pos X Y Z (coords) Origin of primary entity, or 0 0 0 Position of the smoke effect
Sprite sprite path "sprites/steam1.spr" The alphablend sprite to use for smoke
Scale 0-255 1 The scale of the smoke, in 0.1s
FrameRate 0-255 0 The 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.


参数解释

参数 范围 默认 叙述
Pos X Y Z (coords) Origin of primary entity, or 0 0 0 Starting point of the tracer
End X Y Z (coords) Origin of secondary entity, or 0 0 0 Ending 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()	// 起始点
write_coord()
write_coord()
write_coord()	// 终止点
write_coord()
write_coord()
message_end()

用这个消息可以很轻松的制造出一条trace轨迹。 看到上面的参数是不是觉得有点少,就这么两个点能做出让人满意的效果? 别急,控制台输入 tracer ,你会看见诸如traceralpha的好几个cvar,就是由它们控制了trace的样子。 列举几个来自hlsdk的颜色示例: tracerred/tracergreen/tracerblue color24 gTracerColors[] = { { 255, 255, 255 }, // White { 255, 0, 0 }, // Red { 0, 255, 0 }, // Green { 0, 0, 255 }, // Blue { 0, 0, 0 }, // Tracer default, filled in from cvars, etc. { 255, 167, 17 }, // Yellow-orange sparks { 255, 130, 90 }, // Yellowish streaks (garg) { 55, 60, 144 }, // Blue egon streak { 255, 130, 90 }, // More Yellowish streaks (garg) { 255, 140, 90 }, // More Yellowish streaks (garg) { 200, 130, 90 }, // More red streaks (garg) { 255, 120, 70 }, // Darker red streaks (garg) };

7: TE_LIGHTNING

Simplified options for TE_BEAMPOINTS - Lightning effect.


参数解释

参数 范围 默认 叙述
Pos X Y Z (coords) Origin of primary entity, or 0 0 0 Starting point of the lightning
End X Y Z (coords) Origin of secondary entity, or 0 0 0 Ending point of the lightning
Life 0-255 50 The length of time the lightning shall remain, in 0.1s (50 = 5 seconds)
Width 0-255 10 The width of the lightning in 0.1s
Noise 0-255 10 The noise amplitude of the lightning, this controls how much it distorts, again in 0.1s
Sprite sprite 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光束效果

创建一条光线从一个实体到另一个实体.


参数解释

参数 范围 默认 叙述
起始实体 entityid 实体的ID值 发出光线的实体
终止实体 entityid 实体的ID值 光线的结束实体
Sprite SPR文件路径 "sprites/laserbeam.spr" 光线所用到的SPR文件
起始帧 0-255 0 开始播放的帧数,一般填0即可
帧率 0-255 0 每0.1s秒执行多少帧, (10 = 1 fps)
Life 0-255 50 每一帧持续的时间, (50 = 5 seconds)
宽度 0-255 10 光线宽度
抖动率 0-255 10 这个参数决定0.1秒内的抖动频率
颜色饱和度 R G B 255 255 255 这个参数决定SPR的RGB颜色饱和度
通透度 0-255 127 SPR文件的通透度,可以当作Alpha透明度来处理
传输速度 0-255 0 就是光线怎么"动"过去什么的, 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()


别着急,会全部翻译好的!这需要时间

Translation:lein --Lein (talk) 02:05, 9 November 2013 (CST)