pick an object by dynamically supplied name

Just started using Construct 2? Post your questions here

Post » Tue Jul 08, 2014 9:02 pm

Hello.

Is there a way to pic an object by dynamically supplied name ...

a. in condition?

b. in expression?


Like: MyObject & n

Thank you.
Konstantin.
You do not have the required permissions to view the files attached to this post.
B
4
S
1
Posts: 13
Reputation: 374

Post » Tue Jul 08, 2014 10:42 pm

When creating the instance "dynamically" store the UID in some array. Or use an instance variable that is different for each instance of the object so that you have a reference that allows you to pick only the specific instance you're looking for.

If you want to have different instances of a same sprite displaying different frames, be sure to load/display the correct animation frame and have the animation at a speed of 0 so the frames won't switch.

Perhaps you're asking the wrong question here though and should actually explain exactly what you are trying to achieve to see if the current method you are applying is the most appropriate.

Also, as you can see I moved your topic as it is an help request that fits better to the "How do I" forum.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
294
S
117
G
96
Posts: 7,311
Reputation: 71,086

Post » Tue Jul 08, 2014 11:54 pm

Could try the nickname plugin. I only just learned about it but search the plugin forum.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Jul 10, 2014 2:22 pm

I was so much pleased with answers to my questions from this forum.
The forum is one of the "pros" of choosing C2.

Kyatric and codah, thank you for your carefully written answers.




Now back to the topic:



1.

Not every language has dynamic names. Not a big problem.
On trade-off side, c2-IDE can refactor object-names by one click.





2.

I asked for "dynamc-names" only because of, in my case, c2 half-fails to pic by UID.
This is either my fault or c2-bug described in example on the bottom of the picture in event "65".




3.
Yes, i must look at "nickname" plugin.



I no longer need the answer because no time to do my own research and "homework on c2".



Thank you.
K.
B
4
S
1
Posts: 13
Reputation: 374


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest