WackyToaster's Forum Posts

  • You need to export the class and

    runtime.objects.plr.setInstanceClass(plr.plr);
    

    the first plr is the module, the second plr is the class.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well the Pin behavior is at least (sort of) deprecated in favor of hierarchies. so I understand there not being an API.

    Things that I have in my events are currently:

    "Draw on tilemap with brush" since this is not available in js out of the box. I know it's possible to do bitwise operations blablabla but as you said: why bother, it already exists, just make a lil function to call.

    "Recreate initial objects" which is also not available in scripting. I specifically need it to load template layouts, which was added a while back. I don't even think there is a way to do this in js at all. I can get the ILayout but that doesn't help since there's no access to the initial instances. So I'd somehow have to do some weird workaround like go to the layout, store the instances, go back, then create them... or just do a lil function call.

    It's really not that big of a deal in most cases, but that said, I'd still prefer just having these options available in scripting directly. Now that I think about it, I should probably also just add feature requests for these too but I don't wanna spam so many feature requests either :V

  • Here's the basic code for it with the same particles attracting and different particles repelling.

    wackytoaster.at/parachute/particleslifesimulation.c3p

    I do want to point out though that this is computationally really bad, the performance is terrible. It will probably be ok if you just wanna play around with a few hundred particles at most, play around a bit. I've done similar projects like that before and just kept it within the limitations.

    If you really wanna go ham:

    1. You'd want to get rid of box2D and instead use your own calculations for the particles. They won't need a lot for that, probably just a movement vector and radius. That would get rid of the extra bloat that box2D adds that doesn't matter for this simulation.

    2. You will still be limited very quickly by how fast CPUs and javascript are, generally. If you really wanna do this at any greater scale, you'll have to do the same thing as the guy in the video, which is to do the calculations on the GPU instead. This is possible with webGPU but will require javascript and webGPU knowledge. Maybe you can get by with some library like turbo.js.org but I have not tested it at all.

    Good luck.

  • Well no, like the link I posted... You just open steam://store/1607720 in your browser and it will ask you to open it in steam. I'm assuming this should also work just the same with the overlay api, or in fact even better because it's using the steam browser protocol.

    SteamOverlayAPI.OpenURL("steam://store/1607720");

    You can try right now. Just paste the link into the adress bar and hit enter.

  • It's actually easy, it's just a special link that looks like this

    steam://store/1607720
    

    You just have to replace the number with the id of your game.

  • Alright thx, feature request it is. The workaround is ok, but I always set out to do a game and make it "javascript only" just to end up back in the event sheet for random reasons. Either be it workarounds, missing APIs (or intentionally left out) or simply convenience with some things. Not a bad thing per se but not exactly what I plan, haha.

  • Setting the z order is done with the actions "Move to top" "Move to bottom" "move to object"

    There is also a specific "Sort Z order" system action that sorts based on an instance variable.

  • I know saying this isn't exactly helpful but this error quite directly tells the user what the problem is and how they can fix it. Is that... not good enough?

    I'd assume the Internationalization support is used by constructs build-in Internationalization plugin. Did you use that plugin? Either way Construct probably checks for support and if it isn't supported, shows this error. It's kinda weird though that only a recent update has caused this error to show up, considering the internationalization plugin has been implemented for a good while now.

  • Is there a non-silly way to get a canvas snapshot in script? Am I overlooking something? Specifically I wanna load it into a sprite, and currently I have to do a whole bunch of ??? to get the blob. I cannot access the snapshot directly in script but I also cannot hand it off via a variable because these don't support blob urls.

    await runtime.callFunction("snapshot");
    let response = await fetch(this.snap);
    this.snap = await response.blob();
    const img = runtime.objects.transitionSprite.getFirstInstance();
    await img.replaceCurrentAnimationFrame(this.snap);
    

    I've also tried to use new URL(this.snap) in hope to get an URL which does seem to work but it then fails at img.replaceCurrentAnimationFrame() due to wrong type. Further I've tried to directly access the context of the c3canvas but that also wasn't exactly working, I didn't spend too much time on it since I expect this to be hacky anyway.

    On a sidenote, since we're talking canvas snapshot: Is there a good way to snapshot only some layers? I know I can briefly hide the stuff I don't wanna snapshot (e.g. UI) but since snapshot is async it will cause the UI to flicker which isn't exactly neat. Not sure if there's any workaround for that.

  • There's a possibility it's locked or on a locked layer. You can try checking it in the instances bar. Menu > View > Bars > Instances bar.

  • Looks quite like it's a similar (the same?) problem that it was back then. Maybe. There's lots of removeChild and appendChild listed, which seem to somehow rise in numbers when Construct is actively used.

    Compared to the same interaction (drag & drop) in a freshly opened editor.

    I saved the profiler traces if it helps but Ashley mentioned in the other thread that they are not really helpful due to obfuscation, but I can post them if needed. The delay always happens on pointer interaction, like when selecting an instance on the layout. So something is ballooning there the longer Construct is in use.

  • If you encounter this again you could start the chrome dev tools profiler, that may give a hint at some memory leak or something.

    Yeah I will do that. It's bound to happen again. I kinda forgot that this profiler exists, but I did take a video for comparison yesterday with two editors open side by side. Left one being freshly opened, right one being the sluggish one. I wouldn't say there were outright freezes, but I could imagine it getting so sluggish that it would be considered "frozen". The only freezing I had was when zooming the layouts, there it would sometimes not do the zooming despite the scrollbars indicating I was indeed zooming. Eventually it would then snap out of it and display the correct zoom again.

    Subscribe to Construct videos now

    I don't believe it has much to do with the eventsheet because I was barely doing anything in the eventsheet at that point. I also have everything well grouped though, but if there would be an inherent problem with the eventsheets or objects or layouts, restarting shouldn't fix it I think.

    I just have 288 events with 259 conditions and 607 actions. 58 Object types and 9 Families, 19 layouts and 5 eventsheets. That's like a baby-project.

  • But I don't really know why. I mainly wonder if anyone else noticed that. Here's what I do know:

    • It does take a while to be noticable, but it seems to get more sluggish the longer I'm working
    • Simply restarting the editor solves it
    • I wasn't doing much work in eventsheets, mainly saving, previewing, duplicating/adjusting a bunch of replicas across a handful of layouts
    • The project isn't exactly huge overall
    • I have a beefy pc so that shouldn't exactly be a problem
    • The lag is very noticable when: Switching tabs, selecting instances, moving instances

    Considering that simply taking 10 seconds to restart Construct fixes it I'm not even sure if it's super worth to investigate. However, I'm not 100% certain if that was a problem before todays update r421. I feel like I didn't have that issue in r420 but I cannot tell for sure.

    There also used to be a bigger thread about this 3ish years ago, possibly related?

    construct.net/en/forum/construct-3/general-discussion-7/anyone-seeing-slower-167843

  • Hard to say... You could try increasing the version gradually. Open it in r350 and save -> r380 and save -> r400...... perhaps that kind of works out.

  • Hmm good question. The bullet setting adds more steps in the physics engine, so it's probably simply that more steps = more chances that when the collision triggers in Construct there also happens to be a collision in the physics engine. Without trying I'd suspect though that it's still not 100% reliant because the physics engine treats the shape as a perfect circle whereas Construct just uses the collision poly.