Animation not looping after "set animation"

For questions about using Classic.

Post » Fri Feb 19, 2010 1:06 am

I want to apologize in advance for all of my "HELP!" posts. I promise I'm looking all over for my answers... I'm either not grasping some concepts or I got stuck on a bad build (in regards this post).

Question 1:
Anyway, I'm using the "Platform" behavior with a custom animation set (running in addition to walking). I have create an event to set the "Running" animation when Shift is held down. Well, it switches to the first frame and freezes. My character will just glide around in Frame 1. However if I jump while holding Shift, it loops through the frames... until I land then it's back to frame one. How can I fix this?

Here is my cap file: http://dl.dropbox.com/u/415838/contruct ... Scroll.cap

Question 2:
In my above example, my Running animation has no tag (only Stopped, Jumping, Walking, Falling). Is there a way to create custom tags?
B
3
G
2
Posts: 27
Reputation: 729

Post » Fri Feb 19, 2010 6:22 am

As a response to both of your questions, you need to get rid of the animation tags (set them all to None) and use events to control your animations. Animation tags only work if you have Walking, Jumping, Falling, and Stopped animations. That's it. You can't have more than that because the platform movement isn't designed to recognize any more than that. In other words, you can't use two different kinds of "walk" animations when you're using tags, which is essentially what you're doing.

You need to use events to control your animations, and you need to beef up the logic a bit:

http://dl.dropbox.com/u/529356/SideScroll.cap
v0.99.82

Also, you really need to make a separate hitbox for your player. Or else change the collision mask on the sprite. You can't run around with per-pixel collision on an animated platform sprite like that, you're going to get bigtime glitchy results. Make a single rectangular hitbox that doesn't change size and use that instead.

Oh, and you don't need a giant black Tiled Background to change the color of the background, you can just change the layout color.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Feb 19, 2010 1:03 pm

Well, I had another post talking about issues with collision masks because I was going to do just that (for the platforms). Now that I'm using x.x.82 Unstable I can properly edit masks now (without exporting).

Thank you for the new code! This is a major improvement from what I had before. I've been teaching myself Python for the last few weeks (first programming language), so I'm still getting used to the actual scripting. I'm not aware of the many functions available in the Construct code... yet!

Thanks again for your help.
B
3
G
2
Posts: 27
Reputation: 729

Post » Sat Feb 20, 2010 6:11 pm

Deadeye (or anyone who can answer) - In your demo .cap, you used the following code:

[code:3p6e0znj]abs(Player[Platform].VectorX)[/code:3p6e0znj]

I know that is "The absolute value of 'VextorX' for the 'Platform' attribute of the 'Player' object" (I may be fudging some official terminology here). My question is: How can you see the available values to measure? I.E. - Where did you find the "VectorX" piece? I see this particular one happens to be mentioned here, but what about the many other hidden values? I don't see them in the debugger or listed elsewhere.
B
3
G
2
Posts: 27
Reputation: 729

Post » Sat Feb 20, 2010 6:19 pm

when building expressions you can doubleclick on the objects on the bar below, this will take you to a list of their available expressions
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Feb 20, 2010 6:29 pm

Ah, I had looked there and was looking for something "vector-y"... Get X component of motion did it.

Thank you!
B
3
G
2
Posts: 27
Reputation: 729

Post » Sat Feb 20, 2010 6:36 pm

Well, they're not really "hidden" exactly. Some values have built-in conditions to compare them, and some don't.

But okay, here's how you can find them:

If you can't find one of the expressions you need in a condition, you can use a compare condition. A "Pick by comparison" for the object will work, or you can use a System compare. (System compare won't pick the object though, so keep that in mind.)



Okay, the parameters for the compare condition will come up now. Highlight the first field, and then double-click on the object for which you need the expression:



A new window will pop up allowing you to choose the expression you need. If your object has a behavior or an effect on it there will be a tab at the top for those expressions.



Double-click the one you want and it will populate the parameter you selected:



See, easy :)

You can also just type it in if you know the expression. You can also find a list of expressions for an object by right-clicking it in the layout and selecting "Object information." It will bring up this window:



The "Description" field shows the expression names rather than the name field, kind of backwards :P. But they're there. Also there should be a list of expressions for objects and behaviors and such on the wiki, but it's likely out of date. I think I may go and fill some in later while I have my coffee now that I think about it.



DAMMIT IT MADSTER I SPENT SO MUCH TIME ON THIS POST :x
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Feb 20, 2010 6:42 pm

No don't get upset! This was an excellent post and provides even more wonderful information for myself and others! Thanks again, guys!
B
3
G
2
Posts: 27
Reputation: 729

Post » Sat Feb 20, 2010 6:51 pm

No. My blood lust must be sated. When I find madster I will tear his bones from his body and make a fancy hat out of them :twisted:
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Feb 20, 2010 7:11 pm

I'm a fancy hat :'(

"Here lies Madster. He protects you from the sun. FPS40."
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests