Hi! I've created a new database record, and a custom command that uses it. Everything works when I do a direct assignment; however, when I use a variable to assign the custom record, it crashes the game.
My code for assigning the value in question is:
I have a feeling this is where the mistake lies, as the crash happens when "value" is referenced, and it is referred to as "undefined" by the error message. In other words, the code is failing to assign "value" when I use a variable. So I know I'm doing something wrong here. The question is, what do I do instead to get what I want?
UPDATE: So, I'm having what seems to be a rather similar problem here with backgrounds. I try to update a background with a direct assignment, it works. Do it with a variable, and it fails. You can even get the resource name of the current background, and try to change to that background, and the background will disappear! If these two problems are related, that's a pretty nasty bug.
UPDATE 2: Okay, so I discovered that the variable button is sending an object into the script that contains the name of the variable rather than it's value. Since the name of the variable doesn't match anything in the gam (or if it does, it's most likely the wrong object), the resulting is an undefined item rather than the expected object. It's pretty clear that this is a bug. It affects, backgrounds, pictures, music, and presumably anything that uses a string to determine what to use. I don't know if there's a workaround yet, unfortunately; this seems like an editor-level bug.
My code for assigning the value in question is:
value = RecordManager.newDataType[@interpreter.stringValueOf(@params.name)]I have a feeling this is where the mistake lies, as the crash happens when "value" is referenced, and it is referred to as "undefined" by the error message. In other words, the code is failing to assign "value" when I use a variable. So I know I'm doing something wrong here. The question is, what do I do instead to get what I want?
UPDATE: So, I'm having what seems to be a rather similar problem here with backgrounds. I try to update a background with a direct assignment, it works. Do it with a variable, and it fails. You can even get the resource name of the current background, and try to change to that background, and the background will disappear! If these two problems are related, that's a pretty nasty bug.
UPDATE 2: Okay, so I discovered that the variable button is sending an object into the script that contains the name of the variable rather than it's value. Since the name of the variable doesn't match anything in the gam (or if it does, it's most likely the wrong object), the resulting is an undefined item rather than the expected object. It's pretty clear that this is a bug. It affects, backgrounds, pictures, music, and presumably anything that uses a string to determine what to use. I don't know if there's a workaround yet, unfortunately; this seems like an editor-level bug.