ZeldaVerde's Recent Forum Activity

  • 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.

  • WAIT YOU CAN DO THAT??? OMG I WAS LISTENING FOR EVERY OBJECT CREATION EVER AND THEN TRYING TO FILTER IT.

    thanks man lol .___. I'm dumb

  • Thank you thank you dop2000!! You're always so helpful.

    However what I want is to translate an "On <family name> created" condition:

    I added an event listener for objects being created, and now have to check if they belong to that family.

    Or is there another way to translate that that you'd suggest?

    edit: also I just realized my approach doesn't even make sense because an object can be in many families. But still, how'd you go about that then?

  • You could do it using two families that have the same objects in them (for you to reference the correct uids) like so:

    shooter_team has LOS to shooter_team2(or whatever name)

    for each shooter team

    -----shooter_team.UId not equal to shooter_team2.UId --> team targets team 2

    -----(whatever whatever whatever conditions)

    (srry I don't know how to format it in a pretty way)

    maybe also try removing the for each, seems like it should work

    and also maybe you can just use the same family, cause I feel like objects won't detect LOS to themselves but I'm not sure

ZeldaVerde's avatar

ZeldaVerde

Member since 11 Nov, 2018

None one is following ZeldaVerde yet!

Trophy Case

  • 6-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies