dop2000's Forum Posts

  • You can use Line of Sight behavior to check when the object is in sight or near another object. If you want "E" key to work only when the character is near the door, create an event with two conditions:

    Keyboard on E pressed
    Player has LineOfSight to door
    

    It's also possible to use overlapping or collision checks, for example "Overlapping at offset".

    I suggest studying example projects and games included in Construct.

  • Maybe the player's collision mask is too big? Or there's some other solid object in that spot.

    I see you have playerControl sprite - run the game in debug view and check that too.

  • Trigger Once is one of the most misunderstood features in Construct and many people are using it incorrectly, which often causes serious bugs. My advice - don't use it unless you are 100% sure what it does and how it works.

    It's hard to tell by your screenshot why the code doesn't work. What exactly are you trying to achieve?

    If you want to add 1 utensil to each farci_input, it's much easier to do this manually in the layout editor. Add utensil sprite as a child to farsi_input, configure Orbit behavior and it will rotate around the parent.

  • You mean like a jump? You can use "Set vector Y" action of Platform behavior. Set it to something like -200 to jump up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    Beta7 So you are saying you found a much better solution. Show it to us please.

  • Did you see the official multiplayer examples?

    There are also tutorials:

    construct.net/en/tutorials/search

  • Yeah, you are right, something weird is going on.

  • I tried your project and can't reproduce this bug.

    Check the spritefont object in debug mode when it's blank - see if it has correct size, scale, opacity settings and if it contains any text. Also see if there are any error messages in browser console.

    Sorting without array

    This example uses instance variables, which I was suggesting from the beginning. OP wanted to sort global variables.

  • See "collision checks" in the debugger. Over 1000 checks/tick could cause performance problems.

    Also check the CPU Profiler tab to see which events are using CPU the most.

    And of course there are too many objects. If many of them have enabled behaviors (like Bullet, Sine etc.), this is also very bad for performance.

  • You need to parse AJAX response into JSON object. Then you will be able to extract keys from JSON using JSON.get expression. For example, JSON.get("0.class") should return "warrior"

    See the official JSON example in Construct.

    editor.construct.net

    Also here is a tool I made that shows paths to all elements in JSON:

    dropbox.com/scl/fi/3lvdqp1x1v57xy0prahrj/JSON-RecursiveRead.c3p

    I already found another method waaayy apart from what you were telling me before I found the perfect code to sort any car rank points in my game

    Please enlighten us about your method of sorting scores in global variables. Even for experienced developers it's never too late to learn!

  • "On click" is a trigger, it can't be inverted. You can use two conditions:

    Mouse Cursor over object + Mouse left button is down -> Set frame 1

    Else -> Set frame 2

  • You can use replace() expression.

    Set text to replace(string, "Martha", "[color=#ff0000]Martha[/color]")

  • If you don't want to use an array or JSON, you can use a bunch of variables.

    You will have to add events for crafting each item. For example, to craft a table, first check if wood>=4, subtract 4 from wood variable, add 1 to table variable.

    But with more items this system will quickly become unmanageable. I strongly suggest learning arrays or JSON.