That is, why it doesn't exist, shouldn't exist, and how it can exist.
I've spent today thinking about how Studio is lacking the execute_file() and execute_string() commands.And there's a fair number of reasons why this is so.- [#]Piracy concerns.
It's extremely easy to create your own GML runner. Sure, it makes Game Maker a significantly harder language to use, but it's still possible. This runner can then bypass all of the free-version limitations (provided someone with a paid copy compiled the executable.)
The only real features lost are things like the loading bar, icon, and game-info.
[#]Safety concerns.
Look, I shouldn't have to tell you that letting your code run someone else's code without any safeguard can be a problem.
Keyloggers, viruses, various kinds of bots, and any other malicious software can be transmitted this way. (Not to mention older versions of Game Maker weren't so safe with the filesystem access thing. Hello, system32.)
[#]Rare usage.
The most common usage case for these commands that I've ever seen is level editors and readers, which can easily be done in .INI format (depending on the game, though this lacks security) or a custom format (which is really not hard to do).
Games using this style of saving/loading for maps are particularly at risk of the above safety concerns. I could easily write in some code among the instance_create()s to execute a .DLL saved along with the 'map', or even have the .DLL itself embedded into the map file, creating the actual .DLL file before executing it.
TL;DR: execute_string() and execute_file() are gone because they are lazy and dangerous. You can still execute strings and files if you take the time to do it properly.
@spike1 return a data structure or array
Fair enough, that would work, still the functions for those are really long and tedious to type. If i must return multiple values without execute_string I prefer.
(Un-tested)You can also just return an array and know what the values mean if you don't want to use the ds_ functions (which I agree are stupid long).
Using execute_string (aka exec, eval, etc) is an awful practice in programming. They are generally mega-hacks baked into languages for the sake of having a megahack. There's almost always a better way.Spike1: Only user created cheats, or easily made levels (cause you can create a very specific check in-room without wasting file space on an object definition). It's mostly a convenience thing. I mean, there are probably uses if you wish to do complex random attacks, cause then you can string stuff together, or maybe something with procedural generation, but for the most part it's convenience.
You know what? If GM wants to remove it from their general stuff, that's fine by me, but does anyone know of a .dll for execute_string?
No, you're living in the future so the present is your past.
*sigh* is there one or not?