Radiowaves's Forum Posts

  • I have a string like this: _0_1_0_1/_1_1_1_1/_0_1_0_1/...

    I want to return duplicate between "/" and pick a random one if many different duplicates occur.

    I would not use strings if lists were possible in C3.

  • Yes the simple solution you kind of began then went for overlap checks. It's all about data and the gen ID is all you need. If the gen is down, you find all cables that have the gen ID and they are inactive. They are linked with IDs for this purpose, no need for checking overlap of objects.

    Brilliant.

    But what if one relay is getting power from multiple generators?

  • I would set variable/boolean "hasPower" for each Cable, Relay and Generator.

    Generator would have power set 1 by default.

    If Cable overlaps Generator & Generator hasPower==1, set Cable hasPower 1.

    If Cable overlaps Relay & Cable hasPower==1 & Relay hasPower==0, set Relay hasPower 1.

    If Cable overlaps Relay & Cable hasPower==0 & Relay hasPower==1, set Cable hasPower 1.

    Things get problematic when you want to add shorts:

    If Cable overlaps Relay & Cable hasPower==1 & Relay hasPower==1, run function "ElectricShort".

    This would be set immeadetly when unpowered Cable is overlapping with powered Relay. To tackle this, power cable could be split in two + & - side and check for those instead.

    If you do not want to run this all the time, put it into function and set it for each Cable.

    But in this case the function has to run from cable starting from generator first!

    Haven't tested it, but this is how I would start making it.

  • Yes, crop is what I want, certain UI elements responsive & pinned to corners.

    I already tried layer scales, It messes up my calculations.

  • You do not have permission to view this post

  • This leaves a black box, and also zooms in/out. This is default setting for pixel art, but it is no way ideal.

    I would assume viewport could be flexible without scaling, but no, not in construct 3....

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am dealing with pixel art, and pixel perfect movement, so I need those pixels. Somehow I do not get the game to full screen. All the scaling methods just seem to zoom when I change window size, even those that seem to be responsive. I want the zoom level to be the same no matter the viewport size, I do not care if the screenspace gets small.

  • You do not have permission to view this post

  • Okay, I found a solution.

    Unzip the c3p file, replace items, repack and upload.

    Somehow this was not obvious to me, that c3p files can be unzipped.

  • So, appareantly C3 also wants to change collisions when I import new contents into a sprite. This sucks, I have to redraw all the collisions each time I have changed the tiniest amount externally...

  • In C2, sprites were in folder and I could just replace the sprites in folder.

    In C3, I have to re-import everything manually.

    This is huge issue, because I tend to change a lot of graphics over the course of project. Surely this thing can be automated somehow?

  • Ooh, I come from C2, there was no such thing, bummer. I thought whichever comes first, happens first. So its not depth-first...

    Although I do understand the reason to run multiple loops simultaneously.

  • I do call it before bricks exist, because I create bricks in a function that is included in "MakeGame"...

    Bricks are created fine, they have ID-s I give them, function "DrawBricks" which is called before "SetLayers".

    I nitpicked the problem to the loop itself:

    Loop happens, but "For each brick" does not pass on the ID it is sorting them by, thus not picking any brick...

    I know a longer workaround for this using "Pick x instance" and just looping it N amount of times.. But this wrong, it should work like this. Or Tutorials should really explain how C3 operates, is it depth first or not and how are references to instances handled?

  • Why not just keep the waypoint coordinates in a variable or an array rather than link it to specific object?

    If you link it to object only, it does not know which one to pick, so it probably picks the last one..

  • I ma de a "For each" loop, thinking if I I make it "for each object" it would pick the object specified each time.

    Apparently it does not. How do I make it work?

    Here is my loop, the changes for "Brick" do not happen when I call the function.

    Here is how I call the function:

    I also noticed a strange behaviour, when I put contents of each function into single function, ordered, which are loops, it wants to run them simultaneously rather than wait until the loop is done.