Has anyone else encountered this? Does anyone know of a solution?
Edited by sumbodyshero, 16 June 2012 - 01:41 PM.
Posted 13 June 2012 - 05:25 PM
Edited by sumbodyshero, 16 June 2012 - 01:41 PM.
Posted 13 June 2012 - 05:47 PM
Posted 13 June 2012 - 06:26 PM
is it being triggered from another object?
Posted 13 June 2012 - 06:52 PM
Posted 13 June 2012 - 10:09 PM
If it's in the room, right click on it and add some "Creation Code". This is unique to THAT instance.
This is run AFTER the instance's create event.
Posted 14 June 2012 - 07:29 AM
Posted 14 June 2012 - 02:10 PM
Please clarify, are you using the <object>.<variable> syntax because if so that stopped working in GM:HTML5 and as far as I know it is not going to be fixed, if you want to affect all instances of an object you need "with".
Posted 15 June 2012 - 12:53 AM
Wait what? I've never had an issue with this. object.variable=2; for example should change the nearest instance's 'variable' to 2, and only that ones. No other instances are accounted for in that syntax. I think the thing with "nearest" instance has changed from HTML5 onward, I don't know how it selects which now.. but it was never meant to change all instances of that object's variable..that is what "with" is for anyways.Please clarify, are you using the <object>.<variable> syntax because if so that stopped working in GM:HTML5 and as far as I know it is not going to be fixed, if you want to affect all instances of an object you need "with".
Posted 15 June 2012 - 02:29 AM
objectX.variable = 2will set variable to 2 only for the first instance that was created (or the last if it's changed since 8.1)*
with(objectX)
{
variable = 2
}will set variable to 2 for all instances of objectXPosted 15 June 2012 - 07:09 AM
The problem with that is that these values need to constantly be checked (they are in the step event).
I really don't understand why I am having this problem. From what I've read and understand, instance variables should apply to each instance individually. Am I wrong about that?
Posted 15 June 2012 - 07:12 AM
Well the dot syntax used to set all instances up to at least GM8.0, and I think GM8.1Let's say you have 3 instances in your room of "objectX".
objectX.variable = 2will set variable to 2 only for the first instance that was created (or the last if it's changed since 8.1)*
Posted 15 June 2012 - 01:18 PM
The problem with that is that these values need to constantly be checked (they are in the step event).
I really don't understand why I am having this problem. From what I've read and understand, instance variables should apply to each instance individually. Am I wrong about that?
What?!?!? The create event allows you to setup values needed by the instance. So inside the create event for an instance if you set my_value=10, then this variable is there for checking in the step loop. They don't "go away" after the creation code is run.
You can use the Create event to set default values, then the creation code to override them.
Edited by sumbodyshero, 15 June 2012 - 01:19 PM.
Posted 15 June 2012 - 01:24 PM
What....no. The step event will happen for all instances of that object, if you use the step event of that object. Silly thing, you. Read the help file a bit more.
The problem with that is that these values need to constantly be checked (they are in the step event).
I really don't understand why I am having this problem. From what I've read and understand, instance variables should apply to each instance individually. Am I wrong about that?
What?!?!? The create event allows you to setup values needed by the instance. So inside the create event for an instance if you set my_value=10, then this variable is there for checking in the step loop. They don't "go away" after the creation code is run.
You can use the Create event to set default values, then the creation code to override them.
But then the step event applies to only the first instance placed in the room. It is not applying to all of them. So maybe I could use a controller object to test objectX.variable? (Which would waste a lot of memory, but I bet there is an "if object in current room" test.)
Posted 15 June 2012 - 01:40 PM
What....no. The step event will happen for all instances of that object, if you use the step event of that object. Silly thing, you. Read the help file a bit more.
The problem with that is that these values need to constantly be checked (they are in the step event).
I really don't understand why I am having this problem. From what I've read and understand, instance variables should apply to each instance individually. Am I wrong about that?
What?!?!? The create event allows you to setup values needed by the instance. So inside the create event for an instance if you set my_value=10, then this variable is there for checking in the step loop. They don't "go away" after the creation code is run.
You can use the Create event to set default values, then the creation code to override them.
But then the step event applies to only the first instance placed in the room. It is not applying to all of them. So maybe I could use a controller object to test objectX.variable? (Which would waste a lot of memory, but I bet there is an "if object in current room" test.)
Edited by sumbodyshero, 15 June 2012 - 01:42 PM.
Posted 15 June 2012 - 01:49 PM
Posted 15 June 2012 - 02:31 PM
Edited by sumbodyshero, 16 June 2012 - 01:42 PM.
Posted 15 June 2012 - 04:19 PM
0 members, 0 guests, 0 anonymous users