To identify a button i most of the time use the 3d vector of 3 shorts at 0x7 in the macro 06 06 that is saved in the server msgs chunk of the macro gamedata with the same frame at 0x5 in the macro header as the clientcommand macro where the +use cmd was trigger
but sometimes the msg is not sent so i have to use the sound msg 06 07 in the server msgs of gamedata which is trigger by +use, get the sound id and compare it to the soundid for the sound loaded as button sound in the gamedata macro in demosegment 0.
then i get the playerposition saved in the bitfield of gamedata macro at 0x74 as 3d vector with 3 floats and check if it is inside the range of a 3d vector of 3 shorts with the position of the button i saved in the recdata file
------解决方案--------------------------------------------------------
在大多数的时候我采用3D向量的形式去标识一个按钮,这个3D向量是由3个在0x7的short类型存储在宏0606里,而宏0606则是被存储在游戏数据宏(gamedata macro可能是一个文件)中服务消息块中,游戏数据宏它采用宏头文件中0x5中的框架,类似于客户为了调用命令而所创建的宏。
但是有些时候消息不一定成功发送,因此我在这里用到了游戏数据中的服务消息06,07这2个声音信息,它会被+use所触发。拿到它的ID后和demosegment 0中的声音按钮(用于装载声音)的ID进行比较。
之后用3个浮点型从0x74gamedata宏中的位域里取得玩家的位置既3D向量,然后检查是否在按钮(保存于recdata文件中)所定义的3D向量(short型)范围之内~
看得懂,不过要翻译好就有点难。。