DiegoM's Forum Posts

  • Abwuds

    That is correct.

    If you just play a timeline, Construct assumes you want to play the timeline that was created in the editor. This means it will only work with the specific instance that was used in the editor to create the animation.

    When you use Set Instance what you are doing is replace the instance/s used in the editor, with something else, that means the animation can be used elsewhere.

    It's a rather important action, maybe it should be highlighted.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could create a function that used the Javascript Date object, and with that get the day of the week. It is also possible to do the calculation to extract the day from the current unix time using Construct's unixtime expression, but I think it is much easier to use the Date object.

    Bellow is an example project showing a function that returns the current day of the week. Notice that the day is returned as a number between 0 and 6. So the results are like this:

    • Sunday = 0
    • Monday = 1
    • Tuesday = 2
    • Wednesday = 3
    • Thrusday = 4
    • Friday = 5
    • Saturday = 6

    https://www.dropbox.com/s/hjrt07lhwnt0xob/DayOfTheWeek.c3p?dl=0

    If you are interested in what else you can do with the Date object, you can check the full documentation from Mozilla here.

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

  • Por favor postea en ingles, es mas facil obtener ayuda de esa forma, el resto de los usuarios lo hacen y muchos de ellos tampoco hablan ingles. Si no hablas/escribis ingles, te podes ayudar con Google Translate, no es perfecto, pero funciona bastante bien para hacerse entender. Podes postear tu mensaje original y una traduccion debajo.

    En cuanto a tu problema, lo mejor es postear lo que tenes hasta el momento, tu proyecto o una captura de pantalla con los eventos que no funcionan como queres. De esa forma es mucho mas facil obtener ayuda.

    This is an english forum, we appreciate if all our users post in english. If you can't speak english, try using Google translate, it is not perfect but works pretty well. You can post your original message and a translation below.

    As for your problem, the best is to post what you got now, your project or a screenshot showing the events that are not working as you would like them to.

    To anyone reading this that might want to help, he wants to make something like Megaman's charge shot.

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

  • 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