Sup with that?'s Forum Posts

  • You might be better off grouping said objects in a family and building around that. Behaviors that rely on solid state don't really make exceptions IIRC.

  • I'm guessing no solution? Darn it I was hoping someone knew some trick

  • Can two layers with different blend modes be made to interact in a similar fashion to two objects on the same layer? E.g. Layer 1 = "Normal", Layer 2 = "Source atop" --> objects on layer 2 interact with objects on layer 1 according to their respective blend modes.

    Premise:

    Imagine a scrolling top-down shooter game set in space. Sometimes there are large objects in the background, like asteroids, space stations, etc. When foreground objects like spaceships fly over said background objects, they cast a shadow on the surface below. However, they don't cast a shadow when they're flying over the void of space.

    I can simulate this easily enough if I place the shadow objects on the same layer as the background objects, and give them "source atop" blend mode. But there's a catch - the shadows, as you might assume, are translucent, and when two or more shadows overlap they create darker spots which look weird. Normally my solution to this would be to make the shadows opaque and then put them all on one layer, then adjust the opacity of the layer itself. So therein lies the problem, I either have all my shadows on one transparent layer (i.e. shadows don't overlap, but can't use blend modes) or have the shadows on the same layer as the background objects (i.e. shadows overlap, but can use blend modes).

    Of course, if there's a different solution to the problem I'm all ears.

  • Aha, now I can do away with all the convoluted angle checks I was using. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there such a function?

    I believe Physics behavior has this, but I'm not using that. Basically I want a sprite to play different animations when it's rotating clockwise and counterclockwise (think a car where its front wheels turn to steer). A player-controlled sprite can do this easily by relying on player input, what's a simple way to reproduce the same for an AI-controlled sprite?

    Caveat: AI uses "rotate towards position" action, so I don't have separate AI turns right/AI turns left actions I can stick this into.

  • That's just because eventually the period becomes a negative number and starts "increasing" again in the eyes of Sine behavior. As I said, it's a really simple example.

    You can just put in a condition to prevent it from going below 0.1 or something to make sure it doesn't slow down again.

  • https://www.dropbox.com/s/qa5ak3rqfqjkplz/SineEg.capx?dl=0

    It's the absolute basics so you'll have to tweak it to your needs.

  • If you decrease the Sine's period parameter it will cycle faster, so just use a timer to periodically decrease it, or use dt to decrease it steadily over time or somesuch.

    E.g.

    [Set timer behavior to 5 sec repeating]

    [On timer] --> Set period to CurrentPeriod - 5

    or

    [Every tick] --> Set period to CurrentPeriod - dt

  • You do not have permission to view this post

  • Why not use a regular function to the same effect? Am I understanding this incorrectly?

    [Object takes damage] --> run function "Damage Taken"

    [Function "Damage Taken] --> play animation, subtract health, build more pylons, etc.

  • Welp, guess we're stuck with the current abomination. I had such hopes of ye, image editor.

  • Nah. I'm effectively using C2 as a one-man team to try and cobble out a game, by the time I finish AND if I manage to make any profit from it I'll probably have paid the equivalent of a C2 business license if not more. I don't think subscription is for hobbyists.

    That and I'm still disgruntled with C2 in some ways, such as the god-awful sprite image editor. For now C3 looks to be pretty much the same in those aspects so I don't see much point in switching.

  • Ha, no worries it's pretty much a guessing game for me too at this point. I realized this would be hard to diagnose without seeing the .capx but it's a massive .capx so I didn't want to have people sifting through lots of unrelated code to try and find one problem.

    Anyway, yep, the amount of objects remains the same. I didn't realize it's possible to have a layout keep going after switching away from it, I figured it's automatically paused when that happens.

  • Not really sure where to put this, perhaps it's a bug of some sort but I can't seem to reproduce it outside of my project so I'm wondering if anyone's ever had a run in with something similar.

    I have sprites that use Pathfinding and Persist, and after changing layout and coming back, they stop moving. However they don't register as actually stopped by the Pathfinding - after running some checks it seems they're meant to be moving, but for some reason are just stuck in place. Running events to make the sprites move along path will sometimes nudge them along a little at a time. I haven't been able to reproduce this in e.g. the RTS template so I'm not sure what's up. Any ideas what might be causing the hangup? A runaway loop maybe?

  • Nice! Looks to be working now, thanks!