October 04, 2023, 06:36:15 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 ... 15

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

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3493
  • she's never quite as dead as you think
ITT we make fun of stupid stuff in GML
« on: January 25, 2013, 07:55:09 pm »

Because it's a fun way to waste time and I want to do it.

From the GML help file:
Quote
A program consists of a set of instructions, called statements. A program must start with the symbol '{' and end with the symbol '}'. Between these symbols there are the statements. Statements must be separated with a ';' symbol.

That's a very interesting use of the word "must".
« Last Edit: October 14, 2013, 12:18:17 pm by ajf »
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.

Malpracticeisdead

  • Guest
Re: ITT we make fun of stupid stuff in GML
« Reply #1 on: January 26, 2013, 02:21:19 am »

So is this a thread where we dig into help files to debate semantics or is there a point to this??
Logged

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 #2 on: January 26, 2013, 03:24:44 am »

fun fact: move_contact_solid doesn't change previousx and previousy, so if you move something to contact and it gets a collision later in the same frame, it never moves from its original location but still experiences the movement.
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

Catman

  • The Argumental
  • Veteran Member
  • ******
  • Karma: 18
  • Offline Offline
  • Posts: 4375
  • Take on me
    • Yuki Yuki Yuki
Re: ITT we make fun of stupid stuff in GML
« Reply #3 on: January 26, 2013, 05:02:36 am »

Why move using x and y modifying when you can use motion_add, it's so much smoother and you can stack them.
Logged
My style is the best...
...so I challenge you!

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 #4 on: January 26, 2013, 05:27:16 am »

Why move using x and y modifying when you can use motion_add, it's so much smoother and you can stack them.
Um, that's the same as adding to hspeed and vspeed.
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: 12699
  • Another one --
Re: ITT we make fun of stupid stuff in GML
« Reply #5 on: January 26, 2013, 05:28:09 am »

sometimes you literally need to move something to a certain place, no motion no nothing
motion_add is absolutely worthless for that :V
« Last Edit: January 26, 2013, 05:28:29 am 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

Catman

  • The Argumental
  • Veteran Member
  • ******
  • Karma: 18
  • Offline Offline
  • Posts: 4375
  • Take on me
    • Yuki Yuki Yuki
Re: ITT we make fun of stupid stuff in GML
« Reply #6 on: January 26, 2013, 05:38:23 am »

Why move using x and y modifying when you can use motion_add, it's so much smoother and you can stack them.
Um, that's the same as adding to hspeed and vspeed.
According to the manual, motion_add uses vector addition which surely isn't the same.
Logged
My style is the best...
...so I challenge you!

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 #7 on: January 26, 2013, 06:03:12 am »

Why move using x and y modifying when you can use motion_add, it's so much smoother and you can stack them.
Um, that's the same as adding to hspeed and vspeed.
According to the manual, motion_add uses vector addition which surely isn't the same.
yes, that's the same thing. hspeed and vspeed are two components of a 2-dimensional vector. x and y are also, and each step the hspeed/vspeed vector is added to the x/y vector (i.e. speed += acceleration)
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: 3493
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #8 on: January 26, 2013, 09:47:32 am »

Pascal-style block symbols considered exactly equivalent to non-pascal-style block symbols

begin
    var z;
    z := 0
    if z <> 3 then {
        z := 2
    end
    show_message(z)
}


results in:
2

 :hehe:
« Last Edit: August 10, 2017, 10:17:03 am by ajf »
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.

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 11006
  • Dust in a box under a table
Re: ITT we make fun of stupid stuff in GML
« Reply #9 on: January 26, 2013, 11:20:03 am »

Sorry but what does := and <> mean?
Never seen that in code before.

Intel Guard

  • GG2 Commentator
  • Retired Goja Warrior
  • ******
  • Karma: 44
  • Offline Offline
  • Posts: 8611
  • the s*x number
Re: ITT we make fun of stupid stuff in GML
« Reply #10 on: January 26, 2013, 11:33:01 am »

hilarious thread
Logged
I've been listening to a bit of Green Day recently (past 2 months actually). Really raises the level of "fuckethesystem" in me.  :z5:
"god is dead."♫♫♫

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 #11 on: January 26, 2013, 11:40:17 am »

Sorry but what does := and <> mean?
Never seen that in code before.
Pascal idioms. := is equivalent to = for assignment (and = is used for equality, not ==). <> is equivalent to !=, this is also seen in BASIC.
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.

Port

  • Junior Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • portify.github.io
Re: ITT we make fun of stupid stuff in GML
« Reply #12 on: January 27, 2013, 01:20:05 am »

gml is too syntax-free

Code: [Select]
var xx, yy, nn;
if can_shoot = true then begin
   can_shoot := false
   alarm[0] := 5
   xx := x + lengthdir_x(14, direction)
   yy := y + lengthdir_y(14, direction)
   nn := instance_create(xx, yy, obj_bullet)
   with nn begin
      speed := obj_tank.speed + 3
      direction := obj_tank.direction
   end
end

what is this

a mix of Pascal, JavaScript and Lua?

sometimes I don't even
« Last Edit: January 27, 2013, 01:21:25 am by Port »
Logged
portify@neko.im

MedO

  • Owns this place
  • *****
  • Karma: 151
  • Offline Offline
  • Posts: 1751
Re: ITT we make fun of stupid stuff in GML
« Reply #13 on: January 27, 2013, 12:31:10 pm »

Maybe GM just does some search/replace on GML code and then passes the result to eval :P
Except that Delphi apparently doesn't have eval, so there goes that conspiracy theory.
« Last Edit: January 27, 2013, 12:31:37 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.

NAGN

  • Developer
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16382
  • Yeah so now I have an idea
Re: ITT we make fun of stupid stuff in GML
« Reply #14 on: January 27, 2013, 01:44:48 pm »

gml is too syntax-free

Code: [Select]
var xx, yy, nn;
if can_shoot = true then begin
   can_shoot := false
   alarm[0] := 5
   xx := x + lengthdir_x(14, direction)
   yy := y + lengthdir_y(14, direction)
   nn := instance_create(xx, yy, obj_bullet)
   with nn begin
      speed := obj_tank.speed + 3
      direction := obj_tank.direction
   end
end

what is this

a mix of Pascal, JavaScript and Lua?

sometimes I don't even
its a miracle that the gml parser actually works ::)
Logged
Pages: [1] 2 3 ... 15
 

Page created in 0.037 seconds with 36 queries.