Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
How do I get properties from other behaviors attached from a scene node? Like, how do I get the values from "Size" within the "Collide when moved" behavior? |
||||
|
Unfortunately there is not a way to alter variables on most behaviors. Your best bet would be a few child nodes with proximity behaviors of variable sizes, and switch their visibility to activate them. Hope that helps. |
||||
|
ishmaru wrote: Unfortunately there is not a way to alter variables on most behaviors. Your best bet would be a few child nodes with proximity behaviors of variable sizes, and switch their visibility to activate them. Hope that helps. No, I need the `Size` property from `Collide when moved` on a scene node via scripting. I need it for my custom behavior extension. |
||||
|
bump |
||||
|
Sorry ! But you can't the javascript code of the inbuilt behaviour unless coppercube become opensource.. |
||||
|
the right way of saying it is "unless you buy the studio version which you have access to the source" |
||||
|
@Smartbro i siad it all correct ,studio version will give you acess to client source and which is not in javascript.... You won't get the sourcecode of the editor... You can only have android and c+ source code of the published exe... Even if you have a studio version you can't get access to the inbuilt javascript source..... |
||||
|
That's not what I was asking for just_in_case I don't need the source, I need a way of programmatically getting property info of another behavior attached to a scene node. |
||||
|
well, it may be possible that you didn't understand my answer... you can only interact with the inbuilt behaviour if you have source code of the editor.. or if niko develop a javascript api to interact with properties of behaviour.. for example ccbGetBehaviourProperties("Behavior Name",Property name) and ccbSetBehaviourProperties("Property Name", Value) as of now ,there is no scripting api like this... so in short answer to your question is no... currently there is no way to interact with inbuilt behaviours property programatically.. but if you still want then you can give ccbgetscenenodeproperties a try... for the sake of your satisfaction... |
||||
|
CC javascript api lacks lots of required functions. Many of us has asked the developers of CC to implement that so that we can complete our games. But till date nothing is added. I don't know why and I am not going to ask why. You must wait until they do this. |
||||
|
wrote: CC javascript api lacks lots of required functions. Many of us has asked the developers of CC to implement that so that we can complete our games. But till date nothing is added. I don't know why and I am not going to ask why. You must wait until they do this. Well, that sucks! |
||||
|
was about to ask a similar question as i wanted to make a health bar behaviour with health as a property that i wanted to set from an set health action are there any smart alternatives? closest thing i can think of is add an variable name property to both action and behaviour also is there info on prototype in the third persone camere example there are more funtions then onAnimate e.g. dotProduct is that called from outside or are those added for easy calling with this? would be nice to add custom events like onChestOpen (again maybe with a certain variable set it may be possibe te emulate this behaviour) Niko please add a way to access properties and functions for custom behaviours from custom actions. Side question: how can one retrieve the name of je object the behaviour is added on? |
|