Master Cabalist
Member
instance_place(x,y, SpecialBrain) == idGIven the line of code:
What would the result?
instance_place(x,y, SpecialBrain) == idGIven the line of code:
What would the result?
I count three.A syntax error
multiple even.
Obligatory question. What did it do when you tried it?instance_place(x,y, SpecialBrain) == id
Yeah that's what I thought...….As a statement, this will never be true .. as it can't collide with itself .. instance_place could return the id of another instance of SpecialBrain if there is one, but not the one running the code.
It's not even a comparison, it's a malformed assignment. He is telling it to be "== id".As a statement, this will never be true .. as it can't collide with itself .. instance_place could return the id of another instance of SpecialBrain if there is one, but not the one running the code.
if (instance_place(mouse_x, mouse_y, SpecialBrain) == id) {
show_debug_message("chamaeleon was wrong");
}
Correct. But he did state that this was the line of code that he was working with.Yes, as a code it is broken, but as a statement it works..
I answered the question, why the sad-A syntax error
multiple even.
Edit: see new comment
instance_place(x,y,specialbrain) ==
this will throw an error because your using an function as a statementinstance_place(x,y, SpecialBrain) == 100004
10005 == 100004
if 10005 == 100004
var brain = instance_place(x,y, SpecialBrain);
if (brain == id)
{
//do code but this will never run as the statment will always return false
}
- place_*() functions don't work at all if the instance executing the code has no sprite or mask.
- place_*() functions never detect collision with itself, whereas position functions can be used with self.
With out needing to be paid money for time and effort ( nothing personal I hate collision systems)@EvanSki Maybe you can take on a problem I have with collision. Its related to that up there.
The result of this would be true if the instance ID of the instance of SpecialBrain that is colliding with the mask of the calling instance positioned at x, y is equal to the calling instance's ID and false if this is not the case.instance_place(x,y, SpecialBrain) == id