Small Question, Object Reference?

For questions about using Classic.

Post » Sun May 10, 2009 7:30 pm

Hi there, new to Construct, but really liking it so far. I've run into the problem of wanting to reference any solid object that collides/overlaps with a sprite I have. The aim is to have an area of detection around the player, that will pop up info about surrounding objects, for the purpose of this exam, just the objects height & width.

So I'm making a conditional, System > Is Overlapping (Advanced) > Then I'm selecting my colliding Sensor sprite for Object A & Attribute Solid for Object B. I'm also selecting to "Not Pick Object A", and to "Pick Object B" as this image will show.

Now in my next step was to make a bit of text called PopUp, at the solid object's X,Y coords with a value of that solid object's Height,Width properties.

But I've got no clue how to reference that "picked" object with the Solid attribute. I've searched and searched on the wiki, to no avail. What would I use in this second example image, to reference the Solid attributed object rather than Thing.X or Thing.Y(for example of course, I didn't think those would work).

I might be going about the whole "Picked" object thing, so any help would be appreciated. Thanks for the time it took to read that.
B
2
G
3
Posts: 15
Reputation: 880

Post » Sun May 10, 2009 7:39 pm

You can't pick Attributes in the events. You want to use Families for that.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sun May 10, 2009 9:00 pm

I just ran a test and this worked. Thanks for the quick response. Still a little weird that you can select by attributes but not reference them.
B
2
G
3
Posts: 15
Reputation: 880

Post » Sun May 10, 2009 9:48 pm

Check out the Wiki references for Families and Attributes; they're designed for different purposes and Families are what you want when you need to use them with picking in the event sheets. The fact objects from different plugins (eg. Sprites and Tiled Backgrounds) can be in the same attribute, but can't be in the same family, makes it impossible to have picking with attributes.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests