|
polygone
|
|
Reply #1 Posted on: June 19, 2013, 06:46:33 am |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
You need to check if the return is != noone
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
egofree
|
|
Reply #3 Posted on: June 19, 2013, 07:11:44 am |
|
|
Joined: Jun 2013
Posts: 601
|
I think the wiki page should be changed : http://enigma-dev.org/docs/Wiki/Collision_line, because it says the function returns a boolean. This is not the case.
|
|
« Last Edit: June 19, 2013, 07:16:43 am by egofree »
|
Logged
|
|
|
|
Goombert
|
|
Reply #4 Posted on: June 19, 2013, 02:51:52 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
egofree it says that because ENIGMA returns differently for that than GM, ENIGMA returns what had collided, GM just returns true or false.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
polygone
|
|
Reply #5 Posted on: June 19, 2013, 03:43:52 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
egofree it says that because ENIGMA returns differently for that than GM, ENIGMA returns what had collided, GM just returns true or false.
No, GM returns the instance id also.
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
egofree
|
|
Reply #7 Posted on: June 19, 2013, 04:56:01 pm |
|
|
Joined: Jun 2013
Posts: 601
|
I was looking for information about how testing collisions in a given region and i found the collision_rectangle function, which was perfect for me. But the info i found was for GM not ENIGMA. In my mind the GM functions are identical in ENIGMA. I feel the ENIGMA function collision_rectangle is fine, but it's dangerous right now for two reasons : 1) unfortunately, as GM is more famous right now than ENIGMA, people will very often find information on GM programming websites. This means they will probably try what they found on these websites with ENIGMA, and if the functions are not identical, they will be puzzled. This will be not be a good impression for new users. At first, i was sure it was a bug in ENIGMA. I was thinking : what a disappointment, the function doesn't work at all ! 2) If the functions are not identical, this means it will be break compatibility and it will be harder to import GM projects. My feeling is that we should give collision_rectangle another name and keep the GML functions compatible with ENIGMA. If it is not the case, we should do it for very good reasons, and most of all document this. Somebody has corrected the wiki page for collision_rectangle today, but the page was wrong before. If some GM functions are not identical it should be displayed in the wiki and be visible to everybody.
|
|
« Last Edit: June 19, 2013, 05:10:04 pm by egofree »
|
Logged
|
|
|
|
polygone
|
|
Reply #8 Posted on: June 19, 2013, 05:12:53 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
The functions are the same, as me and ExDeus said.
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|
Josh @ Dreamland
|
|
Reply #10 Posted on: June 19, 2013, 05:26:48 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
In GM, a value of -4 is false, as are all other values less than 0.5. In ENIGMA, only a value of 0 is false.
I'm working on a new type which will hint to the compiler that negatives are to be considered false.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #12 Posted on: June 20, 2013, 06:28:23 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The wrong return type is because I told Robert to set up a bot to generate the pages in his new format, and he insisted that doing it by hand was better. So every post-2010 modification to the function documentation on the Wiki was done by hand and is probably teeming with errors.
inb4 Robert saying "Everyone makes mistakes." Bots don't make mistakes.
|
|
« Last Edit: June 20, 2013, 06:30:03 am by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
DarkAceZ
|
|
Reply #13 Posted on: June 22, 2013, 06:11:16 pm |
|
|
Location: United States Joined: Dec 2011
Posts: 75
|
So when this new compiler happens I won't have to be spamming !=noone anymore? And why is -4 so special?
|
|
|
Logged
|
My Goodness! Is it 4:30? I'm supposed to be having a back, sack and crack! [edit]
|
|
|
polygone
|
|
Reply #14 Posted on: June 22, 2013, 06:17:31 pm |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
In this instance I think GM would have been better starting indexes at 1 and using 0 for noone.
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
|