-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object "Variable Definitions" are not checked by the Stitch parser #205
Comments
Ah yeah, that's currently unsupported in Stitch. We declare all of our instance variables in Create Events, so I've never understood the purpose of putting variable definitions in this way. Can you provide any insight on putting variables in via this menu versus defining them in the Create event? |
Closing for now, but this can be re-opened if someone has a use case for creating object variables this way rather than in Create events. |
This can be important in a situation for UI, as an example: // Variable definitions
color = c_red;
text = "Hello, World"; Placing a UI element in the room - where I'd like to change the color would involve me updating it's creation code which can be tedious for multiple elements. With variables definitions it's as simple as clicking on the element and modifying the variable definition. |
Ah, gotcha. We do all of our object placement programmatically, so I didn't even know this was a thing! I'll re-open since it'd be good to support that, though since we don't use that feature ourselves I'm not sure if/when I'll get it addressed. While perhaps less than ideal, you can use the following workaround:
So in your example, you'd have something like: // (In the create event)
/// @instancevar {Constant.Color} color
/// @instancevar {String} text Note for future self, or for anyone who wants to take a crack at this: Instance variables defined via the GameMaker "Variable Definitions" UI will end up somewhere in the object's stitch/packages/yy/src/types/YyObject.ts Line 118 in 929d964
We'd just need a mapping of the numeric type IDs to the corresponding Feather/Stitch type names. They wouldn't get re-parsed on update without some additional work, and aren't meaningfully available to edit via Stitch VSCode, but that'd be a start. |
Here is an object with two variable definitions:
However, I am getting errors:
The text was updated successfully, but these errors were encountered: