ZeldaVerde's Forum Posts

  • Thanks for the reply again Ashley. Yes, I was expecting construct to overwrite the js files and I had no idea I could just delete them from the project and have it compile them somewhere hidden. I was messing with the new built-in editor and trying to edit ts from construct, but I mainly use vs code and now can't figure out how to configure it to work with vs code handling the ts again.

  • My project is really minimal since I've just created it. Here it goes:

    drive.google.com/file/d/1b-xocb2KfHf4UnULT8djQ7MeogYRCdWQ/view

    I'm pretty sure the code is alright, and I'm so sorry for wasting your time if the problem is as simple as such an oversight from me.

  • Thank you for the response Ashley, but it did not work.

    To be clear, I am able to preview other projects.

  • I've just created a new project and realized construct has a couple new options when right clicking the scripts folder, related to typescript. I suspect I'm misunderstanding them, because my main script will fail no matter what. I'm trying to use typescript, edited thru vs code (as I've been doing for a while). I'm getting this on the console:

    Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR

    sw.js:617 [SW-Preview] Up to date

    bootPreview.js:105 Registered service worker on preview.construct.net

    domSide.js:1 Error loading project main script: Error: main script did not run to completion

    at r._InitDOM (domSide.js:1:12370)

    at async r._Init (domSide.js:1:8594)

    _InitDOM domSide.js:1

    webgpuRenderer.js:1 The powerPreference option is currently ignored when calling requestAdapter() on Windows. See crbug.com/369219127

    Tagged:

  • I couldn't find how to get/set tilemap as/from json thru script, does anyone know how? I feel like either tilemap is missing some scripting features or the tilemap scripting documentation is missing some features. I also couldn't find how to use brushes, if that is possible.

    Tagged:

  • So, I may be dumb (and that's why I figured I should post this here before filling out an issue report on github), but here goes a compilation of minor "issues", so to speak, I've been having with scripting:

    1. <IWorldInstance>.setAnimation("") is not recognized by the typescript definitions, and I therefore have to write (<IWorldInstance> as any).setAnimation("") for it to work.

    2. I could not find any documentation on accessing image points thru javascript/typescript. <IWorldInstance>.getImagePointX(<name or index>) won't compile because TS thinks it doesn't exist, but then again (<IWorldInstance> as any).getImagePointX(<name or index>) works fine. If anything, I think <IWorldInstance>.getPosition() should probably support image points as arguments.

    3. I could not find any documentation on using tilemap brushes thru script.

    Please tell me for which of those I'm just being dumb, for which I should file a bug report, and for which I should file a feature request.

    Thanks!

    Edit:

    Ok, I've just discovered that:

    1. setAnimation() and getImagepointX() are from the ISpriteInstance type.

    2. the method getImagePoint() gets both axis.

    Sorry for that

  • Oh ye that makes sense. I've just filed a bug report then. Hope you can fix it, and thank you as always.

  • Alright, thanks for the clarification Ashley!

  • Oh ok I will, I thought it might be a simple fix on my end so that's why I didn't.

  • I'm trying to create an object from a family by it's name:

    const newObject = runtime.objects["name"].createinstance(<parameters>);

    This works, but I wanted to do so using a name stored in a variable:

    let objName = "name";

    const newObject = runtime.objects[objName].createinstance(<parameters>);

    TypeScript won't let me do this because it is afraid "objName" won't be a valid value.

    How should I go about this then?

    Thanks in advance.

    edit:

    this works, but I'm not sure how good of a solution it is:

    let objName = "name";

    const newObject = (runtime.objects as any)[objName].createinstance(<parameters>);

  • Every time I make any changes on my scripts and hit preview, it crashes. After restarting, it all works with the new change until I make a new change and hit preview again. Please help!

    Here is the crash log:

    Error report information

    Type: unhandled rejection

    Reason: Error: Cannot read properties of null (reading 'setValue') TypeError: Cannot read properties of null (reading 'setValue') at t.Iy (https://editor.construct.net/r427/projectResources.js:1:238684)

    Stack: TypeError: Cannot read properties of null (reading 'setValue') at t.Iy (https://editor.construct.net/r427/projectResources.js:1:238684)

    Construct version: r427

    URL: editor.construct.net/r427

    Date: Tue Feb 18 2025 16:17:35 GMT-0300 (Brasilia Standard Time)

    Uptime: 1109.9 s

    Platform information

    Product: Construct 3 r427 (beta)

    Browser: Edge 133.0.3065.69

    Browser engine: Chromium

    Context: webapp

    Operating system: Windows 11

    Device type: desktop

    Device pixel ratio: 1

    Logical CPU cores: 12

    Approx. device memory: 8 GB

    User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0

    Language setting: en-US

    WebGL information

    Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium)

    Numeric version: 2

    Supports NPOT textures: yes

    Supports GPU profiling: no

    Supports highp precision: yes

    Vendor: Google Inc. (NVIDIA)

    Renderer: ANGLE (NVIDIA, NVIDIA GeForce GTX 1050 Ti (0x00001C82) Direct3D11 vs_5_0 ps_5_0, D3D11)

    Major performance caveat: no

    Maximum texture size: 16384

    Point size range: 1 to 1024

    Extensions: EXT_clip_control, EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_conservative_depth, EXT_depth_clamp, EXT_disjoint_timer_query_webgl2, EXT_float_blend, EXT_polygon_offset_clamp, EXT_render_snorm, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_mirror_clamp_to_edge, EXT_texture_norm16, KHR_parallel_shader_compile, NV_shader_noperspective_interpolation, OES_draw_buffers_indexed, OES_sample_variables, OES_shader_multisample_interpolation, OES_texture_float_linear, OVR_multiview2, WEBGL_blend_func_extended, WEBGL_clip_cull_distance, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode, WEBGL_provoking_vertex, WEBGL_stencil_texturing

    Tagged:

  • I thought construct's sync used some other faster method of communication, didn't think messages where the right thing to use here. Thanks Ashley, keep up the awesome work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • (Reposted because I realized this should be under "Scripting")

    I RTFM and couldn't find ways to add client input value or sync objects thru scripting. What's up with that? Thanks in advance.

  • You do not have permission to view this post

  • I mean, is there even a way? Doesn't seem like it, can't find it in the manual.