Event sheets for objects.

New releases and general discussions.

Post » Sat Jan 10, 2009 2:03 pm

Apologies if this already exists (or is planned to be implemented soon), but I can't find anything about this in the Wiki (or anywhere else).

MMF2 supports event sheets for objects (active objects at least, probably most if not all others as well). My (likely faulty) understanding is that Construct only supports per-layout event sheets. If this is so, would it be possible to include lower-level event sheets (e.g., for objects)?
B
2
S
2
G
3
Posts: 158
Reputation: 1,566

Post » Sat Jan 10, 2009 2:11 pm

We could do, but it only has advantages for copying/pasting objects between applications. I'm not too keen on the idea myself - you can use different event sheets and use event sheet includes to organise your code with modularity - and if objects have events, they just get "hidden" away in a difficult-to-reach and easy-to-forget-about place (imagine having events in an object in the bottom right of a very large layout, or on a locked or hidden layer). Also, it would be implemented simply as pasting all object's event sheets to the end of the main event sheet when the application starts up - so object event sheets wouldn't have any special abilities different to ordinary events.

Is that all you wanted? A quick and easy way to paste objects between applications and have their events go with them?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sat Jan 10, 2009 2:18 pm

[quote="Ashley":3obek3wr]Is that all you wanted? A quick and easy way to paste objects between applications and have their events go with them?[/quote:3obek3wr]
If it means I could copy and paste behaviours and events for objects easily, then yes.

Also, it could make object-based inheritance easier. Say you wanted a type of object to have certain behaviours or events. You could have a base object, with something to identify it as a kind of object which other objects could inherit behaviour/events from.
B
2
S
2
G
3
Posts: 158
Reputation: 1,566

Post » Sat Jan 10, 2009 3:07 pm

It's commonly requested but it's something we don't really want to do.

However, copy/pasting event sheets would go some way to alleviate the issue, and post 1.0 we have plans to split layouts/event sheets into their own files, so such behaviors could be passed around in small files and then copied in.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sat Jan 10, 2009 3:11 pm

But the point is, if event sheets are tied to a layout only, then for another layout you'd need to recreate those events from scratch. This seems an unnecessary duplication of effort, unless you can tie event(s) to object(s) regardless of whether or not those are per-object or per-layout.
B
2
S
2
G
3
Posts: 158
Reputation: 1,566

Post » Sat Jan 10, 2009 3:19 pm

Ah, you appear to be missing the ability to include event sheets in others.

Right click in the event sheet editor and select 'include'. You can add as many event sheets as you want which aren't tied to any layout, and include them wherever you want.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sat Jan 10, 2009 3:26 pm

Useful! Thanks for the info. So in theory you could have a layout sheet(s) with nothing in them but required sprites and define events in there, and then include those elsewhere? Interesting.
B
2
S
2
G
3
Posts: 158
Reputation: 1,566

Post » Sat Jan 10, 2009 3:34 pm

Yes, that's definitely possible :). Once event sheets are stored in their own file (or are exportable etc) it'll be much easier to utilise them for custom object behaviors.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sat Jan 10, 2009 3:43 pm

It'd also be nice if - either as external file or exportable - they're in a human readable(ish) format. XML maybe?
B
2
S
2
G
3
Posts: 158
Reputation: 1,566

Post » Sat Jan 10, 2009 3:50 pm

Yes, .xml was the format we've chosen :).
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests