danibishop's Recent Forum Activity

  • Ok. I just found it xD

    You must add a Regenerate Pathfinding obstacle map in your entity with Pathfinder Behavior to recalculate the available paths.

  • Hi guys!

    I don't know if this is weird or works as expected. I have a very, very, very simple scene of a Point and click prototype. It's a lateral camera (as in many games as Maniac Mansion or other graphic adventures), so I use a solid sprite for the wall and a normal sprite for the floor (to catch movement clicks). I also have a door, which I modeled as a solid sprite. I have added a Pathfinder Behavior to my player sprite.

    When the player beats the puzzle, this door dissapears. So I destroy the sprite. But the Pathfinder acts as if the wall was already there. I tried destroying, setting Solid to Disabled, setting collisions to Disabled and even moving the sprite to an irrelevant position... and nothing. I mean, the sprite is modifed: it is displaced or destroid (invisible, at least), but the blockage remains when I try to calculate a path through where the sprite was. There is always an "invisible wall" avoiding the path calculation.

    Is this normal and I am missing something as "refresh collisions" or something like that?

    Thanks in advance!

  • I solved it thanks to sub-events. I post this just to share my solution.

    The layout is this:

    [attachment=1:hbkgxuk4][/attachment:hbkgxuk4]

    And my events are:

    [attachment=0:hbkgxuk4][/attachment:hbkgxuk4]

    This way each button cycles on each click through 3 possible states: 0 (empty), 1 (triangle) and 2 (squarircle). Sybols are invisible initially.

    I have only one definition for button and nine instances of it (instead of nine definitions with nine names, button1, button2...). The same for the symbols. Inside each element (buttons and symbols) I define an instance variable: order. Sub-events manage the symbol switch thanks to this variable. Maybe I should group things and so, but it's ok for now.

    Finally, enter key (the yellow square) works as ramones suggested with sub-events and concatenation.

    Hope this helps other people and thanks both of you again!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Telyko: I have just done that and it works It's just that, as a programmer, it hurts me to repeat declarations instead of instances xD I can use this as a learning example, but I'd rather prefer another solution...

    ramones: ... as this! xD Yep. Exactly. I have just discovered sub-events. Thanks to both of you. In the first example from Telyko I understood 'sub-events' as additional conditions. Oh. I love being a n00b

    I'm sure that a mix of your answers is the correct answer for me, so thanks a lot for the effort and the explanations!

  • Telyko: I already set the variables inside the buttons with (Button.value+1)%3 I just wanted not to use independent variables for this, but instance variables. And, if I have 9 variables and only one object "Button", I can't tell which instance of the button is being pressed each time.

    ramones: The problem with that is that the "for each: ordered" (which I tried using UID as test) is an event structure, not an action, so it is not triggered by a button or any other event but it keeps running all the time (useful for update collections of entities inside the game loop, I suspect). If I could do this as a triggered event after a click, It would be perfect.

  • Thanks a lot, Telyko!

    This solution writes directly on the result each new value, but it is not exactly what I want. I can do something similar by using this method, but is not very practical if I have to change something in my code in the future.

    Your method appends new results as the buttons are pressed, I understand. I do not want to append on each button pressed: I need to have a 9 digit string each time the enter is pressed. This 9 digit string represents the state of the keyboard.

    With your solution, if i'm not wrong, if you continuously press one single button, RESULT will store something like 0120120120120120..., because it keeps appending on each push. I want to update just the instance variable of each object and collect them as a single 9 character string when the "enter" button is pressed.

    Thanks anyway! Fast answer

  • Hi, guys.

    I'm just starting with C2 Free Edition, just prototyping and evaluating the software. So maybe my question is pretty naive.

    I have a Layout representing a 3x3 keyboard. This layout loads many times in my proto, because there are keyboards of this kind in many layouts ("rooms"). Each key is a Sprite ("Button"), which has an instance variable called "value". When you press each button its value cycles from 0 to 2 and back to 0 (0, 1, 2, 0, 1, ...). Players can introduce visual codes in the keyboard this way.

    I have another button ('enter') to validate the entered code and I want to store it in a global as a single string, return to the original Layout and decide what to do, depending on the code entered. My problem is that I don't know how to generate, for example, a concatenated string from the nine independent values from each button. I want to store a combination like "012210022", with row after row, for example.

    It's like I need a "for-each" loop, but not as an event, but as an action, and I have no clue about how to do this.

    Any idea?

    Thanks a lot in advance.

danibishop's avatar

danibishop

Member since 17 Apr, 2014

None one is following danibishop yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies