mekonbekon's Forum Posts

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think I just had the same thing happen; I returned to Construct and the editor window was completely greyed out. Are you using Chrome? If so I managed to fix it using a method that also works if your browser window blacks out:

    Right click on the the chrome icon in the taskbar and open an incognito window - once it's open, close it and the Construct Editor should be restored.

  • BillyShears

    I managed to compensate for the x/y drift, so z-elevation will scale from the object's origin regardless of position in the viewport - updated in the demo linked above.

  • Use

    Save.At (43.0) & "" & Save.At (44.0) &newline& "Tour:" & Save.At (14.0)

  • No worries :-)

    I thought I'd accidentally deleted it somehow - either we both did or there's something funky going on. Fingers crossed it doesn't keep happening.

  • Yeah I had the same issue, not sure why it happened. To fix it I opened Construct in the browser (Chrome) then clicked the three dots in the top right corner and selected "Open in Construct 3". Once it opened I had to repin to the taskbar.

  • The reason this isn't working is because the conditions that pick the Family object don't also pick the specific Factory object, so your "Factory isDestroyed" condition picks all of the Factory objects.

    There are a few ways to get around this; the simplest is to shift your "isDestroyed" variable to the Family and then change all the conditions and actions referencing the Factory object to the Objects family.

    Another way would be to move all the Factory conditions and actions to a function; then, in the ObjectType = "Factory" subevent, pass the picked Object's UID to the function in a parameter and use that passed UID in the function to pick the Factory.

  • kncuser

    I think I have a fix, updated in the link above. In the demo, try shifting the 9-patch around and then run it - it should now always scale relative to the centre of the object rather than the centre of the viewport.

    Here's how I approached it:

    On start I save the 9-patch's coordinates to instance variables.

    When the 9-patch is tweening I compensate for the x,y change by repositioning the 9-patch by the z-elevation percentage of the object's distance from the centre of the viewport:

    + 9patch: Is Tween "zUp" playing

    -> 9patch: Set position to (Self.startX-(Self.startX-ViewportWidth(0)÷2)×(Self.ZElevation÷100), Self.startY-(Self.startY-ViewportHeight(0)÷2)×(Self.ZElevation÷100))

    I'm not sure whether this will hold up if the layer is parallaxed or scaled, but should be fine with the default settings.

  • There's a snag doing it this way: z-elevation scales from the centre of the viewport rather than the origin of the object so this method doesn't always work. I'm going to test if you can compensate by adjusting the object's x/y but my hunch is that it'll be a bit of a faff.

  • kncuser

    I literally ran into this issue myself just now - turns out I'd been doing all my z-tweening on objects at the centre of the screen, which works fine. I then tried it on an off-centre object and was stumped as to why it was tweening weird. I figured it out and came to post here, but you'd beaten me too it! :-)

    I'm guessing you could simultaneously tween the x,y back to the initial position? I'll give it a go and report back.

  • nicely done! that works very well - I haven't done much with Z-elevation.

    Cheers :-) I've only recently started exploring it myself, lots of potential when combined with the new pin features.

  • Tweening the z-elevation works well for scaling text and spritefont:

    dropbox.com/s/9lgyx16nidbuiwg/scalingWithZ.c3p

  • You can wrap the offset without having to use additional conditions by using the modulo (%) expression in the action:

    -> TiledBackground: Set image X offset to ((Self.ImageWidth+Self.ImageOffsetX+backgroundSpeed*dt)%Self.ImageWidth

    This will automatically reposition the offset once it exceeds the image width.

    It's worth using a variable for the background speed rather than a fixed variable as it allows you to easily manipulate the background movement during play.

    A negative backgroundSpeed value will reverse the direction of movement.

    Switch width to height and X to Y for vertical movement.

  • The issue is that all three events will trigger on the mouse click in sequence because each event is setting the conditions for the next one; event 2 sets the frame to 1 so event 3 is true, and so on.

    Here's one way to deal with this:

    On left button clicked on sprite: Set animation frame to min(self.animationFrame+1, self.animationFrameCount-1)

    This will step up the frame number each time you click up to the maximum frame number (animationFrameCount-1).

    Here's another:

    On left button clicked on sprite:

    =>Sprite animation frame = 0: set animation frame to 1

    =>Else Sprite animation frame = 1: set animation frame to 2

    =>Else: set animation frame to 3

    In this example you use a sequence of "Else" sub-events to allow you to step the frame number.

  • Both spritefont and text objects scale fine using z-tweening:

    dropbox.com/s/9lgyx16nidbuiwg/scalingWithZ.c3p