WackyToaster's Forum Posts

  • Doublepost because I can. This decelerates the way I want to (and expect it to tbh) and I have the deceleration of the behavior itself set to 0. So at least there's an easy workaround. But I still wonder if the other behavior is expected, maybe it is, it's the 8 direction behavior, not the 360 degrees smooth movement behavior.

  • I have a sprite I intend to move via the 8direction behavior. I'd like to accelerate that sprite at a given angle for (enemy) movement (e.g. at a 10 degree angle)

    Doesn't work properly, the sprite does not move at a 10 degree angle, instead it goes straight ahead.

    I have another sprite that I wanna impact by an explosion. The explosion also accelerates the sprite at a 10 degree angle (e.g. based on the position to whatever exploded).

    Doesn't work as I'd expect, the sprite only briefly moves in the correct direction, then moves straight ahead instead of at the 10 degree angle.

    It's pretty obvious to me that this happens because the deceleration is applied horizontally and vertically, and not in the opposite direction of the velocity. But I do wonder if this is correct and intended. In any case, it's quite annoying and I have yet to figure out the formula to manually decelerate them the way I want to.

    c3p if you wanna check it out

    wackytoaster.at/parachute/8dirproblem.c3p

  • That looks dope!

  • I've had similar issues but that was even before the recent update. Sometimes the new image points just aren't saved properly but I also cannot reliably reproduce it. It just randomly doesn't work.

  • What exactly are you struggling with? There's an example project right there on the website and the plugin is very simple.

    sdk.poki.com/construct3.html

    sdk.poki.com/downloads/pokiSDK.c3p

  • I think right now the ideal approach to working with AI is to simply also be capable yourself and just use it as a supplementary tool. If you just mindlessly copy the code it spews out you're not gonna get far, and you learn nothing from it. I don't need AI to produce code for me that works perfectly with constructs API. I can just get a basic idea of the logic that I need and adapt it to the API myself or translate it into what the code would look like with events (Constructs events are quite close to javascript in the end).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > Detect "holes" in the floor with a raycast.

    > wackytoaster.at/parachute/enemyturnaround.c3p

    Construct 2 doesn't have these Line of Sight parameters. :(

    Do you know what the alternative would be in C2 to replace them?

    You can sort of replace raycasts with sprites and just check "is overlapping ground"

  • Detect "holes" in the floor with a raycast.

    wackytoaster.at/parachute/enemyturnaround.c3p

  • It's useful for general scripting questions, but Construct-specific stuff it gets wrong.

  • Well yeah, like that you have direct access to the class without having to import, but I'd say it's kind of dirty to program it like that hehe. At least to me it makes sense to have it organized that way. Just as an example:

    import * as Player from "./player.js";
    

    Now I have the Player Module, which can include more than just the player itself. It could also contain, say, the camera and the player weapon, which kind of make sense to be part of the player Module. Like so:

    runtime.objects.player.setInstanceClass(Player.Player);
    runtime.objects.camera.setInstanceClass(Player.Camera);
    runtime.objects.sword.setInstanceClass(Player.Sword);
    

    So everything regarding the player will be inside one separate file. And the setInstanceClass can happen only in one file in one place. So if something goes wrong or I have to add another instance class, I know exactly where to look.

    I write plenty of dirty code btw. but I still try to keep it minimal and do regular cleanups. There's nothing wrong with dirty code to a degree. Be more like Balatro-dev and less like Yandere-dev. Both have "dirty" code but Balatro is printing infinite money and yandere simulator still isn't finished (it's been 11 years)

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

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