Speedy1SonicBoy's Forum Posts

  • There's more to the code than I can successfully screenshot, I'll be able to show you via the project file itself:

    drive.google.com/file/d/1x-GN_g_PbKfzClApM8vNFcr6RX3ITA5r/view

    Bear with me, the link should work, but I'm not entirely sure how to do it with Dropbox, so I did it through Google Drive instead.

  • The chain is made with events.

    So the initial part of the chain is the Chemic itself, then another Molek or set of moleks that will then be destroyed upon touching alpharay. (Or betaray, which I don't have in the example but I do have in the rest of the project.)

    Thing is, I tried the condition of overlapping Chemic or Molek but neither worked.

    I think the solution might have something to do with the markers themselves. Maybe if I can have the system check if 4 markers can be looped around a molek, for it to then detach.

    How would I go about making that a condition, however?

  • I have a unique problem in my hands.

    So I have a system that attaches sprites in a chain. When that chain breaks, I hope that the sprites detach accordingly. Unfortunately the below circled sprites act as if still attached!

    I've already figured out how I'd want the sprites to act. The question is this: what do I put in the conditions tab to make it so the system checks for a break in the chain?

  • Set rotateSpeed to lerp(rotateSpeed, 0, 0.05)?

    After a few tweaks, that seems to be it! Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Couldn’t you just use the bullet behavior, and rotate behavior but gradually reduce the turning rate to zero?

    Behaviorless is similar and easier for me to write off the top of my head and would be:

    Every 1 second
    — create bullet at sprite.x, sprite.y
    — bullet: set angle to random(360)
    — bullet: set turningRate to random(30,120)
    
    Every tick
    — bullet: move forward 150*dt pixels
    — bullet: set turningRate to lerp(self.turningRate, 0, 0.05)
    — bullet: rotate self.turningRate*dt degrees

    If you used behaviors then you’d basically reuse the action that sets the turning rate to some extent.

    If I'm reading this right, then the turning rate in behavior form would be the rotate speed. In that case, since I am using behaviors, how would I gradually reduce the rotate speed to 0?

  • Can you draw a picture of that spiral path?

    Here is another behavior you can use:

    https://www.construct.net/en/make-games/addons/198/spline-movement-c3-runtime

    Demo project:

    https://www.dropbox.com/scl/fi/b7znsclmmgnkzpi8cracv/spline_demo.c3p?rlkey=9fogcjirerhfodmvbwwmxj8sw&st=3t05wgrv&dl=0

    I have a feeling this will be helpful, so I've already installed the addon.

    The object that I plan on using this for (the αray, in this example) will spawn from something else. It will take a path between a slight curve and a fibonacci spiral, again depending on rng.

    So, from something like this:

    to something like this:

    And anything in between.

    But here's the thing: The spawn point (The green ball) will also be moving. That part I've already figured out with spline addon, but as for updating several instances of an invisible sprite around the object at the time of the spawn, that's where I'm scratching my head.

  • I'm open to the tween and move-to options. Not so much the timeline, as I've found even with easing the movements can be choppy.

    Plus the spiral will have to get bigger or smaller, based on RNG.

  • I'm trying to guide an object along a spiral path to the edges of the viewport.

    Any help, as ever, is appreciated!

  • Hopefully this helps you understand the logic so you can move on with your project:

    It's been a massive help. With some personalizations, it works. Thanks! :)

  • The easiest way I can think of is Having a spawn state Boolean attached to the game/player state.

    If PlayerState = CutScene

    Set Var CanSpawn false

    Then add a condition on the call function like

    If CanSpawn = true

    Call function.

    If that makes sense. That would be the easiest way to do it.

    Then if you want it to spawn one on a timer, You can attach a timer to each molecule,

    When spawn, start timer, after X seconds set CanSpawn to true. Spawn the molcule then set CanSpawn to False....

    That works some.

    What makes it tricky is the spawn after the last molek gets attached. The attached state is a boolean as well, for the molek sprite. So another molek should spawn immediately after and reset the timer each time the last molek gets attached... or just simply wait x amount of seconds to pass from said timer without attach for another molek to spawn. (this second part seemed easy enough, but the first eludes me)

    Mind you, I had it working before, but when the center shape was built, the spawn-destroy cycle would continue in repeat until the next shape was called for, then act as normal.

  • I still don't understand how and when the molecules should spawn in your game, [...]

    Ah, I see. So when the last molek is collected, OR after a certain time passes without it being collected, when Chemic (the main sprite) isn't in miss mode, challenge mode, cutscene mode, or the shape in the center being built, as here for an example:

    That's when I want the moleks to spawn, one at a time. I did the second line so that very first statement can be applied, but wasn't aware it ran every tick.

    I have booleans and variables for all of these options.

  • This is what I have so far:

  • I still don't understand your question. But if you want to pause the function, then just don't call it. Check for some condition, say, use a variable - spawningIsPaused. Set it to true when you need to pause spawning.

    If NOT spawningIsPaused -> Call SpawnNewMolecule

    Then set it to false to resume spawning.

    This works only somewhat.

    Not entirely sure why, but I call the pause to happen in certain states and it doesn't function as intended. I think it may have to do with the fact that the Background sprite is the one with the timer and the instance variable of Pause, and I'm calling on booleans from other sprites to Pause, like so:

    Moleks still appear even after challenge is on, but only showing from one corner. I'd rather it didn't spawn at all, if not from the Chemic itself, which I've already done separately.

    If not, maybe I'm overlooking something crucial, because I also have a sequence of events happening here via function:

    * On function 'Cutscene'

    -> Background: Set Pause to True

    -> Chemic: Set 8Direction Disabled

    -> Plan: Set animation frame to 0

    -> Plan: Stop animation

    -> System: Wait 1.0 seconds (use time scale: True)

    -> Chemic: Subtract 1 from child_count

    -> Molek: Set attached to False

    -> Molek: Set Bullet speed to 500

    -> Molek: Set Bullet angle of motion to angle(0,0,Self.dx,Self.dy) degrees

    -> Molek: Set Bullet acceleration to 0

    -> Molek: Start animation from beginning

    -> Molek: Set collisions Disabled

    -> Chemic: Subtract 1 from child_count

    -> Molek: Set attached to False

    -> Molek: Set Bullet speed to 500

    -> Molek: Set Bullet angle of motion to angle(0,0,Self.dx,Self.dy) degrees

    -> Molek: Set Bullet acceleration to 0

    -> Molek: Start animation from beginning

    -> Molek: Set collisions Disabled

    -> Chemic: Subtract 1 from child_count

    -> Molek: Set attached to False

    -> Molek: Set Bullet speed to 500

    -> Molek: Set Bullet angle of motion to angle(0,0,Self.dx,Self.dy) degrees

    -> Molek: Set Bullet acceleration to 0

    -> Molek: Start animation from beginning

    -> Molek: Set collisions Disabled

    -> Chemic: Subtract 1 from child_count

    -> Molek: Set attached to False

    -> Molek: Set Bullet speed to 500

    -> Molek: Set Bullet angle of motion to angle(0,0,Self.dx,Self.dy) degrees

    -> Molek: Set Bullet acceleration to 0

    -> Molek: Start animation from beginning

    -> Molek: Set collisions Disabled

    -> Audio: Play "Cutscene" not looping from Sounds at 0 dB (stereo pan 0, tag "")

    -> System: Wait 1.0 seconds (use time scale: True)

    -> Chemic: MoveTo: Move to (540, 1290) (Direct)

    -> System: Wait 3 seconds (use time scale: True)

    -> Audio: Play "Start" not looping from Sounds at -10 dB (stereo pan 0, tag "")

    -> Background: Spawn Build on layer 6 (image point 0, create hierarchy: False, template: "")

    -> Build: Set position to (180.909, 747.765109)

    -> Build: Fade: start fade

    -> Plan: Start animation from beginning

    -> System: Wait 5.0 seconds (use time scale: True)

    -> System: Save game to slot "mysave"

    -> Chemic: Set 8Direction Enabled

    -> Chemic: Set Cutscene to False

    -> System: Wait 1.0 seconds (use time scale: True)

    -> Audio: Play "World1" looping from Music at -10 dB (stereo pan 0, tag "")

    -> Background: Set Pause to False

    As you can see, the Pause boolean is set to false at the very end, and yet the molek shows right when the "Build" text appears and not later.

  • What recurring function? Did you mean a recursive function, which calls itself? Or do you call the function in a loop?

    Please post a screenshot of your code.

    This was about the (SOLVED) sprite instance spawning I had asked about earlier, in which a regular timer called the function.

    construct.net/en/forum/construct-3/how-do-i-8/spawn-sprite-instances-185929

    However, I noticed that upon the shape being built, the moleks would loop spawning and then destroying themselves immediately after, which I think is being caused by this little snippet here:

    How would I make it so that that doesn't happen, instead pausing the spawning for a while and then resuming until the final shape is built? (which would be the third stage)

  • So I noticed a loop that happens because the recurring function doesn't end. How would I make the recurring loop essentially freeze so that this loop doesn't happen?