Ashley's Recent Forum Activity

  • See the manual section on scripts in event sheets. You should use a script with the purpose "imports for events". (Alternatively you need to explicitly refer to the global scope with globalThis, but imports is a better-organised approach.)

  • I think it's theoretically possible to make a plugin for Construct that can run Python code, as it could use a WebAssembly build of the Python interpreter. However I don't believe anyone has attempted that yet, and it would be much more difficult to actually integrate that with the runtime, such as to use Python code to change a Construct object. Integrating all those API bindings would probably be the most challenging part, and without that it would be hard to do much useful with Python code. So I think the best approach is just to try to get to grips with JavaScript.

  • Internally it doesn't use setTimeout or coroutines, as the event system is complex and it has to do a lot more than meets the eye to implement the wait logic. So really it's a custom implementation I guess.

  • It's not currently supported but we're planning on implementing this suggestion which should cover it.

  • I would expect Google, Microsoft and Mozilla will be working on getting their browser engines ported to iOS ASAP for this - but I think they can only publish their browser apps in the EU, so for now at least it has limited reach. However the ability to use real Chrome on iOS, rather than just a Safari-wrapper, means there is at least the option to use a better browser engine on iOS. It should provide options for more features and provide a way to avoid bugs and limitations in Safari (including possibly using a higher refresh rate).

    iOS apps will continue to use WKWebView which is based on Safari, but that's normal - on other platforms we use the system webview for apps. It's only web browsing that this will help.

  • There is only one signalling server, and both URLs (multiplayer.scirra.com and multiplayer.construct.net) point to the same server.

    I'd recommend updating any existing projects to refer to multiplayer.construct.net. While we intend to keep the multiplayer.scirra.com URL alive for backwards compatibility purposes, we cannot guarantee it will continue to be running in the long term, as our long term goal is to move over everything to run on the construct.net domain.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Getting an item from Local Storage is asynchronous, which means it takes a moment to complete. You need to use Wait for previous actions complete after it to make sure the data has finished loading in to the Binary Data object before you attempt to play audio from the Binary Data object.

  • OK thanks - I see the problem now.

    Ultimately this comes down to the fact runtime.objects.Monster has a static type of IObjectType<InstanceType.Monster>, which refers to the base class rather than the instance subclass. That base class is ultimately propagated to all its event handlers.

    It's difficult to static type this correctly as from the perspective of TypeScript, setInstanceClass is a runtime method and so can't be used to affect static typing.

    I think this is just one of those cases you have to override TypeScript's types as you know more than TypeScript does. There's a couple of ways around it. Probably the most straightforward is you can just use as to cast it to the right type, e.g.:

    runtime.objects.Monster.addEventListener("instancecreate", e => DoMonsterSpawnedFunction4(e.instance as MonsterInstance));
    
    // ...
    
    const DoMonsterSpawnedFunction4 = (inst: MonsterInstance) => {
     inst.OnCreated();
    };
    

    I'd recommend the above approach, but another possible approach is to make your own reference to the object type with the correct type IObjectType<MonsterInstance> - and then using addEventListener will propagate the type MonsterInstance down to the event handler, e.g.:

    const MonsterInstanceType = runtime.objects.Monster as IObjectType<MonsterInstance>;
    MonsterInstanceType.addEventListener("instancecreate", DoMonsterSpawnedFunction2);
    

    So yeah, basically just override the type for this case.

  • It's possible but comes with a lot of complications. Off the top of my head:

    • Most texture compression formats are lossy, so they will affect how the artwork appears. Often this doesn't matter in 3D games, as perspective and texture styles make it less noticable.
    • It looks like not all texture compression formats support alpha, or if they do it has to be via a separate texture, which is either a major limitation for 2D games (again not as relevant for 3D games) or a major complication for the engine
    • The file size compression isn't very good, so you'd still want to export PNG/JPEG/WebP for smallest download size. That means compressing textures on-the-fly at runtime, which could substantially increase loading times (possibly with a slow/high quality to fast/low quality tradeoff)
    • I think some texture compression formats are patented and shipping encoders could incur fees, much like some patent-encumbered video formats, which more or less rules out using them at all as it makes them uneconomical, unless there's some other encoding system used beforehand and you ship your game with pre-encoded textures, which would then have a much larger download size
    • Not all platforms support the same compressed texture formats, so you might have to support encoding to multiple formats (making some of the previous points even worse)

    I wouldn't be surprised if there were further complications I haven't realised yet. Compressed textures look like a feature best suited to large-scale 3D games with gigabyte-size downloads or dedicated installers. It seems to me like they are much less suitable for 2D indie games.

    Meanwhile I've heard GPUs can use lossless texture compression automatically - but if they do that it's undetectable to the app and doesn't need anything special to be done. So sometimes that might help anyway. But Construct doesn't know about that - its texture memory usage is based basically on just the number of pixels in the image.

    • Post link icon

    JiyaHana - this is an unhelpful post to a 5-month old thread, and looks to me like it may be AI generated, like a couple of your past posts. This is a warning that if you continue posting like this you may be banned on the assumption you are using AI to make plausible-sounding but useless posts.

  • I don't know. Construct just reports the mouse position as soon as it possibly can. Any delays are probably in the browser or system.

  • Make sure you use 'Invoke download of string' with a string of CSV data. If you're passing CSV data as a URL, it's not a valid URL and so will fail to download.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,543,791 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x109
    Coach One of your tutorials has over 1,000 readers
  • x69
    Educator One of your tutorials has over 10,000 readers
  • x3
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x38
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs