如果是这样,那么我该如何做?我目前正在开发一套杠杆系统,希望在游戏中能够多次使用,特别是影响某些实例。我的想法是通过在对象中添加一个通用代码,基本上是:当激活时,调用杠杆函数,并在实例创建代码中定义杠杆函数和杠杆参数。现在,我想让其中一个杠杆来切换特定移动平台的移动方式,所以我做了:

/// @desc
/// @arg
/// @arg {Array}
platform_ids
/// @arg An array of the ids of the affected platforms

function toggle_platform_movement(platform_ids) {
for (var i=0; i>=len(platform_ids); i++) {
if object_get_name(platform_ids[i]) == "obj_moving_platform" {
pf = platform_ids[i]
pf.active = not pf.active
}
else {
show_error("Warning! - " + string(platform_ids[i]) + " at index " + string(i) + " of platform_ids is not a platform", false)
}
}
}

尽管我能够知道这些平台的id(通过show_debug_message),但是在杠杆创建代码中却无法提到它们。 我认为可以通过让每个平台向一个ds_table发送它们的id来解决这个问题,表明它们在创建代码中的行号。但是,这远远不是一个实际的解决方案,尤其是当我有35个表格,几百行代码时。 这不是第一次遇到无法提到引用的问题。所以,如果没有其他解决方案,请开发者添加这个功能。