On Collision with Specific Instance

Get help using Construct 2

Post » Mon Mar 12, 2012 10:00 pm

I've read through the "picking" and "dialogue" FAQs, as well as the Conditions wiki... but I still am not sure what to do.

Problem: I'm giving each npc custom dialogue

So, I'd like to be able to set something like:

Player OnCollision with NPC.Instance1...

Or even with distance

distance(Player.X,Player.Y,NPC_Instance1.X,NPC_Instance1.Y)

But I can't see an easy way set/call an NPC instance. I've currently got the instance variable set to "text" where I give each NPC a unique name.

I'm going to keep playing around, but I thought I'd ask while I was busy stumbling around. breravin2012-03-12 22:29:01
B
7
Posts: 24
Reputation: 785

Post » Mon Mar 12, 2012 10:33 pm

I saw this suggestion

[QUOTE=Kyatric] Condition
Target object - pick by Unique ID

If the object you are trying to reach is a Sprite named "lol"
=>
lol - Pick by Unique ID[/QUOTE]

But when I attempt to pick by the Instance text name (eg Bob) I get the error "This is not a system expression or variable name in this scope"

Edit: Ok, I think I have picking the instance by name working, but now I don't know what to do with it.

breravin2012-03-12 22:48:51
B
7
Posts: 24
Reputation: 785

Post » Mon Mar 12, 2012 11:04 pm

Got it. Just need to use "Compare instance variable" not "Pick by Unique ID"

breravin2012-03-12 23:04:43
B
7
Posts: 24
Reputation: 785


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], HugeCube, imnotspecial, tomi71, totoe and 19 guests