InadequateChris's Recent Forum Activity

  • Hey all,

    I've got a Multiplayer game with one Host and one Peer. The characters are moved around by the HeroBase object.

    With the code below, the conditions are met when a player moves within a certain range of a Puzzle object. It works as expected when one player is within range, but when both are in that area, the "Trigger Once While True" seems to get ignored, and the conditions get met every tick.

    Does anyone know why this is, please? Am I doing this the right way?

    + System: For each HeroBase
    + Hero: associatedPlayer = HeroBase.associatedPlayer
    + Puzzle: Pick nearest to (HeroBase.X, HeroBase.Y)
    --------+ Hero: X ≥ Puzzle.X - 200
    --------+ Hero: X ≤ Puzzle.X + 200
    --------+ System: Trigger once
    ---------> testText: Set text to Self.Text & "1"
    
  • Thanks very much for your help, you two. Being new, it helped me experiment with a few features and techniques I hadn't before, and I've learned a lot.

  • Hello,

    I have some drag-and-drop objects I'd like to keep within the confines of an irregular shape. Is there a way to contain it in the shape using clamp? My understanding is that only square or rectangular shapes can be set for that, but please correct me if that's not true. Or are there better methods for achieving this?

  • Thanks for the response, oosyrag. I did a bit of further experimentation and it seems it was because I was using a tween that had Destroy On Complete set to True. When I just use a normal Destroy action, it works. Is this the expected behaviour? I'd have thought that a Destroy would work regardless.

  • Hello,

    I'm destroying a synced object on the host's side, and my assumption was that it would automatically disappear on the peer's side when that happened. The object does seem to get destroyed because it freezes on the spot and it no longer appears in an object count, but the sprite remains on-screen.

    I've tried all sorts of things like sending a message to the peer to destroy it from their side, but that doesn't work either.

    Does anyone know the correct way to make it disappear for the peer please?

  • You can have a second family with the same objects.

    That worked a treat, thanks blackhornet.

    The code I ended up using was this:

    + Box: Platform has wall to left
    ----+ Box: Is overlapping BoxCollision at offset (-2, 0)
    -----> Box: Set boxToLeft to BoxCollision.UID
    
  • Hi,

    I have some Boxes that the player can move left or right. When a Box (a) is moved up against another one (b), I'd like to store (b)'s UID in (a)'s boxToLeft Instance Variable.

    The problem is that I'm not sure how to select (b) when the Family type is the same. Here's what I'm doing at the moment and it's obviously not working:

    + Box: Platform has wall to left
    ----+ Box: Is overlapping Box
    -----> Box: Set boxToLeft to Box.UID
    -----> testText: Set text to "BINGO BANGO!"
    

    Any help appreciated, thanks!

  • Thanks guys, I hadn't heard of the Canvas To Layer function before. After a bit of digging I've got it working using this code:

    -> inventoryItem: Set position to (CanvasToLayerX("UI", LayerToCanvasX("Characters", inventoryItem.X, inventoryItem.Y), LayerToCanvasY("Characters", inventoryItem.X, inventoryItem.Y)), CanvasToLayerY("UI", LayerToCanvasX("Characters", inventoryItem.X, inventoryItem.Y), LayerToCanvasY("Characters", inventoryItem.X, inventoryItem.Y)))

    -> inventoryItem: Move to layer "UI"

  • I do, but I'm not sure how I'd apply it in this particular problem.

    My best guess so far has been:

    -> inventoryItem: Move to layer "UI"

    -> inventoryItem: Set position to (Self.X - LayerParallaxX("Background"), Self.Y - LayerParallaxY("Background"))

    I'm aware there are no percentages here, just stuck as to how I'd use them!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello!

    I have an object on a parallax layer, and when I move it to a layer that has no parallax, it (of course) suddenly changes position due to the layers behaving differently.

    Is there a way to get it on to the non-parallax layer that maintains its on-screen position, please?

  • My apologies for bumping this - does anyone know how to 'move along' a column in an array and get the value from it?

  • Hi mrcgkh. Thanks for the help!

    Is there a way to do this without instance variables? I'm pre-populating the Array in the Array Editor with all the necessary information.

    I thought it might be as easy as finding the row containing the name, then moving across a column in the array.

InadequateChris's avatar

InadequateChris

Member since 2 Dec, 2020

None one is following InadequateChris yet!

Trophy Case

  • 3-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

5/44
How to earn trophies