TELLES0808's Forum Posts

  • Hello,

    I was reading some tutorials and find the advanced tips and tricks from Whiteclaws

    After the read, I learned something ugly of my point of vision, as a non programmer and a common user of C2.

    ait 0 Seconds

    Wait 0 seconds is designed to postpone until the end of the current run of events (not even the next tick - the same tick, but after all other events).

    Explanation :

    Condition 1

    .. Event1

    .. Event2

    In this case , event 1 & event 2 will occur in the same tick

    Condition 1

    .. Event1

    .. Wait 0 seconds

    .. Event2

    Putting a 0 seconds will insure that Event2 will only occur after Event1 is finished

    Some examples ...

    On start of layout

    .. Create Object1

    .. Set Variable1 to 0

    Here , the two events occur in the same tick , meaning the object is created in the same moment as the variable is changed , The object isn't ready , so the variable is assigned before the object is created ... Doesn't work .

    If you place "Wait 0 seconds" between the two , C2 will spawn the instance , wait until it is ready , and then assign the variable

    This trick is very useful when you need to call a function then call another depending on the result of the last one ...

    scirra.com/tutorials/510/advanced-tips-and-tricks-that-construct2-offers

    I always believed C2 did the actions in sequence, without the necessity of waiting 0, also, I never saw a code using the wait 0 before, but if it's true, all my job will need to be redone, without the mention of my pupils =

    Ashley , do you can clarify if it's really necessary or just a "best practice" or C2 already do the actions in sequence?

    That's annoying create an object on the canvas, like an enemy, where you want setup his sine behavior to meet the route you wanted, and all this event run at same time, what could be a mess and/or miss the sine configuration to that specific object and/or shuffle it with another object spawned on the same event.

    Thank you for any advice!

  • upvoting for a post, or a simple "Thank you" button would be sufficient to increase the post valor, didn't?

  • CleverName81

    I'll explain my personal workflow for games like this:

    Create an invisible sprite as the player, where I will do all the events.

    Create a sprite to be a mask over the real player, it will show all the player animations and is only for this purpose.

    Create the follow behaviors:

    Invisible Player: Platform; Bound to layout;

    Player mask: Pin and deactivate the collision for this object (left menu, on the bottom, lastest option);

    Create the follow instance variables:

    Invisible Player: attack_ON: false; health: 10;

    Configure the platform behavior to meet your requirements.

    Now, follow the events:

    ON START OF LAYOUT > Set player mask.X -> Invisible Player.X;

    Set player mask.Y -> Invisible Player.Y;

    Pin player mask -> Invisible Player;

    Now, go inside the image editor for the player, setup his size and collision polygons to be smaller than the player mask and square, also, put the animation loop OFF;

    On the player mask, import the player frames, also, make all the collision polygons to be square, these polygons will not be used on the game. Put the animation to loop or not, do what you feel better.

    Separate the animation types, like attack, on another animation name.

    Configure the attack animation to be with the frame animation = 0 and setup the looping to not happen.

    On the event sheet, do the follow code:

    On Key X press > Player Mask animation -> "attack";

    animation frame = "your desired frame";

    And ahead.

    With a CAPX it would be easier to explain.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're using floor on create and not on randomizing, maybe is it, I'm not sure if understanded your logic because it's not like it's on the C2 event sheets.

    Do you have any CAPX to share the problem?

  • Rep: 1977 lollllll

    I'm curious about how it will work, anyway, nice job Tom, thank you a lot!

  • Go inside the conditionals to play the sound and select on the system > Play once while true.

  • Ashley

    After exporting the game to dropbox, C2 freezes on the compressing step, and I think it's caused by the same thing, because trying without the dropbox, it works faster and didn't froze.

  • Hello,

    After a issue and a mistake, I lost about 2 hours of work doing very well placed on a player sprite, to meet all the requirements I wanted.

    What Happened:

    Part of the problem whas this issue: https://www.scirra.com/forum/r124-apply-points-to-all-the-frames_topic66125.html

    The feature request:

    Would be great to have an undo button inside the image editor, but I know, this is on the to do list;

    While it don't come out, another feature would be nice: The exclude image point of all the frames and/or animations;

    Yes, if you make a image point plus that amount you needed and apply it to all the frames, or, changed your mind about a point, you'll need to delete this image point one by one in every sprite/animation where it was replicated.

    With a similar feature of that to apply, if you have the feature to delete a deserved point would be great, so, you just put the "NAME" or the point index inside a field and it help you to make the repetitive job without mistakes...

    Thank you, and I hope this idea get some efforts.

  • Link to .capx file (required!):

    I know, but the CAPX for this issue will really not help, because all the information will be clean after saved.

    Steps to reproduce:

    1. Start a new project;

    2. Create a sprite;

    3. Create 2 new frames;

    4. Create 2 or 3 image points;

    5. Apply them to all the frames;

    6. Close the image editor;

    7. Undo what you did;

    8. Open the editor;

    Observed result:

    9. Look inside the second and ahead, frames, they are with the image points, but the first one undo correctly.

    Expected result:

    10. The points to be undo;

    Operating system & service pack:

    W8 32bits

    Construct 2 version:

        R124

    [tube]http://www.youtube.com/watch?v=14j1xpCbwQY[/tube]

  • Ashley

    What's the best practice to make it? I was thinking about this:

    But everybody is reporting a black screen instead of the game going ahead.

    goo.gl/oT46J

  • Ashley, sorry for the double post, it was proposital.

    Updated with a Video:

    [tube]http://www.youtube.com/watch?v=yjEKthyKqrk[/tube]

    Also, after closing the project and opening again, it was with the sprites with the original blue box, and not like shown before on the video.

    Here is the CAPX: dl.dropbox.com/u/47035927/temp/first%20frame%20issue.capx

  • I did an eventsheet exclusively for UI and then I INCLUDE it to the STAGE eventsheet and works flawless too.

  • Sorry Ashley, I sent the CAPX by email.

    Here is an video of how the process is happening. I think a CAPX without the video wouldn't help that much too.

    [tube]http://www.youtube.com/watch?v=RdiUbnukD1c[/tube]

  • I got the crash on exit 4 times in less than 2 hours of work, hopefull, the original file was saved correct.