Follow up: Animations

This forum is currently in read-only mode.
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I'm still having trouble manipulating basic animations. In the debugger, a sprite's animation is always registered as "animation." Is this why Construct isn't returning to default, or following my orders to change the animation on command?

  • Okay, I'm getting results by using yet another brute force method. Setting single frame animations based on a private variable.

    Here's another question. I'm trying to make a "double click" of a control using yet another variable. Variable remains on for a short about on time, as planned, and is supposed to trigger a separate animation when the key is pressed again while the variable remains on. Currently, it is failing to do so.

    I have to be missing something..

  • Ummm why dont you make new animation and then event on something like Start of layout -> Change animation to "something", Start Animation

  • The problem seems to be that because construct is not reporting the animation name, I'm very limited in controlling which animations trigger under which conditions. For instance:

    While Animation is NOT "Spin"

    Value Sprite.tilt is 4

    -Sprite: Set animation to "Tilt"

    -(play current animation?);

    Value Sprite.doublepress is greater than 0

    On control "Spin Right" is pressed

    -Sprite: Set animation to "Spin"

    -(play current animation?);

    The above events will always trigger the Tilt animations, over-riding the Spin animation instantly, because Construct cannot determine which animation is playing (or not playing, in this case).

    I can always load another variable to compensate, but I'm getting into upwards of 30 events for what should be done is about 10.

  • Try this:

    + Condition
    + TRIGGER ONCE
      - Set animation frame to 1
      - Set animation to "foo"
    [/code:3d1szepe]
    
    This will help if you're accidentally setting your animation repeatedly upon triggering the condition (Trigger once).  This will keep your animation from playing if it's not there because you'll be setting it repeatedly.
    
    The Set frame is there just in case your animations have different numbers of frames or if they depend on starting at frame 1 (such as a non-looping animation).
    
    As for the double-click control, I'd test and make sure your control is working on something other than animations until you get your animation problems sorted, such as getting feedback from a text box that the control was completed successfully.
  • Deadeye, we're making progress.

    Your method works when outside of the animation system. I'm still hindered by the one control I need that isn't working.

    Coming out of a "Spin" animation, I need to set everything back to normal.

    + Animation "Spin Right" finished

    • Set Sprite.is_spinning to 0

    The value never returns to 0, because the animation never reports that is has finished. This produces an animation freeze as well - even under no restrictions, a non-looping animation will refuse to return to default.

    I can work around this using discrete timers, but I'd rather do things right.

  • Wrargh! I was finally able to get what I wanted, but i have to use unreliable means of achieving this effect. For anyone even remotely interested, and for my future reference, here is what I came up with to get the "Arwing tilt and spin" system to work without using animation registers.

    http://strouperman.com/Special/StarFox_ ... mation.cap

    (if you get 404, add the www)

    To test it:

    Arwing moves with WSAD

    Tilt the ship left with LEFT SHIFT

    Tilt the ship right with J

    Fire lasers with G (numbers 1, 2, and 3 change laser type)

    To do a barrel roll, double-tap the tilt buttons.

    ::Arwing moves faster in the direction of tilt.

    ::Arwing moves slower opposite direction of tilt.

    ::Spinning the Arwing temporarily super-spikes movement acceleration.

    Combining these techniques allows for a (hopefully) tight and precise control scheme.

  • I can work around this using discrete timers, but I'd rather do things right.

    You might just have to use those timers, at least for now. It looks like you found a bug.

    Here's a small .cap showing the bug in action:

    http://www.mediafire.com/?1kxjwmhxdjm

    Do you want to post it to Source Forge or should I?

    Edit:

    Urgh, you made a new post while I was testing stuff

    To do a barrel roll, double-tap the tilt buttons.

    A BARREL ROLL?!? Okay, downloading now.

  • YES, a barrel roll.

    This is finally starting to feel somewhat like a real game.

    If you could sourceforge it this time, I'd be grateful. I can't quite tear myself away from what I'm doing right now. Thanks.

  • Okay... After playing it here are my thoughts:

    The graphics are nice and crisp. The subtle left/right scrolling of the starfield when you're moving is pretty slick. The controls are responsive and quick... with one exception. Which leads me to my crit:

    Having the tilt mapped to two different buttons seems a little clunky, especially since the left shift is so close to my WASD keys. It's a little difficult to control movement and tilting and barrel rolling all with my left hand at once. If I could make one suggestion? You could probably get away with just one tilt button. Used contextually, it could make you tilt left if you're moving left, or right if you're moving right. Additionally, if you're not currently moving left or right, it could tilt in the direction you were last moving.

    Just an idea.

    And yeah, I'll go ahead and submit the bug.

  • I see what you mean and, normally, I'd agree. However, keeping true to my source material, there are some gameplay devices that will eventually require having separate tilt keys. Also, and more importantly, consolidating the tilt keys into one would decrease the [strike]difficulty[/strike] expertise of movement substantially. What's to stop the player from holding the key continuously?

    Things will be much better when controls can be mapped by the user, and even more so when gamepad support is added to Construct. Normally the tilt functions are handled by a controller's shoulder buttons, and keeping them that way is what lead to my current choice of default control scheme. I know very few people use WSAD, but there are far more people who don't have keyboards with numberpads (most laptops), so I can't use LEFT SHIFT and NUMBERPAD 0 and expect my game to run on all platforms.

    If it would help you, try changing the left tilt to the F key. Or, should you find a better solution that still allows me to have separate tilt buttons, I will listen with undivided attention.

    EDIT:

    It's a little difficult to control movement and tilting and barrel rolling all with my left hand at once.

    That's because you're not supposed to. The final control scheme uses the G and H keys for weapons and bombs. ideally, you use WSAD and shift with your left hand, and G H and J with your right hand. This is meant to simulate a game controller layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay, how's this for a control scheme:

    WASD for movement

    Up arrow for shoot*

    Left/Right arrows for tilt left/right*

    Down arrow to cycle weapons*

    That way you can have both hands resting in a comfortable, ergonomic position on the keyboard, with all keys within easy reach, and still have separate tilt controls.

    *

    Alternately you could use IJKL or whatever. Just, you know, something where a person's hands can rest naturally. Though I suppose when Construct gets custom controls at runtime it won't make much difference.

  • Actually, I like that idea a lot. It's something I'd have to get used to, but it makes a lot more sense. I'll incorporate it into the next build.

    Down arrow will probably be used to fire bombs. Seeing as how the game is transitioning to 2D from its 3D original, I don't need to have boost or brake commands, and there are no weapons to cycle through.

    2 fire buttons

    2 tilt buttons

    4 directionals

    Deadeye, PM me your mailing address. You just earned a cookie.

  • <img src="http://i25.tinypic.com/2ajb4nk.jpg">

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)