How do you make your own attributes

For questions about using Classic.

Post » Sat Aug 30, 2008 5:29 pm

Attributes seem like they might be useful, but I have no idea how to use them because they don't show up in the event editor, am I missing something?
The the extent to which the wiki goes into it isnt exactly enormous :mrgreen: : "You can add your own attributes and use them in the event sheet editor, but they do not have any built-in effect. "
Also what makes them different from familys? - which seem to have pretty much the same use apart from one is a tickbox and one isn't.
I'd have thought you'd edit the attribute in its own kindof global event sheet or something... I dunno.
The only place where they do show up is the expression editor bit which also shows all the global objects etc. (but nowhere else does)
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Sat Aug 30, 2008 5:43 pm

Attributes are kind of an even more general form of families. Families all have to be the same plugin type eg. Sprites - Attributes don't have to be. They are literally an on/off flag - like you can set a bunch of any old objects to "Solid", and then make an event "Bullet collides with solid". Then "Solid" can refer to boxes, sprites, tiled backgrounds, or anything, which it couldn't if it were a family. However, you can't use events to relate to an attribute in general like you can with a family.

You can edit attributes by the 'Edit attributes' link in object properties (at the bottom of the list of checkboxes), or in application properties.

The built-in attributes usually have an effect on various behaviors or plugins. The Platform movement won't fall through 'Solid's, the screen centres on objects with 'Centre view on me', and some plugins like the RTS movement allow you to pathfind around objects of a certain attribute.

And on second thoughts, I think I'll go paste this on the wiki :)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Aug 30, 2008 5:58 pm

When I click edit attributes it gives me a list of attributes, then I add my own one, then there is an "Edit attribute" button which just renames it. It doesnt show up in the event editor so I can't actually set them to do anything :?
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Sun Aug 31, 2008 11:10 am

You can enable the attribute you've added on some objects, then test for it in object parameters (such as on collision with myattribute). You can also pass it to some plugins (such as RTS behavior - navigate around myattribute). This could be useful if you want to separate out different types of solid object, for example.
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 8 guests