ZombieSquirrel
Member
Hi everyone!
I have an object that is spread across a room,
meaning there are many instances of that object.
In the instances creation code (not in the object create event, but in the instances creation code in the room editor) I gave "groups" of these instances a specific value.
Some of these instances have a variable numbered "1", others "2", others "3".
Depending on that number, when I make my player do a certain action,
all instances of the same number need a change. The others must be left alone.
Generic example that exactly points out what i want to do:
Say out of 99 instances, 33 have number 1, 33 have number 2, 33 have number 3. If the player
clicks on a SINGLE instance with number 1, all instances with number 1 must be accessed and be given a change, while leaving all instances with number 2 and 3 alone.
Is there a certain way of going about with this?
I know I'm not being too clear here, as showing code would probably be a bit confusing, as I'm just trying to get a very general idea of how to do this. So in order to make my question clear without showing a bunch of code, let me just say I'm searching for a principle, a way of doing something. Basically what I want is:
How to access multiple instances of the SAME object, but ONLY those instances of that object that have the same pre-condition in their own specific create event. These instances that need to be changed, have been given the same value for a variable in their INSTANCE CREATION CODE, so not in their CREATE EVENT.
Changing one of these similar instances should change ONLY those instances with the same variable-value.
I hope this question is clear, as I think it could help me big-time and it might even be an interesting question to ask for who-ever stumbles upon this thread.
I just have this feeling a simple for-loop could do the trick, but I think I'm missing the correct knowledge about instance functions and logic here.
I have an object that is spread across a room,
meaning there are many instances of that object.
In the instances creation code (not in the object create event, but in the instances creation code in the room editor) I gave "groups" of these instances a specific value.
Some of these instances have a variable numbered "1", others "2", others "3".
Depending on that number, when I make my player do a certain action,
all instances of the same number need a change. The others must be left alone.
Generic example that exactly points out what i want to do:
Say out of 99 instances, 33 have number 1, 33 have number 2, 33 have number 3. If the player
clicks on a SINGLE instance with number 1, all instances with number 1 must be accessed and be given a change, while leaving all instances with number 2 and 3 alone.
Is there a certain way of going about with this?
I know I'm not being too clear here, as showing code would probably be a bit confusing, as I'm just trying to get a very general idea of how to do this. So in order to make my question clear without showing a bunch of code, let me just say I'm searching for a principle, a way of doing something. Basically what I want is:
How to access multiple instances of the SAME object, but ONLY those instances of that object that have the same pre-condition in their own specific create event. These instances that need to be changed, have been given the same value for a variable in their INSTANCE CREATION CODE, so not in their CREATE EVENT.
Changing one of these similar instances should change ONLY those instances with the same variable-value.
I hope this question is clear, as I think it could help me big-time and it might even be an interesting question to ask for who-ever stumbles upon this thread.
I just have this feeling a simple for-loop could do the trick, but I think I'm missing the correct knowledge about instance functions and logic here.