Getting UID and placing object on top of it?

Get help using Construct 2

Post » Wed Feb 04, 2015 2:53 am

I'm making a simple dialogue box system for my game, but I'm not sure how to get the UID of the NPC and then set object's position to it. Any help?
B
18
S
6
G
4
Posts: 221
Reputation: 3,275

Post » Wed Feb 04, 2015 4:03 am

You need 'something' in the NPC to identify it, assuming there is more than one. Like if the NPC gets within X distance of something, or collides with something, or has a 'myIdValue' equal to 5, or whatever. Then you can get the UID of it, although you might not need to seeing you will then already have it picked.

dialog_to_object.capx
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 » Wed Feb 04, 2015 4:19 am

You could identify NPCs with an instance variable, e.g, NPC.which = "Mike"

You could also make the NPC share a container with its text object, in which case you might not even need to get the UID- just set each text object to be above the Y edge of an NPC, and it'll move the text for all NPCs.
B
11
S
4
Posts: 152
Reputation: 1,236


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, Pulstar and 9 guests