-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phy_collision_x/y is marked as real, but is an array #4532
Comments
I don't know how the GML type system works exactly but this appears to be more than just a documentation issue. On the current beta version I am unable to use array functions on |
I would like to add an additional error about the phy_collision_points. If you destroy the instance in the same collision step. Then the phy_collision_points became null (silent crash) collision event: |
Nah it's an array, but you need to check how long the array is. |
YoYoGames/GameMaker-Bugs#4532 * Fixed on phy_collision_x and phy_collision_y pages * Moved note about "collision event only" to a snippet and inserted on all function pages * Explicitly added "Collision Event" to the examples to indicate context * On phy_collision_points page: "between the two objects in the collision" => "between the two instances in the collision" * A few typo fixes here and there
YoYoGames/GameMaker-Bugs#4532 * Updated the pages of all collision event variables again: * Inserted "Note" snippet on each page to explain built-in arrays aren't "real" arrays * Syntax changed to "builtin_array[index]", return type kept as "real", since - in theory - you can only access an array through an array lookup and that array lookup *does* return a real (omitting the subscript is allowed for backward compatibility) * Removed semicolons ";" at the end of the syntax line as these are expressions, rather than statements * Updated manual pages of other built-in global arrays as well. All of these pages should be updated by this commit. * Changed "Note" snippet about built-in arrays not being "real" arrays: "read" -> "access"
Built-in arrays aren't "true" arrays, a consequence of that is that they cannot be used with the array functions. The syntax meant to be used is the array syntax with the subscript operator: var _val = builtin_array[index]; // Looks up value at index "index" The other syntax: var _val = builtin_array; // Looks up value at index 0, does not assign a reference to the built-in array to _val is supported for backward compatibility, as confirmed by @rwkay. |
Verified fixed in the current Beta version of the Manual. Thank you. |
YoYoGames/GameMaker-Bugs#4532 * Fixed on phy_collision_x and phy_collision_y pages * Moved note about "collision event only" to a snippet and inserted on all function pages * Explicitly added "Collision Event" to the examples to indicate context * On phy_collision_points page: "between the two objects in the collision" => "between the two instances in the collision" * A few typo fixes here and there (cherry picked from commit e1a58c0)
Description
phy_collision_x/y is marked as real, but is an array
3a03bac0-6116-42d3-bc57-5f4a87cbc4d9
The text was updated successfully, but these errors were encountered: