How do I Create a certain object using UID?

Get help using Construct 2

Post » Sun Feb 15, 2015 7:06 am

So I`ve spend 3 hours already reading tuts and parts of the manual, and still can`t solve my problem

I have 6 items on screen, all of them are in one Family1
The idea is when player clicks once on one of them he choose the object he wants to create, and then he clicks again to place it wherever he wants to.
The problem is that everytime event create random object of that family

I`ve tried to use binding on creating object by UID, but i couldn`t figure out how it works
i use "pick nearest uid to mouse.x mouse.y" but how can i create the object i need?

The only solution I know - is to create separate events for every object type in family, but this is unefficient
Could you help me?

And another little thing how can I unite 4 and 5 events?

Thanks a lot for any help
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 3
Reputation: 362

Post » Sun Feb 15, 2015 9:36 am

The 'pick nearest to' is not necessary as you already have the Family1 object picked from the 'On left button clicked' event.

To combine events 4 and 5 use 'or'
join_events.png


For your main question, you can use a third party plugin called 'nickname' and so create objects by name. You could also combine your sprites into one sprite and have different animation frames on that one object instead of different object types. That way you could 'create' the objects based on animation frame number.
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Feb 15, 2015 9:47 am

Yeah, the plugin Nickname is incredibly useful. It let you pick/create sprites regarding their new "nickname" attibute, which can be the same on multiple sprites.

The simplest example of what it can do is spawning a specific object(s) from a family, which is absolutely impossible (as far as I know) with the standard Construct 2.
B
12
S
7
G
7
Posts: 448
Reputation: 4,272

Post » Mon Feb 16, 2015 1:36 am

codah thanks A LOT for sharing that pluging. Though it took some time to roughly understand how it works.
Here is my solution, may be it would help someone
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 3
Reputation: 362


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests