DiegoM's Forum Posts

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • To be honest I have no idea how I would implement something like it.

    I imagine that I would need to transform the values the timeline is generating according to the angle of the instance being affected, so the timeline will see no changes to it's keyframes, but there would be a little bit of new code doing some additional math to modify the steps the timeline generates as it progresses. Assuming I did everything right, it should work.

    Another approach would be to transform the values held by each keyframe then just interpolate normally. If you imagine the origin of the timeline being it's starting position, rotate all the points around that center and it should work.

    Both ideas sound pretty straight forward, but I get the feeling there are a million pitfalls and gotchas in both of them :P