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.
Like I said, nobody uses Execute_File. It should be removed. I even said that execute_string should be limited to just in-house functions, and (maybe) multiplayer functions. Obviously, anything else would only be useful for stealing code or making viruses.
Or you just don't bother trying to manipulate other people's games even if they don't want you to. Seems like the most viable option to me. Like mentioned before, the main reason for their deletion is the fact GMS actually compiles rather than just interpreting it.
That comment made no sense at all. The 50 uses I'm talking about aren't cheat codes or mods. I actually used objects executing strings in my own code, so I could put checks in levels as I go. Like whether an enemy is dead, or a button is pressed, etc. If I tried to port my own game that I made to Studio, it would break.
Yeah sure, mods are awesome, but I'd gladly give that feature up in a windows 8 version* if necessary.*GM 8.1 isn't entirely stable in windows 8. It can sometimes crash.I was referring to you doing stuff to Nintendo Nightmare. Besides that, there's absolutely no reason to use execute_string like that when GM has a built in debug screen where you can add expressions like those
"when GM has a built in debug screen where you can add expressions like those "
*facepalm* That's a debugging feature, and I sometimes use it. That's not what I meant. I use execute_string objects to actually make the level work. There's so many checks for puzzles and such that it is easier in the long run to just make a quick object via creation code to do it.Also, I rarely made mods in Nintendo Nightmare. I mostly used it for… well… cheating. The only mod I tried making was the multiplayer and that completely broke. Anyways, that isn't really relevant anymore, since I could just as easily wire the cheats to hotkeys, seeing as I have a copy of the source and all. *scribbles quick mental note for debugging later*I could do the equivalent somewhat easily. I'd just have to make a huge list of checks, and it would be very tedious and annoying. Like I said, it's mostly when certain enemies are dead, or a puzzle is solved. Things that would normally be a waste to create one object for. The other way saves file space.
Or you just set a global variable? Seems so much more practical to me and no work at all
*facepalm* Where's the check, fair sir? Where is the check?
(I'm sorry. That meme just popped into my head.)Just wondering, are there pointers in the new GM? That was the only thing I used it for, so I could pass variable names as strings so I could reference them without hard coding the name then setting a new variable too it. Of course, if you return one value you can just use Return, but with multiple it becomes trickier. Has this been solved? :)