Attributes

For developers using the Construct 2 Javascript SDK

Post » Fri Jan 23, 2015 1:30 am

So,

Does anyone have a clue why attributes are handled the way they are? Shouldn't there be a behavior which the attribute can be set as a text and used within the sdk in the same way? Why are they handled the way they are?

There should be but one attribute behavior and then flags, tags, whatever, can be dynamically added to it - not this hard coded, tied into the system business.

From what I understand so far, there really isn't a way to add your own attributes that can be used with another behavior. The platform behavior is so intertwined with with attributes which are handled by the system, and uses specific system info in a very tailored to it sort of way... the platform behavior breaks all the rules.

Is there are way to get around this?



The whole push out of solid stuff is a real pain in the but :) It would be nice to be able to say push out of object with <attribute>.

anyway
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Sat Jan 24, 2015 11:13 pm

What do you even mean by attribute?

you can make a behavior which modifies an instance. You can make a flag on the instance. you can then check for that flag on the instance, which is effectively what you want to do, you can even make the behaviour control multiple 'attributes' and flags. It's not very complicated.

pushing out of an object requires complex detection routines / memory management to be fast, you're greatly simplifying things.
B
77
S
13
G
8
Posts: 1,973
Reputation: 9,891

Post » Sun Jan 25, 2015 1:01 am

@QuaziGNRLnose - I am referring to behaviors under the attributes section in the behavior adder.

Have you read how solid, or jumpthrough, or shadowcaster, are handled in the system js files? (preview.js) Because you can only use push out of solid (instead of push out object with <attribute> there is a lot you can't do. So much of the core of c2 can't be accessed, instead of simply adding things you have to start adding stuff that already exists.

Push out of some object is basically the same thing as push out of solid. Except the later ties your hands.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Sun Jan 25, 2015 2:37 am

there's likely a reason it was done that way for optimization reasons.
B
77
S
13
G
8
Posts: 1,973
Reputation: 9,891


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests