Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
How do I get properties from other behaviors attached from a scene node?

xanimalkingx
Registered User
Quote
2018-07-26 03:28:15

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?


ishmaru
Guest
Quote
2018-07-26 19:34:55

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.


xanimalkingx
Registered User
Quote
2018-07-26 21:18:20

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.


xanimalkingx
Registered User
Quote
2018-08-14 23:07:33

bump


just_in_case
Moderator
Quote
2018-08-15 06:12:42

Sorry ! But you can't the javascript code of the inbuilt behaviour unless coppercube become opensource..


smartbro
Guest
Quote
2018-08-15 06:27:27

the right way of saying it is "unless you buy the studio version which you have access to the source"



just_in_case
Moderator
Quote
2018-08-15 10:44:19

@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.....


xanimalkingx
Registered User
Quote
2018-08-15 22:35:10

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.


just_in_case
Moderator
Quote
2018-08-16 04:58:45

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...



areibma
Registered User
Quote
2018-08-16 22:43:26

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.


xanimalkingx
Registered User
Quote
2018-08-17 00:43:30

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!


mvdhoning
Registered User
Quote
2018-08-19 21:08:09

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?


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Intern?tional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact