Project1

标题: 请问,在p $data_actors 的内容中,这段数字表示什么? [打印本页]

作者: alianlord    时间: 2020-4-30 22:09
标题: 请问,在p $data_actors 的内容中,这段数字表示什么?

作者: PLeaseS    时间: 2020-4-30 23:00
是角色ID吧
作者: alianlord    时间: 2020-4-30 23:05
PLeaseS 发表于 2020-4-30 23:00
是角色ID吧

我仔细又看了一遍,第二行末、第三行头。有个被断掉的。@id = 1
作者: KB.Driver    时间: 2020-4-30 23:09
那串16进制数是RPG::Actor对象的object_id

ruby文档的解释是这样的

object_id → fixnum
Returns an integer identifier for obj. The same number will be returned on all calls to id for a given object, and no two active objects will share an id.
Object#object_id is a different concept from the :name notation, which returns the symbol id of name. Replaces the deprecated Object#id.

简单来说,就是辨认对象唯一性的一串数字。
每个对象的object_id都不同,因此只要比较object_id就能知道是不是同一对象。
另外,在ruby里equal?方法做的就是比较两个对象的object_id
作者: ppspssss    时间: 2020-5-1 14:05
这个角色"艾里克"的數据存放在0x659c8f0 這个地址中,其中0x代表十六进制
      角色"娜塔丽"的數据存放在0x659c6c0 這个地址中
在外G(內存修改器之类)解釋 就是"人物基址"
作者: alianlord    时间: 2020-5-1 20:29
还有一个延伸出来的问题,就是$data_actors中的各个实例(@打头的数组),是以什么方式排列的?(如大小、字母顺序还是其它?)




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1