Z
Zinx
Guest
I have two suggestions I'd like to make for GMS2 that I feel like is something little that would make more traditional OOP users happy. That would be a script_execute() shortcut. At the moment, we can access scripts stored in variables by using script_execute. That is great and all, but it'd feel more readable (in my opinion) if you made a shortcut for script_execute by utilizing the parentheses. Not only that, but maybe this shortcut could also utilize user events (which should an array like the arguments array). For example, let's say I wrote this:
First it checks to see if "ha" is a script or not then executes the corresponding function. Of course, this method does have flaws (like I could put that whole code segment in a script, but I'd find it more functional to have the GMS2 interpreter do that for me via so:
Note: notice how the user_event "ha" uses an array rather than the old-fashioned number after the name.
Now, this was a little one-sided, so here's a more realistic example. In the code below, I am cycling through every instance of the object obj_ai and executing the move function (which is a script I created off-screen):
While the non-shortcut version is this:
Basically, the way I see it is that we have shortcuts like this for DS Maps, so why not create a shortcut for scripts and user events?
First it checks to see if "ha" is a script or not then executes the corresponding function. Of course, this method does have flaws (like I could put that whole code segment in a script, but I'd find it more functional to have the GMS2 interpreter do that for me via so:
Note: notice how the user_event "ha" uses an array rather than the old-fashioned number after the name.
Now, this was a little one-sided, so here's a more realistic example. In the code below, I am cycling through every instance of the object obj_ai and executing the move function (which is a script I created off-screen):
While the non-shortcut version is this:
Basically, the way I see it is that we have shortcuts like this for DS Maps, so why not create a shortcut for scripts and user events?