6bf85f30-2578-4227-841b-41a0007077df's Forum Posts

  • I moved it to the above section and it solves the problem BUT accidentally clicking the field (sprite) will wipe out whatever was there which is not the ideal situation as it could take 10 minutes in game for the crop/object to "grow".

    I'll leave this alone until I get some feedback so that I don't spam this post. Thanks for anyone's help!

  • Also tried this but nothing appears (guessing it keeps getting deleted?)

  • Good catch! I understand what you're saying as for the fix but am struggling to implement it.

    + Mouse: On Left button Clicked on Corn_Image2

    + System: Layer "CropSelection" is visible

    + PlacementLocation: Pick instance with UID SelectedLocationID

    -> PlacementLocation: Spawn CornPlant2 on layer "Crops" (image point 0) (create hierarchy: False)

    -> System: Set SelectedLocationID to -1

    ----+ PlacementLocation: Is overlapping CornCrops

    -----> (no actions)

    (in picture format)

    What am I doing wrong? I appreciate your help.

  • Hey Experts!

    I have three "fields" (sprites) that when you click on them, a menu appears with two images. When you click on one of the two images, a new object is placed. That works fine.

    The problem is, when I select A or B or C, only one field will change. If I click A, a crop shows up but when I click on B, the crop is deleted from A and is now in B. Same with C. Somewhere I'm missing the command/language to operate the fields separate, any suggestions??

    How would I do this?

    (here is what I have so far)

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Double left-click the object. Click the triangle shape in the yellow circle

  • Hey there! Both of those games require 8 add-ons. Have you checked whether they are each working or have any known issues?

  • Definitely has given me just about everything I needed.

    What I'm missing is the "ItemList". In the example you provided, it puts numbers into the "placementLocation" box depending on the number touched/clicked on. I'm trying to put a sprite into one of those boxes but each time I try, it goes to the first box, not the second or third one I click on. It's like there should be some array or something.

  • You can do something like this:

    > Mouse on Button clicked
    Create Menu at (Button.x, Button.y+100)
    

    If your menu is complex and consists of multiple objects, it may be easier to compose it manually on the layout (somewhere off-screen), and define hierarchy connections between all objects of the menu. Then when a button is clicked, set menu position to (Button.x, Button.y+100) and it will move there with all its child objects.

    Your suggestion looks perfect and I'm checking into it now. Many thanks! Updates forthcoming.

  • This might be a little simplistic for what you are looking for but, you could just record the Uid of the field you are trying to plant when you click on it. Then you don't need to pass the x, y values. You can just use the pick by uid event. Check out this example. Hopefully it will give you a starting place.

    https://drive.google.com/file/d/1x-pSSSw9a3n-0XJOdTIMZDaZzoeXRPmk/view?usp=sharing

    Ok, so I am way further than I was before however here's where I am running into struggles.

    In the example you provided, the number selected replaces (destroys) any existing number on that spot through the imagelist sprite font. On the menu I have, there are two pictures corresponding to what will be created (corn or strawberry sprite). How would I write it so any sprite that is there (dirt, corn or strawberry) is replaced by what is selected?

  • This might be a little simplistic for what you are looking for but, you could just record the Uid of the field you are trying to plant when you click on it. Then you don't need to pass the x, y values. You can just use the pick by uid event. Check out this example. Hopefully it will give you a starting place.

    https://drive.google.com/file/d/1x-pSSSw9a3n-0XJOdTIMZDaZzoeXRPmk/view?usp=sharing

    Man, that is genius! I know it may look simple to you but to me, it's part of what put man on the moon.

    Going through it now to reverse engineer it and see how to implement it into my program. Will update accordingly.

    Thanks again for your time!

  • Hey again!

    Trying to get a little "fancier" and need to know how to make this happen. When I click on button (B1), it opens menu (A). From there, I select one of the two graphics which places an object (coding below).

    What I would like to do is setup a function so that when I click on B2 or B3 or B4, the object associated with that button (1, 2, 3, 4) is placed in there x,y coordinates. Below is what happens when I click one of the images and I hard-coded the x,y to test but I need it to be dynamic based on the button pressed.

    [CropSelectionMenu]

    ----+ Mouse: On Left button Clicked on CropSelectionBox

    -----> System: Toggle CropSelectionMenu

    ----+ System: Is CropSelectionMenu

    -----> System: Set layer "CropSelection" Visible

    // Need to position the new crop where the dirt plot "was". Also need a way to close out the crop selection menu.

    ----+ Mouse: On Left button Clicked on Corn_Image2

    -----> Dirt_Plot: Destroy

    -----> CornPlant2: Destroy

    -----> Strawberry: Destroy

    --------+ System: Is CropSelectionMenu

    ---------> System: Create object CornPlant2 on layer "Crops" at (132, 345), create hierarchy: False

    ---------> System: Set CropSelectionMenu to False

    ---------> System: Set layer "CropSelection" Invisible

    ----+ Mouse: On Left button Clicked on Strawberry_Image2

    -----> Dirt_Plot: Destroy

    -----> CornPlant2: Destroy

    -----> Strawberry: Destroy

    --------+ System: Is CropSelectionMenu

    ---------> System: Create object Strawberry on layer "Crops" at (132, 345), create hierarchy: False

    ---------> System: Set CropSelectionMenu to False

    ---------> System: Set layer "CropSelection" Invisible

    ----+ Mouse: On Left button Clicked on CropSelectionBox

    -----> System: Set layer "CropSelection" Invisible

    -----> System: Set MainMenuVisible to False

    Again, any help and/or guidance would be much appreciated, including links to other articles or vids (I've been looking into many so far but I could have missed a few).

    Tagged:

  • Hey Construct wizards!

    Apologies for the "amazing" graphics but I'm more focused on proof of concept before I spend much time/resources on graphics.

    Referencing the graphic, when I click on one of the buttons (B1-B4), I would like the menu "A" to open below the button pressed. Not sure how to set the x,y for a sprite to open.

    Thank you in advance for any help you can offer up!

  • I guess it's working for them now??

  • I think you would get a lot more help if you broke this down into portions that you needed help with rather than one large project.

    I would start watching as many tutorials as possible so that you know "what" to ask these folks as many of them are willing to help but only when you've done a lot of the legwork.

    Just a friendly suggestion from someone that has asked questions that got answered and those that didn't. The pattern is, do the work and ask when you get stuck on a step.

  • You do not have permission to view this post