I was hitting this same problem and spent several hours debugging it. What I found is that for some reason, calling the function delegate from the global variable "room_pack_eval_script" seems to break the scoping of "self". If you step along the function calls from the beginning of the instance being created, "self" continues to reference the instance we want to modify up until we call "room_pack_eval_script". I was able to get it working, simply by replacing the delegate call to a direct call of the function itself. It seems like there's no reason that it SHOULDNT work as intended, but this is likely the fault of a bug in GML.
this doesn't work:
globalvar room_pack_eval_script; room_pack_eval_script = txr_eval_script; function txr_eval_script(_code, _context) { var _pg = txr_compile(_code); if (_pg != undefined) txr_exec(_pg); } //GMRoomPack.gml function room_pack_raw_run_cc(l_ccRaw, l_ccPath) { room_pack_eval_script(l_ccRaw, l_ccPath); }
this does:
globalvar room_pack_eval_script; room_pack_eval_script = txr_eval_script; function txr_eval_script(_code, _context) { var _pg = txr_compile(_code); if (_pg != undefined) txr_exec(_pg); } //GMRoomPack.gml function room_pack_raw_run_cc(l_ccRaw, l_ccPath) { txr_eval_script(l_ccRaw, l_ccPath); }