dop2000's Forum Posts

  • Or change layer interactivity setting.

  • Try setting parallax to 0 in layer properties.

  • When any button is pressed, append it to a string variable. Then check if this string ends with a specific sequence of characters.

    + Keyboard: On any key pressed
     Set keySequence to keySequence& to Keyboard.StringFromKeyCode(Keyboard.LastKeyCode)
    
    
    	if right(keySequence, 4)="1234" ... do something
    
    	if right(keySequence, 5)="IDDQD" ... do something else
    
  • Background1 needs to be above Background2. Or you'll need another copy of Background1 above Background2, on the same layer as the white mask.

    And the green ring needs to be a separate sprite.

  • Array.CurX/CurY expressions only work inside of "Array for each element" loop. You probably need to use X:player.playerX, Y:player.playerY in "Set at XYZ action".

    Local storage simple implementation:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • how I can make the player's direction value loop from 0 to 3

    You mean after 3 it should become 0 again? You can do this in one expression:

    Set direction to (direction+1)%4
    

    or

    Set direction to (direction=3 ? 0 : (direction+1))
    
  • Pathfinding behavior only works inside the layout bounds, so you need to make the layout bigger. There are a few other issues as well:

  • No worries! Glad everything is working!

  • No, that's not possible as far as I know.

    The most common solution is to change scaling mode to "Scale outer" and make the UI adjustable (say, using Anchor behavior).

  • My other question here is do I need to create a text object for every separate line? And how do I make it so you can scroll through entries that go off the page?

    Here is a simplified explanation:

    1. Iterate the records in the array. Since they are stored on Y axis, you will need to use a system loop:

    System for "y" from 0 to Array.Height-1
    Array compare value at (2,loopindex)="delivered"
    

    2. For each chat message create a new Text object. Set its text to Array.at(1,loopindex)

    3. Resize the text object to its content - use Text.TextHeight expression

    4. Place each new text below the previous text.

    5. Attach all texts to a scrollable panel.

    6. Use a mask or blend modes to hide the top and bottom portions of the chat when scrolling.

    This will be difficult to make from scratch without any Construct knowledge. Here are some example projects which may be useful:

    howtoconstructdemos.com/scrolling-a-list-of-players-scores-images-etc-example-a-capx

    howtoconstructdemos.com/auto-resizing-speech-bubble-for-dialog-systems-capx

  • You need a second JSON object, say tempJSON.

    How you combine two jsons depends on their content.

    For example, your main json contains books and the second json contains colors. Then you can do this:

    -> tempJSON: Parse JSON string AJAX.LastData
    -> booksJSON: Set "colors" to new object
    -> booksJSON: Set "colors" to JSON tempJSON.GetAsCompactString("colors")
    

    The last action is "Set JSON".

    If both jsons are arrays, then you might need to iterate tempJSON and copy array elements one by one.

  • You have two player instances on the layout, this can cause all sorts of bugs.

    I suggest using the debugger (Shift+F4), it's absolutely essential in a complex game like this.

  • Btw did you make a tutorial where you explain the process of the code for the new template like you did for the original demo?

    I didn't make that video. It was recorded by Bart Alluyn.

    If you have any questions or issues with my template, you can email me directly.

  • You need to request the file with AJAX and load it into the array first. See events 2-3 in this example:

    https://editor.construct.net/#open=languages-from-json
    

    I suggest studying some lessons and tutorials. There are also plenty of built-in examples in Constuct editor.

  • I would probably use an array or JSON:

    {
     "chat_Jamie": [
     { "sender": "User", "message": "Hey, did you finish the show last night?", "status": "delivered" },
     { "sender": "Jamie", "message": "Yeah, I stayed up way too late for it. Totally worth it, though.", "status": "delivered" },
     { "sender": "User", "message": "Right? That twist at the end?! I didn’t see it coming.", "status": "delivered" },
     { "sender": "Jamie", "message": "Same! I had to pause just to process it. Like, WHAT?", "status": "delivered" },
     { "sender": "User", "message": "I was yelling at my screen. My neighbors probably think I’m nuts.", "status": "delivered" },
     { "sender": "Jamie", "message": "Honestly, they’re probably used to it by now.", "status": "delivered" },
     { "sender": "User", "message": "Wow, okay, rude.", "status": "delivered" },
     { "sender": "Jamie", "message": "😂 You set yourself up for that one.", "status": "" },
     { "sender": "User", "message": "Fair. So... binge the next season this weekend?", "status": "" },
     { "sender": "Jamie", "message": "Obviously. Snacks are on you, though.", "status": "" }
     ]
    }
    

    (Example generated by chatGPT)

    Multiple chats could be stored as sheets within one array, or as multiple array/JSON files.

    When the player enters a chat, immediately display all messages with "delivered" status. Then allow the player to send their next unsent message, wait a few seconds, display the response, mark both new messages as delivered in the array.