Fib's Forum Posts

  • I just realized that custom actions can't return values nor objects. So that won't work. You would have to create a function.

  • No, there's no action that finds the highest/lowest Y value. If you want it exactly like that then you have to create your own custom action and compute it yourself.

    Docs for custom actions: https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/events/custom-actions

    I promise my solution would work pretty easily though.

  • Keep in mind that global layers have a "source" layout. Which is the initial layout you set the layer global in. If you delete the layer from the source layout then it and all the instances on it are 100% gone. But if you delete it from a different layout, not the source, then it will simply be removed rather than deleted.

    So if you want to delete it from the source layout then you will have to do some shifting around in order to set a new source layout for that global layer.

    A common practice is to create a new layout called "globalUI", or "globalLayers", something to that effect. Which becomes the source for global layers so you don't run into that issue in the future.

  • Yes. It's called "Pick by highest/lowest value" from the System object. It will pick the object. If you want to know the actual value then just access it and store it in a variable after picking.

    You can choose a family just like any other object.

  • Very interesting solution dop2000. It's much simpler than mine. Honestly I don't understand why it works. My understanding is if, for example, "simulate right" and "simulate down" at happening at the same time then the character should move down-right at a 45 deg angle. Not sure why your solution doesn't do that.

  • Thanks R0J0hound for the response and example. I converted it to work with the gamepad joystick instead of the virtual one and it worked perfect.

    I'm trying to study it a little bit. What does SDF mean? Is that a collision algorithm?

    I think this is complex enough, and also common enough gameplay-wise, that Construct 3 should support it. I know they hate when people say a feature is "easy", but I honestly think it would be easy. They already do it in Custom movement, specifically "Accelerate towards angle"!!!!!

    I worked with it today and came up with a hybrid solution. I still use 8 Direction behavior but simply handle the acceleration/decelleration controlling the VectorX and VectorY myself.

  • Try reading the doc first.

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/tilemap

    A few things is that collisions can be enabled/disabled on individual tiles in the editor. So make sure that data is set up correctly. Also erased tiles always count as "not colliding".

    If that's set up correctly then also make sure you're computing the correct tile indexes.

    If that's all correct then just use one of the many "erase tile" actions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • floor(random(0, 6)) is the correct method. It also says to use that in the documentation.

  • You can just right click in the event sheet click "Add function".

    Then when you click "+ Add action" --> "Functions" it will show up in the list under the header "Functions".

    Keep in mind that if the function has a return value it will NOT show up in that list. You can only access it through expressions (i.e. "Functions.Function1")

  • Right, and that's what I'm currently doing. But it feels very weird on joystick. If you make slight movements to the joystick then there's zero response to the character, which feels unresponsive. That's why we need "Simulate at angle" on 8 Direction so I can just pass in the joystick angle. That way I also get all the benefits of 8 Direction like accel/decel, collisions, and sliding.

    Also "Simulate at angle" already technically exists on Custom movement behavior, but it's called "Accelerate towards angle". That's exactly what I want on 8 Direction. BUT the problem with Custom movement behavior is that it doesn't do decelleration to a stop for you nor the sliding.

    So one or the other..... add "Simulate at angle" to 8 Direction, or add decelleration to stop and sliding to Custom movement. Otherwise sounds like I have to handle accel/decel myself.....

  • Thanks for the reply dop2000, but that doesn't work well because that will ignore the acceleration and deceleration that 8 Direction handles for you. I would have to code my own accel/decel which is not ideal. I need it for my game cause some characters have tight movement but other characters are made of ice so need low accel/decel.

    I'm hoping for a built in C3 solution cause this is such a common thing in games that we shouldn't need to hack it in ourselves. Even Custom movement can't handle deceleration to a stop which seems like a big oversight.

  • I'm struggling to figure out how to move my character at the exact angle of the gamepad joystick using any of the movement options in C3. I'm currently using 8 Direction but it only simulates at up, down, left, or right. Which doesn't support joystick angles very well. I can force the joystick to only move in those cardinal directions but then the joystick feels weird and unresponsive.

    Is there a way to fix this? I've tried MoveTo and Custom movement but none of do all the things I want. I need the movement to handle acceleration, decelleration, and collision detection at a minimum. But the sliding of 8 Direction is a massive bonus.

    If no one can think of anything then please add a thumbs up to my suggestion:

    github.com/Scirra/Construct-feature-requests/issues/493, which is to add "Simulate at angle" to 8 Direction movement.

  • I made it in ~8 hours of work. My best score is 13. Hope you like it :)

    fib.itch.io/nut-shot

  • Random without repeats can be accomplished with the Advanced Random plugin. I think it only works with numbers but you can create a lookup table to map it (0=a, 1=b, etc).

    You'll have to store the results of the random output in an array though.

  • Does anyone know how the "Wait" system action is implemented? Is it like setTimeout() function in JavaScript, where a function is called after a time? Or like a Coroutine from C#, where the execution of a function is paused in a way?