What is causing my sprite to move? (.gif included)

Get help using Construct 2

Post » Wed Jan 14, 2015 8:10 am

I'm having a major problem and I have no explanation for the cause of it. I figured someone must have gone through similar troubles at some point. I would really appreciate the help because this is the first time I've been stuck on something longer than a day.

This is the second version at the attempt of a more complex enemy sprite. The last revision had failed because of the same reason as this one, except now it's organized more for me to see the complete problem.

What it's supposed to do: The sword is supposed to launch itself at a -45 degree angle, and stop movement after 0.25 seconds. This is supposed to be about half-way in distance. As you can see, after the 0.25 second point, it continues to move in a weird, inchy-sporadic fashion that I can't explain.

What makes this more messed up, is that I went into debug mode and checked the sword's properties after the 0.25 second mark. "State" was set to "Stop", and the Custom Movement behavior was disabled.

The only movement behavior on the sword is Custom Movement.

Image

Image
B
21
S
5
Posts: 109
Reputation: 1,500

Post » Wed Jan 14, 2015 9:23 am

After 0.25 secs, try to zero out Accelerate & Overal speed of CustomMovement
It would be better to disabled CustomeMovement into separate condition under State="stop".
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Thu Jan 15, 2015 2:22 pm

Okay I did that and it worked to some effect, pretty much I'm faced with a new problem:

For some reason, the orange enemy sprite needs to have a Platformer behavior for any of these functions to kind of work, even though I don't need a Platformer movement at all.

I believe it is the unnecessary Platformer behavior that is screwing with everything, but when I don't have a Platformer behavior attached to it nothing even starts, the sprite just stays there.

Image

This is the beginning behavior to the event.

When the Platformer behavior is removed/disabled, The mirroring does not work, it stays not awake, and the sprite is locked to animation frame '1' when the player is in distance even though I specifically try to lock it to 0.

I think this is the root of the problem.
B
21
S
5
Posts: 109
Reputation: 1,500

Post » Thu Jan 15, 2015 10:22 pm

Have You set the animation speed to 0?
Seems doesn't have any issue with mine:
Image

Try make the player to jump in my capx, compare it with Yours
lancer.capx
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Fri Jan 16, 2015 9:06 pm

Yeah, it turns out something it just completely screwed with mine. Your non-platformer sprite mirrors when I jump over it, yet for seemingly no reason at all mine cannot do that without the platformer behavior.

I might just have to scrap the entire thing and start fresh, something is definitely wrong here.
B
21
S
5
Posts: 109
Reputation: 1,500

Post » Fri Jan 16, 2015 9:10 pm

Could any potential accidental button-presses cause anything like this?
B
21
S
5
Posts: 109
Reputation: 1,500

Post » Fri Jan 16, 2015 10:05 pm

Ah if you don't mind, you can send your capx to me and I wiil examine it for you.
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Sat Jan 17, 2015 8:10 pm

Can't PM yet, so here, I removed pretty much everything else in the game except the player and this enemy.

Don't worry at all about any other additional functions of the enemy, it's the simple fact that it needs a Platformer behavior to mirror that's causing all of my issues. I've tested it with the other enemies too, it's the same deal.

I started a new project from scratch, made three sprites and sure enough, it worked just like yours. So it must be something here that I'm not seeing. If you can't find a solution, I'll just start over and copy all the art assets.
You do not have the required permissions to view the files attached to this post.
B
21
S
5
Posts: 109
Reputation: 1,500

Post » Sat Jan 17, 2015 9:13 pm

Okay first found that to make the enemy mirrored, you must set the awake to true from properties panel. It work that way even without adding platformer behaviour.

EDIT
Got it! It had something to do with LineOfSight. By default LineOfSight sees only into Solid object. The Player has not Solid behaviour. So I Changed the Obstacles properties from Solids to Custom. You just need to do that and everything work just fine :mrgreen:
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Sat Jan 17, 2015 11:09 pm

That almost works!

Now the issue is that the Enemy can see the player all the time, even when the player is behind a solid wall.

After I add "On Start of Layout / On Enemy Created -> Add SolidTile to LOS Obstacles", the Enemy takes on the stuck behavior again.
B
21
S
5
Posts: 109
Reputation: 1,500

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests