How do I 'link' sprites together. (SOLVED)!

Get help using Construct 2

Post » Sun Feb 05, 2017 2:00 am

The enemies in my game are composed of multiple parts, they are in a container so when the body spawns everything else spawns with it. Is there a way to 'link' these enemies parts together so when a certain detector sprite is triggering the enemy to jump only the triggered one will jump. (Them being in a container doesn't link them together either.)
I.e. JumpDetector on collision with Wall | Enemy simulate control Jump.
Normally this would cause every enemy to jump but I only want the right one to jump.
What could I possibly try that would link all of the enemy parts together when spawned.
Last edited by currypuff on Sun Feb 05, 2017 11:40 pm, edited 1 time in total.
B
14
S
3
Posts: 55
Reputation: 912

Post » Sun Feb 05, 2017 2:09 am

I'm not sure of exactly what you're trying to do, but I think you could use variables to pick the correct enemy.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Sun Feb 05, 2017 2:23 am

If you are using 8 direction control for your enemies all enemies will jump that are on screen.

You can use Y coordinates to simulate a jump and use that for a character specific behavior event.

On Enemy1 collision with Wall move Enemey1 -40 in Y direction.

Something like that.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Feb 05, 2017 3:44 am

I'm using the platform behaviour and just realized I could use overlapping at offset to jump before the enemy is at the wall. However, I still need to know how to link parts together, I think burvey has the right idea with some sort of variable system, I just don't know what to do.
B
14
S
3
Posts: 55
Reputation: 912

Post » Sun Feb 05, 2017 4:13 am

If you have a capx I would be happy to take a look for you (I'm still not sure exactly what you mean when you say link the parts together but make them act separately from each other).
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Sun Feb 05, 2017 1:38 pm

https://www.dropbox.com/s/w2gm4znmqopvxcu/Demo%20capx.capx?dl=0
Here is a very simple capx demonstrating how setting the animations though the enemies platform.vectorX speed doesn't work with multiple enemies. This is where it needs a linking system to separate different enemies. Hopefully you can understand the problem from what I've given you.
B
14
S
3
Posts: 55
Reputation: 912

Post » Sun Feb 05, 2017 9:28 pm

You have 2 little problems.

1/ You did't pick. Compare two values does not pick an object.

2/ You are right that (even with picking) the logic will not work. As far as my little knowledge goes, this is due the 'deceleration' component. When it 'stops' at solids, it is still decelerating. The push-out-of-solids routine inside the platform behavior is placing it outside the solid, but the actual vector is still decelerating. Fix in the capx. (and no, i dont like the behavior working that way)

https://www.dropbox.com/s/agav1wyuh0uuo ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Feb 05, 2017 9:48 pm

No, i a wrong, its only the picking. I used an 'else' where not applicable.

Correcting myself:
https://www.dropbox.com/s/ap5mxvf5kg3vh ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Feb 05, 2017 11:36 pm

Thanks so much, it's pretty obvious why it wasn't working now. Going to have to ask just out of curiosity, what was that 'ahem' bug in the first capx that was logged in the browser, what does that do?
But again thanks for clearing this up for me.
B
14
S
3
Posts: 55
Reputation: 912

Post » Mon Feb 06, 2017 12:08 am

It captured those that escaped the logic. And i could not wrap my head around why they escaped the logic.
The browser plugin logged the speed (bring up Chrome's console) for those that escaped me .
Console is a window to what happens in the core. Best debug tool ever.

Then i wend outside, in the cold wet air, for a smoke. And it dawned to me.

Never think you are the only struggling scripter. Just keep gooin.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: AllanR, brunopalermo, mOOnpunk, ST314, TheRealDannyyy, tunepunk and 22 guests