October 04, 2023, 06:40:14 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

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

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

MedO

  • Owns this place
  • *****
  • Karma: 151
  • Offline Offline
  • Posts: 1751
Re: ITT we make fun of stupid stuff in GML
« Reply #30 on: January 29, 2013, 04:32:49 pm »

lateralGM
...which gmksplit uses as a lib
This. You might actually be able to run it from the gmksplitter .jar with the right commandline arguments, but it's probably missing some images or other ressources :P
« Last Edit: January 29, 2013, 04:33:04 pm by MedO »
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: 3493
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #31 on: January 29, 2013, 04:51:42 pm »

lateralGM
...which gmksplit uses as a lib
This. You might actually be able to run it from the gmksplitter .jar with the right commandline arguments, but it's probably missing some images or other ressources :P
wait, gmksplitter contains the entirety of LateralGM?
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: 151
  • Offline Offline
  • Posts: 1751
Re: ITT we make fun of stupid stuff in GML
« Reply #32 on: January 29, 2013, 06:08:31 pm »

lateralGM
...which gmksplit uses as a lib
This. You might actually be able to run it from the gmksplitter .jar with the right commandline arguments, but it's probably missing some images or other ressources :P
wait, gmksplitter contains the entirety of LateralGM?
Code-wise, yes. Extracting only the important bits is more difficult that you might think, and it would make updating with bugfixes from the main lateralGM project much more work.

Edit: In fact I actually had to apply some changes in LGM so that accessing the model classes and Gm file reader/writer didn't start up part of the UI systems. That was originally done in static initializers, i.e. performed on class load... shudder. Also, some code that gets executed when the resource tree changes tries to inform the UI about it, and runs into a NullPointerException because the UI doesn't exist. I just added a null check, because there was no way I'd be able to untangle that mess without sinking days or weeks into it.

Edit2: Am I derailing this into a general "coding horror" thread here?
« Last Edit: January 29, 2013, 06:17:05 pm by MedO »
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.

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6426
  • Developer
Re: ITT we make fun of stupid stuff in GML
« Reply #33 on: January 30, 2013, 10:10:52 am »

lateralGM
...which gmksplit uses as a lib
This. You might actually be able to run it from the gmksplitter .jar with the right commandline arguments, but it's probably missing some images or other ressources :P
wait, gmksplitter contains the entirety of LateralGM?
Code-wise, yes. Extracting only the important bits is more difficult that you might think, and it would make updating with bugfixes from the main lateralGM project much more work.

Edit: In fact I actually had to apply some changes in LGM so that accessing the model classes and Gm file reader/writer didn't start up part of the UI systems. That was originally done in static initializers, i.e. performed on class load... shudder. Also, some code that gets executed when the resource tree changes tries to inform the UI about it, and runs into a NullPointerException because the UI doesn't exist. I just added a null check, because there was no way I'd be able to untangle that mess without sinking days or weeks into it.

Edit2: Am I derailing this into a general "coding horror" thread here?
I think "stupid stuff in GML" and "programmer's nightmares" aren't that far from one-another.


Actually, now I've looked up again what ENIGMA is, and why haven't we tried applying it to gg2? It claims to be completely compatible with GML, can create C++ code and compile it, and also claims to be cross-platform. Is there some problem with extensions or whatnot, or am I missing something?
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6426
  • Developer
Re: ITT we make fun of stupid stuff in GML
« Reply #34 on: February 03, 2013, 01:19:27 pm »

Code: [Select]
instance_destroy = 0;
Logged

Orangestar

  • Veteran Member
  • ******
  • Karma: 2
  • Offline Offline
  • Posts: 4670
  • That's why I didn't delete this account.
    • Clicky Clicky
Re: ITT we make fun of stupid stuff in GML
« Reply #35 on: February 03, 2013, 02:04:44 pm »

I still find it ridiculous that you can type whole scripts and never touch the ;

I had to fucking recondition myself when I used ROBOTC since I learned on GML.

Which was stupid as fuck to do.

cspotcode

  • Coder
  • Administrator
  • *****
  • Karma: 134
  • Offline Offline
  • Posts: 411
Re: ITT we make fun of stupid stuff in GML
« Reply #36 on: February 06, 2013, 12:02:18 pm »

My favorite GML WTF moment:
When we realized that any real value x where -0.5 < x < 0.5 will be considered false in an if(), while(), etc.  WAT.

I agree GML is terrible, but let's focus on legitimate flaws.  Some of these complaints are just pointing out differences between GML and C-style languages.  There are tons of languages out there with/without semicolons, with different meanings for the "." operator, etc.
Logged
"The knack of flying is learning how to throw yourself at the ground and miss."
- Douglas Adams

ajf

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

what you just pointed out isn't a flaw, it just floors the value and does != 0
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.

cspotcode

  • Coder
  • Administrator
  • *****
  • Karma: 134
  • Offline Offline
  • Posts: 411
Re: ITT we make fun of stupid stuff in GML
« Reply #38 on: February 06, 2013, 01:11:54 pm »

Point taken.  I think my frustration at the time was that, even though GML's behavior is predictable once you know what it's doing, it wasn't documented anywhere.
Logged
"The knack of flying is learning how to throw yourself at the ground and miss."
- Douglas Adams

ajf

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

Just like the parser then? :D
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: 151
  • Offline Offline
  • Posts: 1751
Re: ITT we make fun of stupid stuff in GML
« Reply #40 on: February 06, 2013, 01:25:36 pm »

Actually what AJF said is completely wrong. The GML truth check is probably round(x) > 0, not floor(x) != 0. You can abbreviate it to x>=0.5, but I think the former explains the source of this behaviour better: GML just wants to check for x>0, but treats this check as an integer operation, so the value is first rounded.
« Last Edit: February 06, 2013, 01:26:05 pm by MedO »
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.

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12699
  • Another one --
Re: ITT we make fun of stupid stuff in GML
« Reply #41 on: February 06, 2013, 01:45:35 pm »

If it was floor(), then anything truly <0 would be false and any else truly <1 would be true, rather than the -.5 .5 range here.
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

MedO

  • Owns this place
  • *****
  • Karma: 151
  • Offline Offline
  • Posts: 1751
Re: ITT we make fun of stupid stuff in GML
« Reply #42 on: February 06, 2013, 02:10:35 pm »

It isn't a -0.5...0.5 range though, that's part of my point.

Code: [Select]
if(-10)
    show_message("-10");
   
if(-1)
    show_message("-1");
   
if(-0.5)
    show_message("-0.5");
   
if(0.49999)
    show_message("0.49999");
   
if(0.5)
    show_message("0.5");

Only the last message will be shown.
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: 3493
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #43 on: February 06, 2013, 03:13:57 pm »

I think I'll make angl just do != 0 then.
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.

cspotcode

  • Coder
  • Administrator
  • *****
  • Karma: 134
  • Offline Offline
  • Posts: 411
Re: ITT we make fun of stupid stuff in GML
« Reply #44 on: February 06, 2013, 03:50:40 pm »

It isn't a -0.5...0.5 range though, that's part of my point.

Ok yeah, I remembered it was terrible but I had my details mixed up.

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".
Logged
"The knack of flying is learning how to throw yourself at the ground and miss."
- Douglas Adams
Pages: 1 2 [3] 4 5 ... 15
 

Page created in 0.037 seconds with 36 queries.