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

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

Orpheon

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

Does this thread really belong here?
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 #16 on: January 27, 2013, 04:00:57 pm »

closest board really
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: 3493
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #17 on: January 28, 2013, 02:07:41 am »

GML only has two types: real and string. This may surprise you since it seems to have objects. But objects aren't a type, so how do they work? Well, they are actually stored in variables as reals, which are effectively pointers or references to the object. Hence the . operator is quite special. It is really more of a -> operator than anything.

What does this mean? It means that this:

(17/3).x =7;

is valid code.
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: 6426
  • Developer
Re: ITT we make fun of stupid stuff in GML
« Reply #18 on: January 28, 2013, 04:13:11 am »

GML only has two types: real and string. This may surprise you since it seems to have objects. But objects aren't a type, so how do they work? Well, they are actually stored in variables as reals, which are effectively pointers or references to the object. Hence the . operator is quite special. It is really more of a -> operator than anything.

What does this mean? It means that this:

(17/3).x =7;

is valid code.
Do you know whether you can handle memory that GML doesn't understand? Aka run an extension to allocate memory, return a pointer and then use that pointer inside GML?
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 #19 on: January 28, 2013, 06:07:16 am »

Orpheon: GML itself can only use strings and reals. The . operator looks up the instance associated with a given real. GM doesn't have any other sense of pointer whatsoever. Reals are 64-bit floats, so GM can't store most 64-bit pointers, only 32-bit addressed ones.
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: 3493
  • she's never quite as dead as you think
Re: ITT we make fun of stupid stuff in GML
« Reply #20 on: January 28, 2013, 09:47:50 am »

Yep. Also, this has made me realise that object and other resource identifiers are actually just real constants.
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 #21 on: January 28, 2013, 10:39:25 am »

GML only has two types: real and string. This may surprise you since it seems to have objects. But objects aren't a type, so how do they work? Well, they are actually stored in variables as reals, which are effectively pointers or references to the object. Hence the . operator is quite special. It is really more of a -> operator than anything.

What does this mean? It means that this:

(17/3).x =7;

is valid code.

there's worse
look up TorqueScript

this is valid in TS:
"hello".x = 33/5.y;

oh also it has like 4-5 individual namespaces
and objects can be referred to both as names and IDs
Logged
portify@neko.im

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 #22 on: January 28, 2013, 12:02:25 pm »

So, Iunno if this is just standard or GML only, but I found out what some of the vk_'s ascii codes are equivalent to:

! - Pg. Up
" - Pg. Down
# - End
$ - Home Key
% - Left Arrow
& - Up Arrow
` - Right Arrow
( - Down Arrow
- - Insert
. - Delete

These are just the ones I've found so far though
« Last Edit: January 28, 2013, 12:05:07 pm by Dusty »
Logged

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 #23 on: January 28, 2013, 12:45:34 pm »

So, Iunno if this is just standard or GML only, but I found out what some of the vk_'s ascii codes are equivalent to:

! - Pg. Up
" - Pg. Down
# - End
$ - Home Key
% - Left Arrow
& - Up Arrow
` - Right Arrow
( - Down Arrow
- - Insert
. - Delete

These are just the ones I've found so far though
they're constants, they're not meant to refer to anything :/

scan codes != ascii character codes
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 #24 on: January 28, 2013, 09:07:08 pm »

Well I just thought it was interesting since keyboard_check() uses the ascii codes for letters, and then you can use the vk_'s in there as well.

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 #25 on: January 28, 2013, 09:53:59 pm »

I think the vks are just mapped to certain constants to the key codes that can't be normally typed in the language (so page up, space, etc. etc.)

otherwise you can just use ord('e') or whatever character, just like in any other language
Logged

Nukleus

  • New Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 46
Re: ITT we make fun of stupid stuff in GML
« Reply #26 on: January 29, 2013, 09:24:43 am »

here's a good one: ds
Logged

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 #27 on: January 29, 2013, 10:21:27 am »

here's a good one: ds
haha, yes. The ds_list/map/etc. data structures are OK, but the real question is why the hell does the language lack built-in support for them?
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: 6426
  • Developer
Re: ITT we make fun of stupid stuff in GML
« Reply #28 on: January 29, 2013, 11:22:11 am »

ITT GML is shit and should be burned.


Although what annoys me most is still the fact that there's no built-in support for the actual code, nor any open compiler. It might be an interesting idea to make an editor armed with gmksplit to edit gmk files without game maker (that would also be cross-platform), only idk how Yoyo games sees that legally.
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 #29 on: January 29, 2013, 11:53:23 am »

lateralGM
...which gmksplit uses as a lib
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
Pages: 1 [2] 3 4 ... 15
 

Page created in 0.026 seconds with 36 queries.