Two pinning problems

0 favourites
  • 10 posts
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 208 MB ??

    Couldn't you make the capx bigger?

  • 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?

  • 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..

  • 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.

  • 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.

  • 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..

  • > 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.

  • 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 have to commend you LittleStain for the way you handled this demanding OP , your patience and tolerance is admirable .

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)