Picking all members of a family, and then filter.

Get help using Construct 2

Post » Fri May 31, 2013 1:47 am

Hello forum!

I have an event like so:

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

And the family members look like so:

[code]# THE FAMILY
FamGuns:
   Gun1: fam_instance_variable = 0
   Gun2: fam_instance_variable = 1
   Gun3: fam_instance_variable = 2
[/code]

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!
B
3
Posts: 5
Reputation: 185

Post » Fri May 31, 2013 2:02 am

The error is probably in the execution of your intent. Post a .capx so we can see your actual code instead of that pseudo.
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Fri May 31, 2013 2:42 am

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



webgovernor2013-05-31 02:46:24
B
3
Posts: 5
Reputation: 185

Post » Fri May 31, 2013 2:57 am

Here's the CAPX Contruct2-ComparisonNotWorking.capx.

Thanks for the help!
B
3
Posts: 5
Reputation: 185

Post » Fri May 31, 2013 3:07 am

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!
B
3
Posts: 5
Reputation: 185


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 45 guests