How do my character choose different objects?

0 favourites
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Guys, I'm having lots of problems with this game.

    When there are more than 2 operators on the map they must choose different minerals and destroy their mineral but there's the problem that they go at different minerals but destroy the same in a different position

    This is an image for the code

    This is an example of the problem

    can anyone help me?

  • When you haven't picked the instance then it will pick all. Looks like you are picking one object with conditions then applying it to a different unrelated object with the action. When you want to pick a specific instance of an object to destroy you need to pick it in some way. When you pick the green thing then apply actions to the mineral they aren't related.

  • When you haven't picked the instance then it will pick all. Looks like you are picking one object with conditions then applying it to a different unrelated object with the action. When you want to pick a specific instance of an object to destroy you need to pick it in some way. When you pick the green thing then apply actions to the mineral they aren't related.

    They are in a container. The problem is that I want that the action of set width happens only at the bar near the character but for each character

  • Shouldnt your width condition be pick nearest mineral to character, why is it picking the nearest to itself? Either way you would add a 'for each' character.

  • Shouldnt your width condition be pick nearest mineral to character, why is it picking the nearest to itself? Either way you would add a 'for each' character.

    Done it but it doesn't work

  • When I make set width of the bar, I want that only the bar that is near to the player increase not all the bars. They must have a different progress

  • Should work :) try picking the bar on the left instead of the mineral anyway since you are essentially finding the nearest bar, but if they are in a container it should still work.

  • Should work :) try picking the bar on the left instead of the mineral anyway since you are essentially finding the nearest bar, but if they are in a container it should still work.

    now all the bars increase in the same moment

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • please share the events and the outcome (game window showing the problem)

  • please share the events and the outcome (game window showing the problem)

    image of code

    when the second character starts mining the first restart mining because the second restart the timer. I don't know how to separate the timer for each character

  • Okay, you said the problem was with the width event. The timer issue is because you don't pick an instance again in the timer function, so it picks all of them. You need to specify which instance you want to restart the timer, possibly by picking one the player is overlapping or again nearest to.

  • Okay, you said the problem was with the width event. The timer issue is because you don't pick an instance again in the timer function, so it picks all of them. You need to specify which instance you want to restart the timer, possibly by picking one the player is overlapping or again nearest to.

    I made it but now only the first operator mines. The second arrives and stop

  • You need to also specify the operator. Since you run the timer from a pathfinding condition you can send the operator UID through the function as a parameter. Then within the function you can say 'pick operator where UID = param'.

  • You need to also specify the operator. Since you run the timer from a pathfinding condition you can send the operator UID through the function as a parameter. Then within the function you can say 'pick operator where UID = param'.

    I done it in this way but seems to not work

    UPDATE:

    Probably I solved it by doing this

  • Which bit? Looks like it should work. The width thing is separate but should also work but there may be bugs.

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