nagyv's Recent Forum Activity

  • There is no priority of tiles. You are free to move to both tiles.

    I've been googleing around to figure out how to read the color from the canvas. As it seems that Construct3 uses webgl2 type canvas, this is to work: stackoverflow.com/questions/44070167/get-color-at-position-webgl

    Unfortunately, it does not.

    I've figured out that Touch.X and Touch.Y will give me the correct positions, but still no luck.

    in the preview console I've been trying the following, but in the end I did not get the expected results:

    ```

    var a = $("mycanvas") // I don't know where $ come from, but it's defined :)

    var b = a.getContext("webgl2")

    var pixels = new Uint8Array(4)

    b.readPixels(318, 498, 1, 1, b.RGBA, b.UNSIGNED_BYTE, pixels)

    ```

    This should set pixels to the rgba values I need, but it's not set. :(

    Any ideas how to read the color from the canvas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • this won't work for me unfortunately as there is no priority between to white or green, it was just as an example to show my problem.

    Looking at the whole field I have, I have many overlapping sprites, and there is no priority between them (imagine a chess board with non-square fields).

    Is there a way I can detect the color below the touch point? I could try to figure out from that the sprite that I'm interested in. (I have 6 different colors, I know their RGB codes.)

  • I've slightly modified to event sheet to get everything logged properly.

    The logs show that both fields are selected. (There is a Field found message for both ids.) But the "Moving to position" message is called only by the "1st" field. Similarly, my `Move` function is called only once with the "1st" field's data.

    For some reason the image of my modified event sheet did not upload. You can find it here: dropbox.com/s/a8ykgu95ho31rro/Screenshot_2019-03-06%20Construct%203%20r136%20%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%85.png

  • Hi,

    this image shows a part of my game. Here the yellow stone can be moved to the highlighted green or white fields.

    Unfortunately, if I click the bottom-left part of the green field, a simple Touch condition as shown below selects both fields, and the Move function is called with the parameters of the white field, not the green.

    How can I make sure that the correct field intercepts the touch event?

    Tagged:

  • Here is an even simpler event sheet to demonstrate the issue:

    The log shows:

    <button clicked>

    At start 0

    Spawned 1

    pawn once 0

    <button clicked>

    At start 1

    Spawned 2

    pawn once 2

    <button clicked>

    At start 1

    Spawned 2

    pawn once 2

  • Hi,

    you should use a backend service to store and retrieve your leaderboard data. You can write such a service yourself or use services like GameSparks or PlayFab. Your question basically does not have much to do with Construct.

    From your question, it seems to me that you are a novice developer. For this reason, I would recommend learning Construct first. Once you understand what it is for and how to use it, then you'll have a chance of making the integration with backend services you are looking for.

  • I would like to create and position a few objects. Here is my event sheet:

    The story starts with the button. When clicked it logs the number of Pawns. At first, this should be 0.

    Then I spawn many Pawns and log the number of Pawns in each loop. This should increase at each loop. At the same condition, I call my move function and log the number of pawns there too. I would expect to log the same number that I logged just after having spawned the pawns. But it logs 0.

    As there are no Pawns, clearly my SetPawnPosition function won't find the Pawn with the given `idx` even though it was spawned and set up a second before the move call.

    Still, when I click the button for a second time, the correct number of pawns is shown, and the counter does not reset, even though I call Pawns.destroy for every pawn in the first line of "Setup"

    pawn count 0

    pawn sub 1

    pawn move 0

    pawn sub 2

    pawn move 0

    ...

    pawn sub33

    pawn move 0

    pawn sub34

    pawn move 0

    pawn count 34

    pawn sub 35

    pawn move 35

    pawn sub 36

    pawn move 36

    Is this a bug or I screw up something?

    Tagged:

  • There is System -> togggle boolean action, but it does not support values coming from other variables or expressions

    There is System -> set value action, but inside a group it does not list the global boolean variables. Thus I can't use it to set a value.

    How can I set a value of a boolean global variable from an expression?

    e.g. variable: isMultiGlobal = isMultiLocal

    Tagged:

  • Thanks Ashley!

    Could you post here, when the docs are out?

    Or is it expected to be shipped together with the next/a release?

  • I've tried to figure it out, but without much luck.

    This is what I see until now.

    I can easily register a script to be run on the main thread. This script is properly concatenated at the end of the exported c3runtime.js.

    From github.com/el3um4s/construct-html-element-plugin, I've figured out that it's probably a wise choice to extend my DOM-side script from DOMHandler. Unfortunately, DOMHandler is undocumented

    Moreover, I've found a C3.SDKDOMPluginBase in the exported c3runtime. This is again undocumented.

    Finally, I've tried to simply send a message from C3 runtime to the DOM. This message sending fails as it's looking for this._domComponentId what is an empty array in my case, and can't figure out from the minified code where should it be populated.

    Is there any possibility to get access to the unminified C3 code to figure out how these scripts should work?

    Or is there an ETA for the documentation to be published?

  • I've read the relevant docs. Found the APIs at the instance side, but how does the other side look like? Where and how is PostToRuntimeAsync (and probably PostToRuntime) documented?

  • Sorry, it was my error. Dash ("-") is not allowed in the app id.

nagyv's avatar

nagyv

Member since 26 Jan, 2019

Twitter
nagyv has 1 followers

Connect with nagyv

Trophy Case

  • 5-Year Club
  • Email Verified

Progress

6/44
How to earn trophies