DiegoM's Forum Posts

  • jobel

    Have you checked the values held in the first X and Y keyframes? You can do so by clicking on the keyframes in the timeline bar and then checking the properties bar. If those values are not 0, when the timeline starts playing, the affected instance will have a slight offset.

    I am guessing you must have changed the initial keyframe with the layout view controls to adjust the starting position of the animation. Normally this works properly for all keyframes, the first one has a little gotcha if the timeline is using relative positioning though.

    Because the values held are relative, by default the first X and Y keyframes have a value of 0, which just means "the initial position at the moment of playing". This allows for the animation to be played starting from the position of the instance, rather than a fixed value. If they change to something different to 0, then the animation will start from the instances position plus that offset.

    Of course, this is all technical mumbo jumbo and you really shouldn't be thinking about it. I have been meaning to fix this for a while because although it is not a bug, it is a very awkward behaviour which really isn't very helpful.

    Hope that helps.

  • Here is a quick example. https://www.dropbox.com/s/7003e5c4ajmdbjg/KeepTrackOfClicks.c3p?dl=0

    Notice the instance variable ClickCount in the Sprite object type.

    Additionally I used containers as a clean way to output the ClickCount variable of each instance to a different Text instance.

  • Use the On click and the Cursor over object conditions together. Then setup your sprite with an instance variable and add to that variable after each click.

    Each instance should be keeping track of the number of times it was clicked on.

  • I assume the name in this case is an instance variable.

    If so, you can use the Pick last created system action.

    From the manual.

    Pick last created
    Pick the most recently created instance of an object type or family. This is useful with the Create object (by name) system action. For example if you know the created object must belong to a family, then you can use Pick last created to pick the created instance from the family.

    https://www.construct.net/en/make-games/manuals/construct-3/system-reference/system-conditions

  • There are a few things to explain here.

    First, if your follower objects already have offsets assigned to them in the editor you can skip steps 3 and 4. Those where in case you wanted to give them a random offset at runtime.

    Keep in mind that for 4 objects you are going to need 4 sets of coordinates that will make up for a total of 8 values. To clarify:

    Follower 1
    Has offsetX instance variable and offsetY instance variable.
    Follower 2
    Has offsetX instance variable and offsetY instance variable.
    Follower 3
    Has offsetX instance variable and offsetY instance variable.
    Follower 4
    Has offsetX instance variable and offsetY instance variable.

    What I mean by relative to the target is that the offsets are values that you add to each coordinate of the target to obtain a result. This table has a few examples using actual numbers to show what I mean.

    Follower Offset (X;Y) Target Position (X;Y) Target Position + Follower Offset (X;Y)
    0 ; 0 100 ; 100 100 + 0 ; 100 + 0
    20 ; 10 200 ; 200 100 + 20 ; 200 + 10
    -10 ; -10 100 ; -100 100 + (-10) ; -100 + (-10)

    "add the offsets of the instance" means exactly that. At one point in your event sheet you must be using the Find path action of the Path behaviour and you are using the coordinates of your player object. Instead of just using the coordinates of the player object, add the offset values as well. Here is another table to try to explain this better.

    Target Position (X;Y) Target Position with offset (X;Y)
    player.X ; player.Y player.X + follower_object.offsetX ; player.Y + follower_object.offsetY

    What should happen is that, let's say your player object has a position of X = 200 and Y = 300 and a follower has offsetX = 10 and offsetY = 20, the values that you end up sending to the Find path action would be 200 + 10 for the X coordinate and 300 + 20 for the Y coordinate.

    Hope that helps.

  • The way I was thinking about implementing it was like this:

    1. Add a couple of instance variables to your follower object, call them offsetX and offsetY, or something to that effect
    2. Spawn follower
    3. Assing offsetX of the spawned follower as a value relative to the target position Ex. -10
    4. Assing offsetY of the spawned follower as a value relative to the target position Ex. -10
    5. When you do find player X & Y, add the offsets of the instance to those coordinates

    Everything will still be working the same, but instead of having the followers go directly to the player, they will go to a position with a slight offset.

    Make sure that each follower has different offsetX and offsetY values, otherwise all of them will go to the same place.

  • Not really.

    What you need to do is make sure the state of your player is updated properly, regardless of what is happening in the keyboard.

    When you need to take control away from the player, disable keyboard input and reset any variables that are keeping track of what it is doing. When you decide to enable the controls again, the player character should be in the idle state.

  • Have you tried setting the "Content-Type" header to "application/json" before making the request?

    If you are not doing that, then it must be trying to send as plain text, and then you need to escape certain special characters. But I am just vaguely recalling all of this, so it might not be accurate.

  • How does the data you are sending look like?

  • An easy way to workaround this problem would be to have your followers go to slightly different positions. When you create them, give them an offset and apply that offset when they need to calculate their destination.

    It's not super bright, but it should work pretty well.

  • I was just now trying by disabling the size tweens to see what was going to happen, and it looked like something else was changing the size of the instances.

    Glad you could fix it. Often times you just need to try and explain what is going on to someone, to be able to see the problem from a different perspective.

  • The way you are describing it makes it seem there is a problem with at least one of the things you changed, either instance variables or layout size and position. I am more inclined to believe there is something going on with the instance variables, but that is just a hunch, there are so many of them that it just makes me wonder if there is a hidden problem there.

    It is very unlikely that everything else would still be working properly if there was a problem with the Tween behaviour itself.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tested this out in r197.2 by manually changing .c3proj file, and it seems to be doing the same thing as in r203.2

    Still need to look at this more closely because there are a ton of things going on. It does look like it is easy to make a mistake if you try to make any changes.

  • This has been addressed in the latest beta, the changes are still not available in the stable version though.

  • I believe that what you need to do is add something like this to the Info.plist file and give a short description why your app needs that permission. That piece of text should show up when your application makes the request to use the device's motion sensor.

    <key>NSMotionUsageDescription</key>

    <string>Example: You should fill this in</string>

    I don't have an iOS device myself to try this out, so you should try it out on a real device before submitting again.