DiegoM's Forum Posts

  • Under the hood a Tween is a Timeline, as in they use the same code. The Tween behaviour was a nice by-product of developing the Timeline feature. At the time of it's development, a lot of users had been requesting a built in Tween behaviour for Construct for a while, the Timeline feature was not quite ready yet, but it was good enough to re-purpose it's internals, and thus the Tween Behaviour came to be :P

    If you think about it, there is only one thing which is unique to Tweens, and that is the Value Tween. You could do something similar by animating an instance variable in a Timeline, it's just not as obvious. Maybe in the future Timelines will support using a value property track, it is not high priority though.

    To sum it up, Tweens are limited Timelines, anything you can do with a Tween can be done with a Timeline. They offer less functionality, but in exchange are easier to use. Sometimes you just want to get something done quickly, and a tween will get the job done most of the time. If you find that tween's are not quite making the cut though, then you might want to try Timelines.

  • I'll answer in order.

    1) Animations that change numeric values (this includes X and Y properties) are relative by default. So they should work with other behaviours affecting the same instance. Relative timelines apply their changes incrementally, so if there are external objects making changes on the same instance, all of the changes will be joint together.

    This will result in the timeline ending in unexpected positions.

    2) I am not too familiar with animation lingo, but if what you mean by transpose is to use the animation designed in the editor with another instance at runtime, it can be done. You need to use the Set Instance action, which allows you to set the instances that the next timeline you play will use. A more detailed description on it can be found in the manual. C3 has a built in example that uses the action, just search for "timeline" in the Start page.

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/timeline

    3) This would also be solved with the Set Instance action. Right before playing a timeline, use the action and when the timeline starts playing it will do so with the specified instance(s) instead of the ones used in the editor. When you use Set Instance C3 is creating a unique timeline for all the specified instances so all of them will have their unique state.

    If you need to further control these kind of timelines at runtime, you need to remember to use a Tag when playing, then use that to target the timeline that you need to control.

    Hope that is helpful.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, in fact, that is the default behaviour for position properties.

    When an X or Y property track (or one of it parents) is set to use default result mode or explicitly relative result mode and you click on a property keyframe the value you see in the properties bar is relative.

    So in a relative timeline it is common for the first keyframe to hold a value of 0 for they X and Y property tracks. 0 meaning, no changes from it's current place. The subsequent property keyframes will hold values relative to the initial one.

    But I don't think you need to worry about those details.

    To sum it up, if you play a timeline, the animation will be relative to the instance's current position, as long as you are using default or relative result mode.

  • This is not possible, as there is no way of modifying a timeline at runtime.

  • Post what you got right now. Without any context, there are a million different ways to solve this problem.

  • I gave this a try to see how it would work... it does, but it seems a little bit clunky to pass things between C3 arrays and JS arrays.

    https://www.dropbox.com/s/i6kezzhia0g57do/ArraysToAndFromScripts.c3p?dl=0

    This is a very contrived example, it only prints to console, you'll need to bring up dev tools to view the results.

  • You are looking for the System action Create object. It is used to create an instance of an object type at a given position and layer.

  • I used the mouse position as an example. You can replace the mouse coordinates with any other set of coordinates and the bullet will go there. The logic of calculating the angle would still be the same.

  • The problem is that the second trigger overwrites the changes made by the first trigger in the same tick.

    This is what is happening in one tick:

    1) Click

    2) If blue is visible, set blue to invisible and red to visible

    3) If red is visible, set blue to visible and red to invisible

    You can see that the third step is undoing the changes of the second step.

    What you need to do is have only One click trigger, check for the visibility of one of your objects in a Sub event of the trigger and finally have an ELSE block for that sub event.

    If you do it that way only one set of actions will be executed with each click, instead of both.

  • You can just open the .zip file as if it was a .c3p file in C3, infact .c3p files are just .zip files with a different extension :P.

    Some websites complain when you try to upload files with strange file formats, so changing to .zip works. I do it without even thinking now, so I forget a lot of our users don't even know you can do that.

  • If you enable the Default controls in the platform behaviour and disable the Solid behaviour of GameBackground, then the player instance can move.

    I don't know the details of how the solid behaviour is implemented, but I guess if something is inside a solid, it won't be able to move :P

  • The System expression angle is what you are looking for. You pass it two sets of coordinates, a starting position and an ending position, and it will calculate the angle between the two points.

    In the following example project I use it to set the angle of instances using the Bullet behaviour. The bullets are created at the position of the player instance and then an angle is calculated between that position and the mouse pointer position.

    You should be able to accommodate this idea to what you are working on.

    https://www.dropbox.com/s/b6yvnqojlufxfwk/New%20project%20%285%29.c3p?dl=0

  • You can do this using the System expression unixtime to get the current time in milliseconds. Then you need to use a little JS script to get the time in milliseconds of the target date.

    With those two numbers you can calculate the difference between them, and from the result extract all the different parts of the countdown timer.

    This is a little bit more complex than it seems, so I made a little project. Hopefully this will be useful to others aswell.

    https://www.dropbox.com/s/ro5sukq3sytb42x/New%20project%20%284%29.c3p?dl=0

    The project calculates the time remaining until the 1st of January of 2021, but can be adjusted to count down to other dates as well.

  • You saved the project as a folder, so you need to go to Menu -> Project -> Open -> Open local project folder and then select the whole folder than contains your project.

    When you save this way, a .c3p file is not created.

  • For this kind of logic you need to be very specific for it to work as expected. That means checking for the state of ALL the options.

    So if the set of answers is [A, B, C, D and E] and the correct set is [A, B], what you need to check for is A = true and B = true and C = false and D = false and E = false.

    In that case, your answer is correct, in any other case it is wrong.

    If you don't do it that way, you will get unexpected results, as you have experienced already. This is because if you only check for A = true and B = true, the code is not taking into account any of the other options, as long as those two conditions are met, the answer is correct.