GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2008-02-07 01:47:16

xot
Administrator
Registered: 2007-08-18
Posts: 1,201

Built-in variable "score" is a signed integer? Wha???

I saw this very interesting exchange on GMC.

gmXpert2000 wrote:

I've noticed that when Game Maker gets to a certain memory limit on variables, it skips back to negatives as I've experienced with signed variables in languages like C++.

Yourself wrote:

GM variables can't overflow into negative values. They aren't signed integers, they're floating point values. They work differently.

gmXpert2000 wrote:

Are you sure? I have an example I made for something else which adds too a variable a certain amount. I changed that amount to be very large and after adding it a couple times it looped back to negatives.

Yourself wrote:

The only time this overflow can occur is when you use the built-in score variable (which is a signed integer).

Personally, I'm really surprised to learn that "score" is treated this way given the blatant absence of integer data types within GML. It looks like "lives" and "sprite_index" are a couple of other ones. How many more undocumented data types are lurking inside GM?

EDIT:
The alarm[] array is also of 32-bit signed integer type.

Last edited by xot (2008-10-04 10:39:26)


Abusing forum power since 1986.

Offline

#2 2009-01-09 21:53:43

RamboFox
Member
Registered: 2009-01-09
Posts: 3

Re: Built-in variable "score" is a signed integer? Wha???

xot wrote:

I saw this very interesting exchange on GMC.
EDIT:
The alarm[] array is also of 32-bit signed integer type.

Heh, the alarm system - Im wondering whether I should post my alarm scripts (because my extended and advanced alarm system allows 32000 alarms), here's a link to a GMC topic to show you what I mean: http://gmc.yoyogames.com/index.php?show … try3014738

Last edited by RamboFox (2009-01-09 22:07:23)

Offline

#3 2009-01-10 00:17:37

xot
Administrator
Registered: 2007-08-18
Posts: 1,201

Re: Built-in variable "score" is a signed integer? Wha???

Yeah, I saw that (I'm the one who approved the topic). Definitely useful, something that would be right at home at GMLscripts.com, I just need to decide how I want to handle groups of cooperative scripts on the site. The site's content management system has some technical limitations I need to work around to present the scripts the way I'd like. Meanwhile, feel free to submit them via the site or post a topic in the Script Submission forum.


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB