dop2000's Forum Posts

  • You do not have permission to view this post

  • Is the background in the canvas transparent? If it is, then you can use this script. If the background is white (opaque), you need to erase the background first, or perhaps modify the script.

  • Dan Blast I see your text contains lots of "^" characters. Do you want to replace them with line breaks? That's what I usually do in my projects:

    MyText Set text to replace(Dialog_Greeting, "^", newline)

    Or you can re-write the contents of the variable:

    Set Dialog_Greeting to replace(Dialog_Greeting, "^", newline)

  • That data is in JSON format. You need to parse it into JSON object, then you will be able to extract the values.

    JSON parse AJAX.LastData
    Set variable to JSON.get("score_table.id")
    

    Notice that "id" is a number, but other values are strings, for example "position_y":"0". You will need to convert them to numbers using int() expression.

    Set var to int(JSON.get("score_table.position_y"))

  • You do not have permission to view this post

  • 1. it already works

    2. Add Line of Sight behavior.

    On Space pressed
    Player has LOS to tree : Tree destroy
    
  • You need to upload the script to Scripts folder. And this is how to use it:

    But this particular JS script requires transparent background. If you have black images on white background, it won't work. You might need to look for another library.

    Also, I believe the resulting PolygonArray needs some tweaking before you can load it into a sprite.

  • Look at events #16-18 on your screenshot. They are nested inside of event #15. You need to move them to the same level as events #14 and #15.

  • Can you stop posting the same two questions again and again?

    Your character already switches to idle animation. And if you want an answer to the second question, you need to explain it better.

  • You will still need to analyze the pixels to build the shape outline. Writing your own algorithm for that will be very difficult. It's a lot easier to use the script.

  • Here is a snippet from my template that converts color value from hex to r/g/b:

    Local number col‎ = 0
    
    + System: code = "hex"
    -> System: Set col to Browser.ExecJS("parseInt('0x" & ColorInput.Text & "', 16);")
    -> System: Set col to clamp(col, 0, 16777215)
    -> System: Set r to int(col÷65536)
    -> System: Set g to (int(col÷256)%256)
    -> System: Set b to (col%256)
    -> Sprite: Set color to rgbEx255(r,g,b)
    
    
  • This is possible, but not an easy task. You'll need some script that will analyze the shape of the image and will build a collision polygon for it. Then you'll need the Polygon addon to load that polygon into a sprite.

    If the images are something simple, like Tetris shapes, there may be easier ways to do this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The way you are using timers is a bit unusual. The main purpose of the Timer behavior is to replace the "wait" action. Starting a timer and then using a "wait" action right after defeats its purpose. Instead, you should use the "On Timer" trigger.

    As I mentioned in my previous comment, avoid running too many events on every tick, especially loops. Use triggers, functions, sub-events. This will make your code more predictable and easier to understand.