Two pinning problems

Get help using Construct 2

Post » Mon Oct 05, 2015 11:42 pm

It exist two instances in my project. where the pinning doesn't work properly.

Here is my capx: https://www.dropbox.com/s/4ks20oboupgz8 ... .capx?dl=0


Note that this isn't saved in the latest version of Construct 2 so if you have that you need to download a earlier version to solve this.
Please don't comment on my project just solve my problems.

The first problem is in Layout 5. It's about Sprite and Sprite 67. The events related to the sprites is Event Sheet 4 Event 80-94. 94 is the most most important event however. I want Sprite 67 to Pin to Sprites position and angle. Instead when i test it i not positioned on Sprite. It's instead positioned far over Sprite. I want you to either tell me how to fix this or fix it yourself.


The second problem is in Layout 9. Sprite 123 and 124 is pinned to Sprite 122. I have made it so Sprite 122 rotates. When i test, Sprite 123 and 124 doesn't follow Sprite 122s rotation and instead sticks to their original position. How can i make them rotate whit Sprite 122?
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Tue Oct 06, 2015 12:40 am

208 MB ??

Couldn't you make the capx bigger?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 06, 2015 2:30 am

LittleStain wrote:208 MB ??

Couldn't you make the capx bigger?


Please do not be rude. My capx is big becuse i make my layouts bigger then neccissary. But it shouldn't be too big so what,s the problem? Can you not open it or what?
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Tue Oct 06, 2015 3:17 am

I'm sorry..
In the last few years, while trying to help users I've downloaded hundreds of capx from this forum and this is the largest yet..

After opening it, it became clear that was mostly because of the huge images and the amount thereof..
But ofcourse,why would 415.5MB estimated memory usage be too big?

Oh I haven't found the pinning issue yet, neither in the game nor in the event sheet..
Why don't you name the sprites?
Having them all called spriteXX is pretty hard to read
Also grouping similar events would make reading the event sheet a lot easier..
Maybe using families and functions, tilemap and/or tiled backgrounds?

Just some friendly advice..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 06, 2015 4:14 am

You can't assume that Sprite67 knows which Sprite to pin to just because it is on top of it. Add a "Foreach Sprite" and a "Sprite67 Is overlapping Sprite", then do the pinning. This picks each parent sprite and finds the overlapping child so it can pin 1:1. A Container might also work, instead.

You must have uploaded an earlier CAPX, as there is no Layout 9 or Spites 122,123,124.
ImageImageImage
B
71
S
22
G
257
Posts: 3,791
Reputation: 142,698

Post » Tue Oct 06, 2015 1:27 pm

blackhornet wrote:You can't assume that Sprite67 knows which Sprite to pin to just because it is on top of it. Add a "Foreach Sprite" and a "Sprite67 Is overlapping Sprite", then do the pinning. This picks each parent sprite and finds the overlapping child so it can pin 1:1. A Container might also work, instead.

You must have uploaded an earlier CAPX, as there is no Layout 9 or Spites 122,123,124.



My mistake.

https://www.dropbox.com/s/4ks20oboupgz8 ... .capx?dl=0

Here is the newest capx. You don't need to download the capx fi you don't need to. Just answer me why sprite 123 and 124 doesn't pin to sprite 122 and follow it when it rotates. I have read your answer on the first problem. But did you try layout 5 to see how Sprite 67 reacts? I have placed the player rigth next to it so you should see it transport up in the air immediatly. If pinning works like you told do all pinning require that. I have pinned sprites whitout needing to do that. And i told you to not comment on my project. Telling me that my images are too big and that i have too many sprites and shouldn't call them all sprites is commenting. So now i feel a little worse considering i probably didn't need to share the capx. I just did it in case it was needed to solve the problem.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Tue Oct 06, 2015 1:49 pm

Calfuso wrote: And i told you to not comment on my project. Telling me that my images are too big and that i have too many sprites and shouldn't call them all sprites is commenting.


I'm sorry for giving unsollicited advice..

Pinning works like @blackhornet explains, actually all events do..
You have to reference the sprite you intend to do actions on in the event..

So if you use the pin action, it should be clear which instance of the object you want to pin to..
This is called picking..
In your case you could use overlap or pick nearest..

If there is only one instance of the object to pin to on the layout, automatically the right object will be selected, ofcourse..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 06, 2015 2:25 pm

LittleStain wrote:
Calfuso wrote: And i told you to not comment on my project. Telling me that my images are too big and that i have too many sprites and shouldn't call them all sprites is commenting.


I'm sorry for giving unsollicited advice..

Pinning works like @blackhornet explains, actually all events do..
You have to reference the sprite you intend to do actions on in the event..

So if you use the pin action, it should be clear which instance of the object you want to pin to..
This is called picking..
In your case you could use overlap or pick nearest..

If there is only one instance of the object to pin to on the layout, automatically the right object will be selected, ofcourse..



Since i am too stupid or not good enough whit using Construct 2 i don't understand how to do that so if you wwant to help me you need to create such a event that makes the pinning work and share it.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Tue Oct 06, 2015 2:33 pm

You're not stupid, you are learning..
We all have to learn things before we can do them..

An event like this would work:

System for each (object you want to pin)
(object you want to pin to) pick nearest to x = (object you want to pin).x , y= (object you want to pin).y
>> (object you want to pin) pin to (object you want to pin to)

This is if the object you want to pin to is the nearest instance to the object you want to pin..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 06, 2015 3:49 pm

I have to commend you @LittleStain for the way you handled this demanding OP , your patience and tolerance is admirable .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499


Return to How do I....?

Who is online

Users browsing this forum: t redeemed t and 3 guests