Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Help with programming.

lcarlos
Registered User
Quote
2019-03-10 22:06:45

Well, I am a new Coppercube user.
And I wonder if it is possible to use an external function from a javascript library.

Example:
you find a pathifinding javascript library and decide to put it in your game has how?

prototype javascript - should be the way I tried, but I do not know how to make it work on the coppercube. But I've seen tutorials teaching how to use the threejs engine with an external library and babylons it's also possible to use features from a library within the 3d scene. Is this possible on the coppercube?

I want to use a threejs feature within my 3D + pathifinding scene.

If the coppercube had this option, the possibilities would greatly increase, after all, there are javascript libraries made for games!
To be attached to the webgl 3d engine and running but in the coppercube I did not find a way to incorporate in that game.


niko
Moderator
Quote
2019-03-11 08:23:31

It works easily if you are targeting the WebGL platform. There, it's just a website after all, and you can use all the features from web libraries, including the ones you mentioned above.


lcarlos
Registered User
Quote
2019-03-12 21:11:56

Thanks for answering!
would you have an example?
How can I put the function of a javascript library. inside the coppercube world ?:
you want to use a function from a pathfinding library.

if I try to always appear out of the 3d scene! What would be useless


lcarlos
Registered User
Quote
2019-03-12 21:20:05

I want to use a function from a pathfinding library. ** sorry.


xanimalkingx
Registered User
Quote
2019-03-13 13:37:02

There are many ways to import libraries for CopperCube. You can even define your own, and as well make custom function objects you can make instances of with `new ObjectName();`
For example, you can make a CopperCube behavior extension with empty code for onAnimate and its function decleration, then use Browerify NPM module to browserify a NPM module then copy that browserified code after the behavior's onAnimate closing bracket, then you can use that module wherever you want as long as the behavior is attached to some node in the scene its used in, like the root node.
The con to this is not all NPM modules work with CopperCube. Since CopperCube uses SpiderMonkey with a ES5 scripting engine, a lot of ES6 stuff is missing like a lot of array and string methods as well as no JSON object.


lcarlos
Registered User
Quote
2019-03-14 05:44:11

thanks for replying! i feel that there is a hyperlink in the javascript that would be the door to great possibilodade who knows the developer lanceumavers are more open to javascript programmers there are many javascript libraries that could add to the functions.


xanimalkingx
Registered User
Quote
2019-03-14 15:49:16

I have been working on my own library(ies) and they are working for my purposes. They will be released alongside my Enhanced FPS Camera.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (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