September 03, 2025, 05:30:39 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: 1 2 3 [4] 5 6 ... 15

Author Topic: ITT we make fun of stupid stuff in GML  (Read 42235 times)

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #45 on: February 06, 2013, 04:43:38 pm »

I think I'll make angl just do != 0 then.

You might consider adding a backwards-compatibility toggle that can be enabled on a per-file basis.  So, on the off chance that old code depends on GML's wonky behavior, it can still be made to work in angl.

Or you could implement the old GML behavior by default unless a script author specifies a flag that enables newer, more sensible angl behavior.  I'm basically borrowing the idea behind Javascript's "use strict".
I started off trying to copy actual implementation behaviour, but there's so much nonsensical undocumented stuff I'm going to make the parser and runtime quite strict. Unless you're using := and begin/end everywhere, things should work fine still, although some semicolons might be missing.
« Last Edit: August 31, 2025, 05:43:54 pm by MedO »
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

MedO

  • Owns this place
  • *****
  • Karma: 152
  • Offline Offline
  • Posts: 1756
Re: ITT we make fun of stupid stuff in GML
« Reply #46 on: February 06, 2013, 04:50:17 pm »

I'd aim for "easy to port code" rather than "strict backward compatibility", that way you keep the crud out of your base language without having to explicitly specify that you want sane behaviour.
Logged
Quote from: Alfred North Whitehead
It is the business of the future to be dangerous; and it is among the merits of science that it equips the future for its duties.

Quote from: John Carmack
[...] if you have a large enough codebase, any class of error that is syntactically legal probably exists there.

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #47 on: February 06, 2013, 06:17:15 pm »

I'd aim for "easy to port code" rather than "strict backward compatibility", that way you keep the crud out of your base language without having to explicitly specify that you want sane behaviour.
That's the idea. Well-written GML should mostly still work, at least in theory.
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #48 on: June 21, 2013, 04:45:57 pm »

22:22 - ajf: protip
22:22 - ajf: directory_create("ServerPluginsCache");
22:22 - ajf: will
22:22 - ajf: SOMEHOW
22:22 - ajf: terminate the script
22:22 - ajf: but directory_create(working_directory + "\ServerPluginsCache");
22:22 - ajf: won't
22:22 - ajf: guess how I found this out
22:23 - PON: brute force
22:23 - ajf: yes
22:23 - ajf: I literally wrote JS that appended show_message("<line number>"); to the end of every single line
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: ITT we make fun of stupid stuff in GML
« Reply #49 on: June 22, 2013, 04:46:04 am »

I still love the way game maker decides to just not call any create even if there's a room change, so if you create eg. a character at the wrong time, you get hoards of errors at completely different locations about uninitialised variables.
Logged

Danikah

  • Guest
Re: ITT we make fun of stupid stuff in GML
« Reply #50 on: June 22, 2013, 01:19:44 pm »

I still love the way game maker decides to just not call any create even if there's a room change, so if you create eg. a character at the wrong time, you get hoards of errors at completely different locations about uninitialised variables.
Ouch, the memories.
Logged

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #51 on: July 23, 2013, 04:00:27 pm »

[21:59] <wareya_> I like GM because it does exactly what it says unless it doesn't.
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Catman

  • The Argumental
  • Veteran Member
  • ******
  • Karma: 18
  • Offline Offline
  • Posts: 4047
  • Take on me
    • Yuki Yuki Yuki
Re: ITT we make fun of stupid stuff in GML
« Reply #52 on: July 23, 2013, 05:42:31 pm »

I love it when Gamemaker throws syntax errors at you when you use the auto-complete drop down suggestions... retyping it out fixes the false error...
Logged
My style is the best...
...so I challenge you!

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 10312
  • Dust in a box under a table
Re: ITT we make fun of stupid stuff in GML
« Reply #53 on: August 04, 2013, 02:23:53 am »

RoboDusty: I am not sure whether to slap the maker of GM
RoboDusty: Or kiss him.
RoboDusty: Say I have a script called game_init()
RoboDusty: I can do "example = game_init;" and then later do "script_execute(example);" and it would work as if I had typed "game_init();"

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12519
  • Another one --
Re: ITT we make fun of stupid stuff in GML
« Reply #54 on: August 04, 2013, 02:31:53 am »

Working as intended!
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #55 on: August 04, 2013, 05:37:12 am »

RoboDusty: I am not sure whether to slap the maker of GM
RoboDusty: Or kiss him.
RoboDusty: Say I have a script called game_init()
RoboDusty: I can do "example = game_init;" and then later do "script_execute(example);" and it would work as if I had typed "game_init();"
That's how it's supposed to work.
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12519
  • Another one --
Re: ITT we make fun of stupid stuff in GML
« Reply #56 on: August 04, 2013, 05:42:37 am »

He's complaining you can't go example(); or at least (example)();.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 10312
  • Dust in a box under a table
Re: ITT we make fun of stupid stuff in GML
« Reply #57 on: August 04, 2013, 02:40:44 pm »

No. I was just surprised that worked at all.
I was trying to figure out how to make a set of changeable weapons for a game, and thought of a way to do it.
I tried doing more complicated things like
Code: [Select]
execute_string("return "+scr_name+"();");but those didn't work, so I had to find something else.

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12519
  • Another one --
Re: ITT we make fun of stupid stuff in GML
« Reply #58 on: August 04, 2013, 07:09:32 pm »

Oh, I just kind of assumed you were used to how function pointers worked in C, which are like,
type func(args)
{
    ...
}

funcpointer = &func;

(*funcpointer)(args);
« Last Edit: August 04, 2013, 07:09:42 pm by Phantom Brave »
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3415
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #59 on: August 08, 2013, 01:36:19 pm »

[18:36] <wareya> I like GML because it does exactly what it says unless it doesn't.
Logged
did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.
Pages: 1 2 3 [4] 5 6 ... 15
 

Page created in 0.032 seconds with 36 queries.