Picking all members of a family, and then filter.

0 favourites
  • 5 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Hello forum!

    I have an event like so:

    # THE EVENT
    Pick all FamGuns:
        FamGuns.fam_instance_variable = 0:
            print(FamGuns.fam_instance_variable & "==" & 0)
    

    And the family members look like so:

    # THE FAMILY
    FamGuns:
       Gun1: fam_instance_variable = 0
       Gun2: fam_instance_variable = 1
       Gun3: fam_instance_variable = 2
    

    But the thing is... this event randomly prints one of the following: "2==0", "1==0", "0==0". This confuses me.

    I've read Families and System Conditions, but I appear to not be capable of understanding how this works from this material.

    Thanks in advance!

  • The error is probably in the execution of your intent. Post a .capx so we can see your actual code instead of that pseudo.

  • The capx is about 500 events and consists of the entirety of my game (http://www.kongregate.com/games/webgovernor/ned-vs-zed). I'll re-create it in a smaller project.

    Update: This doesn't work either (it pins a random member of FamGuns).

    <img src="http://i.imgur.com/zR2RUES.png1" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's the CAPX Contruct2-ComparisonNotWorking.capx.

    Thanks for the help!

  • Solved! (Sort of).

    Basically, the Spawn or Create do not appear to work as part of the "Pick" event -- which makes sense, because that doesn't have instance variables populated. So, instead, I just move it to the position of the image point that I want to attach to.

    Sorry for the stupid question!

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