tarek2's Forum Posts

  • Like this:

  • Really appreciate your patience (I'm used to more traditional programming and I guess I haven't fully grasped events yet).

    Anyway, I think I added the check for the ObjectTypeName correctly (see image):

    But, where the heck does the Else go? I can't even find an else statement in the events sheet.

    On family Clicked:
    Pick Top Instance:
    ---Subevent: System Compare: Family.ObjectTypeName = Obstacle:----> Create Turn
    ---Subevent: Else: Rotate 90
    

    This "-----" below means a subevent.

  • I feel very dumb and I'm not sure what I'm doing wrong now.

    No worries there are no dumb questions, especially when you are new to Construct. Ask any questions you need.

    You need to put the obstacle in the family swell and then make just 1 one click event then you can compare which object it is and do your actions accordingly:

    Example:

    On family Clicked:
    Pick Top Instance:
    -----System Compare: Family.ObjectTypeName = Obstacle:----> Create Turn
    -----Else: Rotate 90
    
  • Families seems like the best solution, but I must be doing something wrong.

    I created a family called towers and put all my tower objects into it.

    This is my event:

    But now, when I click on it, every instance of "Turn" is rotating, not just the one I clicked on.

    Any idea, what I am doing wrong?

    You are applying the Action to the "Turn" object instead of the one that you pick in the Towers family, that's why it applies the action to all the Turn objects because there was none picked on the conditions therefore it applies the action to all instances of Turn.

    Select the "Towers" family instead to apply the rotate action

  • One issue that I find very annoying with the video player is that you cannot set a thumbnail from the video frames itself, so the video will be invisible until you start playing it. This forces you to create a separate image to use as an icon otherwise the user will not see that there is a video to play.

    I tried to do a video gallery a few times and ended up having to create an icon image for each video which is time-consuming and uses extra Memory RAM.

    It would be nice if they could add to the video plugin the option to set a Thumbnail from a video frame by setting a specific time in the video timeline.

    Here is one example of the issue:

    https://www.dropbox.com/scl/fi/ou2ri5oemt6qh40evv5p5/Video-Player.c3p?rlkey=ut5oi4g0ynj6tvhnzkqh4s6b7&dl=0

    If you Run the project you dont notice that there are two videos to play unless you set "Autoplay to yes" which is not ideal having all your videos playing at the start.

    or

    Alternatively, you need to add thumbnail images to see that there are two videos to play.

  • Hi

    I haven't used the Rexrainbow Matcher addon but in general, you can add new lines in construct by using the expression:

    newline

    If you want to add it after a string text then you add the &

    Example:

    "X" & newline & "Y"
    

    The results will be:

    X

    Y

  • 1-You could add a second condition is visible:

    On touched object

    Object isVisible

    2-You can set the other layer interactive to false if the objects are on different layers

    3-If Both objects are on the same object type you could use system "Pick top instance"

    4-You could put them in a family and filter them

  • Sorry, I forgot to remove a local variable that is not needed, as originally I was gonna put everything under "on Tile clicked" by using Local Variables but after I switched to functions and I forgot to remove that variable.

    I updated my last link.

  • Yes, thank you very much, this is exactly what I needed! +100 to karma ))

    Np

    Glad it was helpful ))

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is one way of doing it:

    https://www.dropbox.com/scl/fi/r2ozshdnt2r4z1azd9wtc/Light-Up-Akari2.c3p?rlkey=gvjci0nhgzz211px3hkkeqarz&dl=0

    I hope I didn't miss any edge cases, as normally you need more time to think about all possibilities, though it seems to work fine for me.

  • Yes, it's not such an easy task (to count the light, I made a variable for the family and if the light intersects with each other, but there are no lanterns, but the removal is simple, but if the light falls on someone else's lantern, that's the whole problem

    Yep, I get the whole picture now. I thought it just needed to set the bulbs to red as I never played this game.

    Bu is ok I have some ideas.

    Nice puzzle to solve :)

  • probably the main problem remains the moment when, in case of an error (two bulbs shine at each other), I remove one, and with it the light that should have remained from the first bulb disappears.

    Hoh wait, you want to also remove the lights?

    That complicates quite a lot the logic

    Your first request of just setting the error lights to red is easy but removing the lights feature needs more thinking as it can get very complicated because it could be multiple sources reflecting the same tiles so you have to keep track of how many tiles are reflecting each bulb lol.

    This is gonna be a good brain cracker.

  • Yes, that's right

    I will have a look

  • > Here is an example:

    >

    > https://www.dropbox.com/scl/fi/3m29s7pco3rfd9bzguvyh/Coloring-Cells1.c3p?rlkey=8eu6iyqnivvw8qh8eoqm9fszz&dl=0

    Good afternoon, I am very ashamed that I have to write again in the hope of getting help, but...

    I'm trying to implement the mechanics of the Japanese Akari puzzle (Light Up), but I'm stuck. If you have the time/opportunity/desire to help again, I would be very grateful. I managed to add: installing another flashlight and saving the light when deleted, but I can't implement: install a marker, install another flashlight on the cage with the light (so that they would be highlighted as an error). You can get acquainted with the implemented game here: https://www.puzzle-light-up.com/ . and here is a link to the source code that I tried to make based on yours https://www.dropbox.com/scl/fi/ufvyr01ii4k28t3l2xcxm/Akari.c3p?rlkey=586oy8z3q98fklcfwjo1junfw&st=o6i6md41&dl=0

    Anyway, thanks for the help you've already provided.

    I'm not familiar with this game, so not sure if I understood your question correctly:

    After I tested the game from your link it seems that you are referring to the Red Error light bulbs?

    Example:

    It looks like when you put another bulb in a tile that is lighted up it will mark all the light bulbs that are on the same (Row & Column) in red as an error.

    Is that what you are referring to?

  • There are different ways to do it, you just need to keep testing and see which one you like the most.

    Here some ideas:

    1-Create on the editor a Popup Panel and add all the tower animation frames available to the panel and place them in the right positions.
    
    2-Add also a Button to Close the panel
    
    3-(Create a Hierarchy between the frames + Close Button) and the Panel and make the panel as parent. And then on the "Tower frame Hierarchy settings", you need to tick:
    Transform (X & Y)
    Transform (Width & Height)
    
    Do the same for the close button
    
    
    4-Add to the panel the tween behaviour
    
    5-Add a Global variable "UID"
    
    6-On Tile clicked: 
    --------- Set "UID" to Tile.UID
    --------- Set the panel scale to 0
    --------- Set the panel XY in the middle of the screen or in the position that you like to appear on the screen
    --------- Panel start Tween size to scale back to its original size
    
    7-On Tower animation frame clicked:
    ---------- Pick Tile by UID and enter the Global variable "UID"
    --------------- Tile Spawn Tower 
    --------------- Tower set animation to "Tower animation frame" that you clicked or use a variable to know which tower you need to spawn
    
    
    
    8-On button Close Touched: ------- Panel tween Scale again to 0 to close it and hide it when the tween finishes
    

    That's the basics you need to get started.