Does anyone have any links to docs that exhaustively explain how the other keyword behaves? Searching the manual yields zero results for "other", and googling has so far just led me to fragments of information scattered about old docs, forum posts, and the like. I suspect that other is fully, officially documented somewhere but I can't for the life of me find it.
#Where are the docs for the `other` keyword?
12 messages · Page 1 of 1 (latest)
If I'm understanding correctly, and based on these docs:
then the other keyword just refers to the self scope external to the current with scope? Is that all it is?
other is very situational
like in a with statement
with (obj_A)
{
//inside here, other is the object this code is in
}
or in one of the collision events, other is the object you collided with
Are those its only two behaviors?
there might be more, those are just the 2 I can name off of my head.
I only really use it in the context of a with statement.
Is there any reason you wanna know about other? general curiosity or are you trying to use it for something?
I've been working on a VSCode extension for coding our projects and this is one of the remaining things that doesn't behave right.
ah, hmm
I tried to do a search for other uses of other myself
and with statements and collision events were the only things mentioned in a reddit post too.
the with statement context is prob it's most useful use, and there it's basically just the id of the object the with statement is in.
where, in a collision event it's the id of the object you collided with.
But you can also just not use collision events lol.
Yeah that's the main way we use it, I believe. Fortunately it was easy to add that behavior! I'll have to hold off on the collision stuff until I figure out how we're using it in our projects (I don't actually do the game programming, just tooling development)
yeah, might be good to just see if there are any other uses of other in their code lol
I've been using GMS since 2017 and they are the only 2 uses I can think of that I ever used.
That's consistent with what I've gathered so far
lol
but yeah, other is usually an id of an object, just what object's id it is depends on the context.