dop2000's Forum Posts

  • Maybe two sprites on a layer that only become visible where they overlap?

    Yes, put both sprites - the one you want to reveal and the mask - on a separate layer, enable own textures and set a blend mode on the mask. See the Blend Modes example in the editor, it demonstrates all modes.

  • Strange thing number 2 is that even the example from Construct editor.construct.net is not working. It can unlock levels, but the clear button does not work until the project is reopened. I even tried to force restart the layout by pressing the button after clearing, but nothing changed.

    The layout is restarted already, but the array is not cleared. Simply add this action to the last event:

    -> System: Set gameFirstExec to True

    This will force reading the array from LocalStorage, and because the key is removed from LocalStorage, the array will be filled with default values.

  • That's not a script, that's Construct code in pseudocode. You can re-create it with events on the event sheet.

    You will need to use a family to allow picking two instances of molek independently in the same event, and then to check if they overlap each other.

    This event won't work because the same instance of molek can't be attached and not attached at the same time:

    Molek is attached
    Molek is NOT attached
    Molek overlapping Molek

    That's why we use families:

    Molek is attached
    MolekFamily is NOT attached
    Molek overlapping MolekFamily
    
  • even though the type is strictly set to "number"

    Textbox always stores text, no matter what type you set.

    To convert to numbers use int(Textbox.text) or float(Textbox.text)

  • What do you mean? Where what would go?

  • We do this in Moonstone Island.

    Our world is made up of individual islands (tilemaps) arranged on a 10x10 grid, so the JSON looks like this:

    {"island1_1":{objects}, "island1_2":{objects}, "island1_3":{objects}, ...}

    Based on the character's location in the world, we create the corresponding tilemap or multiple tilemaps and all their objects.

    1. Look at a small zone around the player (about 1000px in each direction). If an island in that zone doesn't exist yet, it gets created together with its objects.

    2. Check for islands that are far away from the player (more than 2400px). Those distant islands, and all objects on them, get destroyed.

    This way, only a few islands (usually 1-2) are loaded at any given time, depending on where the player is.

  • Feels like your array is storing string values instead of numbers. Or perhaps the size is wrong.

    Can you add an action "Array -> Download" and post the result, for both affected arrays?

  • On PC you are downloading the data in Base64 format, which is basically text.

    On Android you are sharing a binary file - i.e. not text. You need to convert the data to Base64 before sharing.

    You can try this:

    -> BinaryData: Set buffer to UTF-8 text Self.GetBase64
    -> Share: Add file Levelname&".txt" type "text/plain" from BinaryData
    
  • Here is an example of knight movement:

    dropbox.com/scl/fi/if73d7fsl1hfrxrkirp1m/Chess_example_knight.c3p

    You can create similar patterns for the other pieces. For pieces like rooks and bishops, you'll also need to use LOS to check for obstacles in their path.

    That should cover the basic movement rules, but you'll still need to handle the rest of the mechanics: capturing, castling, check and checkmate detection etc.

    And if you plan to add AI, the difficulty goes up dramatically. I don't think that's realistically achievable with pure events in C3.

  • My Dropbox keeps saying "can't load this file type" what do i do?

    Click "Download" button.

  • How do you want to mix the colors? If you just calculate an average between the two colors, eventually all children will be grey. Try asking ChatGPT, maybe it will give you some ideas.

    But you have lots of other serious problems with your code:

    1. You can't check if Blockers has LOS to Blockers and overlapping Blockers. There is no way to distinguish instances and it won't work correctly.

    2. Never use "trigger once" with multiple instances!

    3. Never use "wait" in events which can run on every tick.

    4. Don't put triggers (like "On created") in sub-events.

    Here is how you properly do this:

    dropbox.com/scl/fi/o41cpviriwnukb43jteaz/BlockersDemo.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think instead of checking which keys are presses, you need to compare the angle in which the character is moving. For example:

    Player is moving
    
    ..Player.8direction.MovingAngle is within 22.5 degrees of 0: Set "WalkRight" animation
    
    ..Else Player.8direction.MovingAngle is within 22.5 degrees of 45: Set "WalkRightDown" animation
    
    ..Else Player.8direction.MovingAngle is within 22.5 degrees of 90: Set "WalkDown" animation
    
    .. and so on
    
    
  • You can't snapshot it directly with Construct, but there may be another solution. Here is an answer by ChatGPT, I don't know if it works or not:

    chatgpt.com/s/t_68b5086322e48191a6a7b7be5f231e82

  • Characters are appended to the text one by one, but I'm skipping * and ^

  • It's difficult to pause the typewriter at exactly the right moment. As far as I know, there's no reliable way to detect the current typewriter position. And no way to tell it to skip parts of the text (the pause tag).

    You can split the text into multiple sub-strings, and type each sub-string separately. But there is another problem - the built-in typewriter clears the text if restarted..

    I would make my own typewriter, here is an example:

    dropbox.com/scl/fi/zf1tmjxl5deo6srrl4i3o/BBCode_Typewriter2.c3p

    I'd also suggest not using square brackets for tags, because Construct can mistake them for BBCode. I often use ^ symbol for breaks in the text.