On Collision with Specific Instance

  • 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.

  • I saw this suggestion

    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

    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.

    <img src="http://dl.dropbox.com/u/1605506/Bob.jpg" border="0" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Got it. Just need to use "Compare instance variable" not "Pick by Unique ID"

    <img src="http://dl.dropbox.com/u/1605506/Variable.jpg" border="0" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)