Is anyone aware of complications with Behaviours in the latest build of MMF1.5 (119)?
I used to use them a lot, but I found the applications that used behaviours also tended to develop bad objects. As a result, I haven't used behaviours in a long time - are they still a problem?
I hope not. It's very handy having one object that can be copied and pasted along with all its necessary events.
Bad objects? Is that where objects appear and annoy you when you try and delete it, etc. I can't explain it but, I think I know what you mean. I didn't know why that happened before
I've lost a few games to Bad Objects before. Doesn't just happen with Behaviours though. I haven't had it for a while though, touch wood, so maybe they've fixed it, but I doubt it.
It's basically a set of events that you add onto an object. It helps keep simple code that deals with one object from cluttering the event editor. No real use, but they help keep the event editor cleaner.
They also have the advantage that they get remembered by the object. If you clone or copy/paste it, the events for it will always stay in tact.
One example I use a lot is giving shadows to text. It creates a new object underneath the original and changes its colour/transparency/etc.
I don't have to worry about the events to control this function anymore, because every time I copy, duplicate or clone that object, the behaviour will always go with it.
You can also use it to create custom extensions. If you have a procedure that gets used routinely, shove it in an active object's behaviours. Rename some of the alterable values, and you can use them as parameters. Use flags as booleans.
I'm not sure how the affect the order of events though (presumably they're executed at the bottom of the event list, and by object order/fixed number). That could pose problems.
I never found behaviours useful. I just find it obscures and hides your code. The few times I've used them, I've forgotten about the code inside them, encountered a bug, wandered what the hell was going on when no relevent events were in the event editor at all, then realised the bug was in the behaviour's events. Then every time I want to edit those events, I first have to go to the FRAME editor, which seems counter-intuitive to me. If you have all your code in one place in groups, it's much easier to browse, maintain, and make quick changes to.
Also MMF is not modular enough to make behaviour based 'custom extensions'. If you try to start making any kind of modular object by coding behaviours, you'll soon find you actually need to copy and paste a whole load of other extensions, objects and things around to make it work. So it's not modular any more. Clickteam wanted to make a library of useful behaviours, but behaviours just aren't modular enough to do that.
Anyways this is quite a pointless rant because behaviours are very easy to ignore
Well ... I am not entirely agreeing with tigs on this one.
Actually I find behaviour quite useful at times. Like if you have a bullet you can control how it is destroyed in its behaviour (collision, whatever). Putting it there cleans up the event editor.
I know I can use filters etc in event editor, but still behaviour is good place mostly simple events that only affect that one object.
Maybe it is because I learned Java in my education. In any object oriented language, code is not kept in one place, rather the code is placed in each object. In this regard behaviour is quite similar to methods in objects.