Pick All is not choosing all instances of the chosen Object

0 favourites
  • 4 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Problem Description

    I use Pick All and then I reference all instances of 1 object to determine the distance another object is to any of them and this is not working.

    Attach a Capx

    please find he Capx linked has to be zipped as per the upload constraints of file host :

    http://snk.to/f-c7n8gfik

    Description of Capx

    player walks around with Arrow Keys.. Attacks with Spacebar.

    Enemies should be spawning in and being forced to remain 1000px from each other spawned enemies is capped.

    I have further tested this and can confirm this is an issue as I manually specify all possible IID's for instances that can spawn and suddenly they function as expected.. but pickall should have chosen all IID's and performed the same function.

    Steps to Reproduce Bug

    • Step 1 - run the capx
    • Step 2 - walk around and notice how many enemy objects are overlapping.

    Observed Result

    As per above enemies are spawning in on top of each other even though the code should be forcing them not to be able to do this with 2 different conditions.. so I don't get how it can unless there is a bug.

    Expected Result

    Enemies to never spawn overlapped

    Affected Browsers

    • Chrome: (YES/) others prolly the same I just only tested in chrome.

    Operating System and Service Pack

    Win 8.1

    Construct 2 Version ID

    r197

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing as not a bug, your events are wrong. You measure the distance with 'compare values', and since you have picked all enemies, it uses whichever is the first one when you retrieve an expression from Enemy (such as Enemy.X and Enemy.Y in the distance expression). So it can spawn an enemy anywhere 1000px away from the first enemy only, not any enemy. This is what your events say and it is working correctly.

  • Oh so there is no way to compare the distance to all instances of an object without specifying their unique iid`s. Well sorry for the mizspodt i somehow thought based on the documentation i read that pickall would make it work but pickall must only be relant to actions

  • Instead of "Pick all" use "For each", and this way you can get to compare the distance the way you did it for each instance.

    In this case you need to specify you want the "compare two values" condition to be applied to all instances.

    On another note, capx files are already zip files. It sounds like all your host wants is a renaming to .zip not an actual compressed file.

    "Pick all" helps to get back to picking all the instances of an object type once you're already deep in an event/sub event that was picking only a specific instance and you find yourself needing to pick "back" all the instance, and possibly specifically pick them again.

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