Problems w/ Enemy Movement [See latest post]

For questions about using Classic.

Post » Thu Dec 30, 2010 11:13 am

You have on animation revived finished as a sub event to death = to 1, but if death is equal to 1 then......
You need a trigger once under the initial death= condition, with the global changed to 0 right after its created. Then on revived finished could be a separate event.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Dec 31, 2010 5:34 am

[quote="newt":ceni9v4j]You have on animation revived finished as a sub event to death = to 1, but if death is equal to 1 then......
You need a trigger once under the initial death= condition, with the global changed to 0 right after its created. Then on revived finished could be a separate event.[/quote:ceni9v4j]


Umm, I am not sure I followed your advice, but this is what I did:



And everything now works fine (with the exception of me not being able to change which angle plays during the death animation- which turns into an awkward flip if the player is at 180-degrees, dies, and then instantly flips to 0-degrees for the death animation. I tried setting the animation, but that don't seem to work).

EDIT: it seems that that was just the odd bug. Because now i run it and the angle is all fixed. Sometimes odd glitches like that crop up in my test-runs.


It's kinda odd, but with the event sheet I posted on the last page (the wrong previous one), it would create, in the debug, over 90 instances of the main character sprite, and it would glitch up the animation and slow the game down significantly. I really don't know why it would do that, but I'm glad at the least I have a workable (for now? I hope!) solution.

In a dev-bloggish fashion, my next tasks include:

-HUD creation (easy)
-considering whether or not to destroy progress on a level (eg block placement) every time a player dies. I'm weighing costs and benefits.
-designing some enemy sprites, but more importantly, actual cosmetics (backgrounds, environment)
-events corresponding to a Game Over scenario


And I envision future unexpected problems with all of those things! Joy!
But now i celebrate a small victory, ha. Thanks for the help.
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Fri Dec 31, 2010 6:42 am

In the previous event sheet you had it spawn(ing) player(s) when death = 1.
Since death was equal to 1 till the end of the revive animation.
Good thing she didn't ham it up ehh?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Dec 31, 2010 8:30 am

Yikes, no kiddin'.

:mrgreen:
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Tue Jan 04, 2011 12:53 am

Here is yet another conundrum I've got on my hands:

When I had solved the last major problem (the death animation one), I thought I was on easy street. That is, until I noticed a major bug in my programming: if one block was against a wall (and thus, its momentum was set to zero), it would treat all blocks as if they were against the wall on that same side, and thus, it would be impossible to push anything anywhere.


I had originally thought this might be due to the fact that I had used spawn boxes for the blocks as opposed to just having separate instances of the blocks. So I did just that: I got rid of the spawn boxes and the events surrounding them, and just filled the layout with individual boxes. However, it seemed that that solved nothing.

I then realized that I had made a mistake in my original programming: if a block was against the wall, I'd set its speed to 0, when that was entirely unnecessary. I toggled off those outcomes, and things ran smoother.

However, if a block is still against the wall, it still adversely affects all the other blocks on the layout.
Here is the .CAP if anyone wants to take a look.

Here are my events as I have them now:



When one block is against the wall, all other blocks move jerky and oddly, and I am not sure what is causing it. Well, I should clarify: I have a feeling that I have over-specific conditions for the event of a block against the wall, and this is causing a general muck-up on the .CAP's part.

When I run the debug, it shows about 8 or so more instances of block than what is actually there on the layout. Weird. I have a feeling this may have something to do with it as well.

Thanks for any insight.
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Tue Jan 04, 2011 10:56 am

+ ToyGirl: Angle Equal to 0
+ ToyGirl: ToyGirl overlaps Block
-> Block: Set horizontal speed to 205

+ ToyGirl: Angle Equal to 180
+ ToyGirl: ToyGirl overlaps Block
-> Block: Set horizontal speed to -205

That will pick that instance, and move it.
Pick by closest is best used when you don't have a usable collision.

Now if you want that to only happen when key x is down simply add a mouse&keyboard event:
+Key "x" is down
+ ToyGirl: Angle Equal to 0
+ ToyGirl: ToyGirl overlaps Block
-> Block: Set horizontal speed to 205

And then if you only want that to happen when she's not on top of the block:
+ MouseKeyboard: Key X is down
+ ToyGirl: ToyGirl overlaps Block
+ ToyGirl: Angle Equal to 0
+ ToyGirl: Y Greater or equal Block.Y
-> Block: Set horizontal speed to 205
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Jan 05, 2011 5:13 am

Thanks, I cleaned up the pushing events with your suggestions, except instead of Y is greater or equal than Block Y, I did


ToyGirl X is greater than or equal to Block.Left,

in order to keep things smooth-looking (plus, if the player was on a platform a smidgen higher, it wouldn't push at all with Y).



Honestly, the Walls and Blocks event I listed up above (the cause of my previous conundrum) has proved to be such a hassle that I scrapped it. I scrapped it and the Pusher objects too, because they were honestly causing too much trouble, trouble I didn't want to deal with.


It's kinda funny that I put stuff like that in at the beginning because I didn't know how to go about programming what I wanted to do in the first place.
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Thu Jan 06, 2011 5:56 pm

Yup, I kinda hope that this topic serves as a guide for other people; they can learn from my mistakes and the solutions that cool dudes like newt provide.

EDIT:

Why does it seem like people's posts just disappear sometimes? Are people just embarrassed and deleting their stuff?
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Sun Jan 30, 2011 11:12 pm

Sorry to bump an old topic, but I don't feel like making a new topic for such a simple question.

I gave my (first batch of) enemies both custom movement and bullet behavior- mainly, I want them to float back and forth. There are two types right now: one that goes side to side and another that goes up and down. When they collide with the EnemyBouncer object (or rather, the Bouncer Attribute, they're supposed to change directions by 180 degrees.

This is what I got

http://i417.photobucket.com/albums/pp25 ... roblem.jpg
Link because the forum isn't showing the whole image;
(didn't update it to say "collision with Bouncer")

However, when the enemy runs into the EnemyBouncer object, it just wiggles there. My guess is that it is constantly changing its angle. This is probably because I have the conditions for movement set to specific directions, as opposed to a different approach.

I gave up on Bullet behavior because I couldn't find a way to set the direction of the enemies, so I'm trying this instead.


As my post alludes to, I'm trying to do this:

1) set up enemy movement in two ways: side to side and up and down
2) change enemy direction (not angle) when colliding with the Bouncer attribute


Many thanks to those who can help. I did look up topics about the bullet behavior earlier today, but they proved less than helpful.
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests