请选择 进入手机版 | 继续访问电脑版
设为首页收藏本站

ESFKAMI

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

ESFX

ESF: Xenoverse

ESF123

ESF1.2.3

EVM2.1

EVM2.1

ECXSSJ

ECX: TeamSSJ

ECX2.2

ECX RC2

ECX2.3

ECX RC3

查看: 1916|回复: 0

[代码|Code]获取附件|Get Attachment

[复制链接]

212

主题

217

帖子

1221

积分

ESFKAMI

Rank: 8Rank: 8

积分
1221
发表于 2017-7-13 16:43:28 | 显示全部楼层 |阅读模式
1. 获取附件坐标|Get Attachment Origin
说明|Description:
[CN]由于客户端与服务端的延迟,这个方法不适合玩家实体
[EN]This way is not for "Player Entity" because of the lag between ClientSide and ServerSide
  1. new Float: __float_Org[ 3 ], Float: __float_Ang[ 3 ];
  2. engfunc( EngFunc_GetAttachment, __int_Client, 0, __float_Org, __float_Ang );
复制代码


2.实体附件索引|Entity Attachment Index
说明|Description:
[CN]此方法对玩家实体和模型实体通用
[EN]This way is for both "Player Entity" and "Model Entity"
  1. /*
  2. Attachment 0( Client|0x1000 ) = Right Hand( Usually )
  3. Attachment 1( Client|0x2000 ) = Left Hand( Usually )
  4. Attachment 2( Client|0x3000 ) = Extra
  5. Attachment 3( Client|0x4000 ) = Extra
  6. */
  7. message_begin( MSG_ALL, SVC_TEMPENTITY );
  8. write_byte(TE_BEAMENTPOINT);
  9. write_short( __int_Client|0x1000 );// Right Hand ( Usually )
  10. engfunc( EngFunc_WriteCoord, __float_Org[ 0 ] + random_float( -10.000_000, 10.000_000 ) );
  11. engfunc( EngFunc_WriteCoord, __float_Org[ 1 ] + random_float( -10.000_000, 10.000_000 ) );
  12. engfunc( EngFunc_WriteCoord, __float_Org[ 2 ] + random_float( -10.000_000, 10.000_000 ) );
  13. write_short( 101 );
  14. write_byte( 10 );
  15. write_byte( 10 );
  16. write_byte( 5 );
  17. write_byte( 2 );
  18. write_byte( 3 );
  19. write_byte( 255 );
  20. write_byte( 255 );
  21. write_byte( 255 );
  22. write_byte( 255 );
  23. write_byte( 50 );
  24. message_end();

  25. message_begin( MSG_ALL, SVC_TEMPENTITY );
  26. write_byte(TE_BEAMENTPOINT);
  27. write_short( __int_Client|0x2000 );// Left Hand ( Usually )
  28. engfunc( EngFunc_WriteCoord, __float_Org[ 0 ] + random_float( -10.000_000, 10.000_000 ) );
  29. engfunc( EngFunc_WriteCoord, __float_Org[ 1 ] + random_float( -10.000_000, 10.000_000 ) );
  30. engfunc( EngFunc_WriteCoord, __float_Org[ 2 ] + random_float( -10.000_000, 10.000_000 ) );
  31. write_short( 101 );
  32. write_byte( 10 );
  33. write_byte( 10 );
  34. write_byte( 5 );
  35. write_byte( 2 );
  36. write_byte( 3 );
  37. write_byte( 255 );
  38. write_byte( 255 );
  39. write_byte( 255 );
  40. write_byte( 255 );
  41. write_byte( 50 );
  42. message_end();
复制代码








Q: 怎么为模型添加附件?|How to add attachment for a model?

A: 在QC文件里面使用$attachment语句|Use the function "$attachment" in the QC file
  1. //$attachment Index "Joint Name" X Y Z
  2. $attachment 0 "Bip01 R Hand" 2.000000 2.000000 0.300000
  3. $attachment 1 "Bip01 R Hand" 2.000000 2.000000 0.000000
  4. $attachment 2 "Bip01 L Hand" 0.000000 0.000000 0.000000
  5. $attachment 3 "Bip01 R Leg" 0.000000 0.000000 0.000000
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|ESFKAMI    

GMT+8, 2018-10-21 11:47 , Processed in 0.277228 second(s), 22 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表