Rope & Chain - element collides instancing issue

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I am having a bit of an issue with the rope and chain's conditions.

    I have a little diving game with some tentacles that reach up from the deep to attack the player. When they are reaching up, I want to have them able to grab any fish in the water and drag them away as well, and it ALMOST works XD
    The way I have it set up is, when an element collides with one of the fish, the fish is switched to a physics-static movement type and then attached using climb>attach at current element. I also need to use a flag or alterable value change on the fish object in order to prevent the action from repeating.

    So the whole event reads something like:

    IF
    "tentacle" element collides with "fish"
    & "fish" alterable value A=0

    THEN
    "fish" set alterable value A=1
    "fish" bring to front
    "fish" set movement to Movement # 1
    "tentacle" attach "fish" to rope at current element, at distance 0


    The problem is that the game seems to have trouble (inconsistently) picking the right instance of the fish, and eventually it will decide to attach every fish of a type on a collision. This effect gets worse when I apply the needed flag or alterable value condition, but it exists even without it.

    I have tried applying various arrangements of either for-each loops on the fish and for-each-element loops on the chains/tentacles, but depending on the order of the conditions they either have no effect or negate the collision entirely.
    I am almost willing to give up on this (relatively minor) feature but it honestly just looks so nice and good the 10% of the time it is working :P

    I can definitely provide a build if anyone wants to check it out, any help would be super very appreciated! Thanks :D

  • Scope! I knew there was a term for what I was trying to describe and I think this is a scoping issue!
    I've read a mess of posts on the issue and tried applying some fixes, but nothing seems to work :\
    The most obvious fix seems to be applying a for-each loop event to try to scope the fishes, but that breaks the collision with the tentacle element entirely.
    I'm also confused why the scope is broken, when an alterable value call should not do that? Is this possibly a bug with the rope and chain object?

  • I can't reproduce the problem in a simple application. I tried this:

    Code
    * Physics - Rope and Chain: An element collides with Fish
    	Fish : Destroy

    And only the colliding Fish object is deleted, not all objects.

    Can you post a simple MFA that shows the problem?

  • Oof, you're right. I made a simpler project with just the interaction I'm looking for and it seems to work. The scoping issue must be created somewhere else but I can't for the life of me figure out where :\
    I've tried going through and deactivating all the events that involve fastloops, foreach loops, and qualifiers and nothing seems to affect it, I'm not sure what else to look for

    the event still reads more or less the same as written above :\

    I'm linking two builds here, one is the minigame I'm working on with the broken effects, and the other is a quickly made mockup of what I'm going for (which works)
    I'm also going to link the .MFAs in case anyone is so generous they want to go digging for the problem :P
    Thank you so much for looking into this Yves! and Thanks anyone who has any idea what might cause this <3

    Please login to see this link.
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • Still struggling with this :\

    I've tried deleting all kinds of events, including every foreach and fastloop in the frame and nothing seems to have any effect :|
    If I add in some "Pick "fishObject" at random" conditions it seems to improve things but they always eventually break.

    I've tried reading through every resource I can find on scoping and none seem to suggest anything that should break it in this case.
    Are there any community resources on this issue I'm missing? Any really good threads with a lot of solutions?

    (So far I think the best I've found is this: Please login to see this link.)

  • The answer is; you make a collision between clickteams build in collision system and the box2d physics (rope and chain object). This cannot work, dont know why they even allow this!? Replace your 'bouncing ball' with 'physics bouncing ball' and you will see all objects attach always, the chain will break at some point with lot of high density objects but thats another story.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!