How do I use "Pick by Comparison"?

0 favourites
  • 4 posts
From the Asset Store
See how your Logical Resolution looks on different devices
  • I've tried using pick by comparison in an id system, but im not able to use the parameters the way I've intended.

    Basically, what I am trying to do is make a system in which a spaceship has an id (eg: 0) and any other object with that same id (0) will set things like its target's position to that spaceship's id. The problem is that from what i can tell, the pick by comparison parameters do not reference instances besides the one to be picked as one of the parameters. This means the spaceship is not able to pick other objects with its id meaning the system does not work at all.

    If anybody knows if i am doing something wrong, do not need to use pick by comparison or if this is a known bug, PLEASE tell me.

    Thank You

  • You are correct, the pick by comparison does not choose instances. You can use the object conditions for comparison. For example if you are trying to set Object to the Spaceship position you can say Object (compare instance variable), Object.ID=Spaceship.ID, then on actions set Object position to Spaceship.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To be honest, I don't understand the question.

    You can pick each instance in a separate condition. Say, if you want to pick a ship, and then a gun belonging to that ship:

    Ship compare instance variable id=0
    Gun compare instance variable id=Ship.id
    

    Inside that event you will have both instances picked.

    "Pick by comparison" will work exactly the same in this situation.

    "Pick by comparison" condition is meant to be used in more complex cases. For example, when you need to pick all ships with high health and armor, you can do this:

    Pick Ship by comparison (Ship.HP+Ship.Armor)>100

  • Thank you for your help, i have been stuck on this for days. In case it might help i will send a screenshot of what the code should end up like if it helps.

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