dop2000's Recent Forum Activity

  • No worries!

    Gamepad stick returns two values from -100 to +100, for horizontal and vertical axes.

    angle(0, 0, axisX, axisY) will give you the angle of the stick

    distance(0, 0, axisX, axisY) will give you the distance - how far it is from the center.

    Using these values you can move your cursor.

  • I noticed that some buttons were incorrectly configured in your project - check all IDs and connections.

    Also, like I said, when a button is pressed, you need to pick the valid PS instance, which is on a base connected to the button. Not sure if picking by distance will always work.

    If there are other problems, I highly recommend using Debug View and console logging for troubleshooting.

  • You can combine all objects into a hierarchy, and then move them all with a single action.

  • After you re-enable the behavior (or immediately before disabling it), set its vector X and Y to 0.

  • Here you go:

    dropbox.com/scl/fi/ll81tlpy14kxmaqcn43qn/GamepadAim.c3p

    See events #9 and #10

  • There are two problems with events 9-12 in your project: they run on every tick, and they don't update unoccupied bases. That's why I suggested using debug mode - you could've spotted this sooner.

    When you have "PS Overlapping Base ... Else ...", "Else" condition in this case doesn't mean "all instances that are not overlapping". It means "if the previous condition did not pick anything". So as long as PS is overlapping at least one base, the Else condition won't work.

    Ideally you need to update bases once only after the object has arrived.

    You also need to pick the right PS instance. Picking the nearest is not always correct. When a button is clicked, pick the bases connected to it, and then pick PS instance overlapping these bases.

  • You can run the game in debug mode and check if the occupied variable is set correctly.

  • however, they do not return to the previous base when I click the same button.

    Maybe you are not clearing the occupied status of the base?

    Maybe this is the solution, but how do you specify which bases are connected to the buttons in the code?

    There are several ways. Since every button is connected to one or two bases, you can define two instance variables: connectionA, connectionB. Manually configure them for every button. When a button is clicked, pick bases with ID=Button.connectionA or ID=Button.connectionB

    But the solution with the overlapping paths is probably easier.

  • First, you need to move "Base is not occupied" condition above "Pick nearest". But that won't fix the problem completely, because the nearest base will not always be the correct one. For example here the nearest unoccupied base for blue sprite is the one with the green circle:

    You need to pick only the bases which are connected to this button. You can use the Path sprite if you extend it slightly so that it overlaps Base sprites.

    Button is overlapping Path
    Path is overlapping Base
    Base is NOT occupied
    Pick nearest Base
    

    Or you can give unique IDs to each base and specify on the button which bases it's connected to.

  • I use the current layer numbers to spawn objects in event sheets, so they will be on the wrong layer if I dont manually change all of them

    That's why you should always name your layers properly and use layer names (not numbers) in all events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to configure templates.

    And then create object Text_tx with the desired template name:

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 249 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x4
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies