dop2000's Recent Forum Activity

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Is obj_item_potions_inventory a member of Inventory_Item family?

    You parent event (Mouse on clicked Inventory_Item) picks a family instance. But it doesn't pick obj_item_potions_inventory instance! Even if it's the same sprite, Construct treats them as different objects.

    So to fix this you need to pick obj_item_potions_inventory which was clicked. The easiest way to do this is to add this condition to sub-events (before comparing the animation name):

    obj_item_potions_inventory Pick by unique ID = Inventory_Item.UID
    
  • 1. DragAndDrop behavior ignores Solid. Physics is also not compatible with Solid.

    If you need physics object to collide with other physics objects while dragging, you need to move them with physics actions - apply force, velocity etc.

    Check out these examples:

    howtoconstructdemos.com/physics-puzzler-move-and-re-arrange-blocks-with-mouse-c3p

    howtoconstructdemos.com/physics-game-catch-apples-with-a-bucket-capx

    2. You can use Touch plugin, it has "On Object Tap" condition - it's a gesture which only triggers if the object is quickly touched/clicked without moving.

    Alternatively you can save the time and position of the click, and when the mouse button is released compare how much time has passed from the start of the click, and how far the object was moved. Say, if the time<0.3s and the distance<5px, then toggle the switch.

    3. This task may be pretty difficult. When the cabinet is closed, you can disable physics for all objects inside of it, and add them as children to the cabinet (using hierarchy). Then they will be moved with the parent.

    To arrange objects on shelves you probably need to define which objects can collide, using "Enable/Disable collisions" action.

  • Hm, I'm fairly sure I tried File Chooser years ago on mobile and it didn't work. Glad it's working now!

  • It's strange that the file dialog for the nw.js plugin doesn't work, right?

    NW.js is for desktop, it doesn't work on mobile.

    With Cordova plugin you have two options:

    1. Find someone who can make it into a C3 addon.

    2. Export your game as Cordova project and manually add the Cordova plugin using Cordova CLI, Android Studio or XCode. You will need to call plugin methods with Javascript, but this isn't very hard. For example, to open the file dialogue:

    fileChooser.open(successCallback, failureCallback);
    
  • Please post a screenshot of your code or the project file.

  • I should also specify that the points themselves shouldn't be in any specific order, just whichever is closest to Sprite 2 instance.

    You should've mentioned this from the beginning.

    The easiest solution would probably be attaching 4 invisible "Anchor" sprites to these image points - you can do this manually in layout editor, add them as children to the hierarchy.

    Then you can pick the nearest Anchor sprite and replace it with Sprite2:

    Sprite1 On collision with Sprite2
    Sprite1 Pick all children Anchor
    Anchor pick nearest to (Sprite2.x, Sprite2.y)
    ... Sprite2 set position to Anchor
    ... Sprite1 add child Sprite2
    ... Anchor destroy
    

    Alternatively, if you want to do this with image points, you will have to loop through all image points, check which ones are unoccupied, and which one is the nearest to Sprite1 - the code for this will be pretty complicated.

  • FileChooser doesn't work on mobile. You will probably need to install a third-party Cordova plugin, like this one. And the app will require permissions to access files and folders.

  • Yes, your event may look something like this:

    Origin image point has index 0. Image points 1-4 are for attaching instances of Sprite2.

  • There are a few options:

    1. Create an instance variable - AttachmentPoint=1. Use it to identify which image point to attach Sprite2 to, and increment it by +1

    2. If attaching with hierarchy you can simply check the number of children on the parent sprite.

    3. You can loop through all 4 image points and check if any of them is not overlapping Sprite2. Use "System Is overlapping point" condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 256 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
  • x5
    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