Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
best JavaScript setup 4newby ?

douwedabbe
Registered User
Quote
2020-02-17 20:56:08

That is the question:

what is the best newby Javascript setup?

currently using notepad++ with a few plugins but the debugging is horrific !!!

also 99.9999 % of all online javascript sites and resources are about the browser and not very usefull.
found site of crockford very old, usefull but also short on explanations.
Javascriptkit is good but mostly geared towards web development.

the help inside cc is not bad but, really very austere.

I looked at other editors such as atom etc but these product are already complex by themselves without the JS programming.

i develop for android, and so I find myself asking many times: - it works under windows but not under android why ???
- will this mesh and or texture perform well under android, is a wheelcone with 8-side faces- better than a circel-cone?
there is no way of knowing
- is a cc-behaviour the same as an js-object ?
- is an cc-action the same as a js-function ?

sometimes must reinstall cc because error "is NaN" (Not A Number) after variable type change

any advice, pointers, leads welcome


Robo
Guest
Quote
2020-02-18 02:50:15

CopperCube uses an older ECMAScript 5th Edition (ES5) - not the latest version so many youtube tutorials will not be suitable.

So search for ES5 javascript stuff to learn about it. ES5 is still pretty good in many respects, you can save arrays of data, reload and do quite a bit still using basic arrays (not high level ones).

Yes you can use 'notepad++' - I still only use basic 'notepad'.

Use all available extensions to start with until your ready to recode them yourself into your own js code when needed.
When making a change to any code / extension, make sure to test each time as the debugging wont tell you where the problem is - only that there is a problem so yeah...

I don't use web apps / mobile so you will get differences between how it runs for Android versus PC etc, just research the differences and adjust accordingly.


douwedabbe
Guest
Quote
2020-02-24 17:31:46

Android does not support :
- switch/case statements
- and indeed for statememts are significantly slower

these difference should be in the manual really

just a list what works where would do


douwedabbe
Registered User
Quote
2020-06-08 16:19:16

Tip:
the http://www.archive.org has some free javascript books for download. such as the mammoth JavascriptBible a 2000 page pdf but mostly web oriented.


aloan
Registered User
Quote
2020-06-17 18:37:14

wrote:
Tip:
the http://www.archive.org has some free javascript books for download. such as the mammoth JavascriptBible a 2000 page pdf but mostly web oriented.

Would love to have the link for that, I was able to get javascript bible 7th editon, if that is the one focused on ES6, then maybe I should download an older edition?

update: I also found these which I believe to be good:

https://javascript.info/
https://eloquentjavascript.net/


bracer
Registered User
Quote
2020-06-17 21:15:08

I always program using an external notepad and paste it back into CopperCube's JavaScript dialog.

Is there a way to attach the *.js file so that I don't have to copy and paste into that javascript dialog and instead just specify a filename and during compile time CopperCube auto-include ?


count2rfeit
Guest
Quote
2020-06-18 00:55:09

I use notepad++ because it will save in a lot of different formats - *js is one of them


bracer
Registered User
Quote
2020-06-18 01:54:14

I came across this that might interest Niko.
Why not update the JavaScript inside Coppercube with the...wait for it....embeddable JavaScript engine ?

Someone has done the hard work !
https://bellard.org/quickjs/

Even Godot is doing it now using that library !
https://github.com/Geequlim/ECMAScript


Aloan
Guest
Quote
2020-06-18 02:05:25

Wow this is exciting. Does this mean we could use set time interval and time out meaning se can use every few seconds in a notepad! I hope Niko updates!
If I am not mistaken, all code could finally be inside a single text file


bracer
Registered User
Quote
2020-06-18 02:35:53

I answered you on the

How do you detect if an animated texture has done running its sequence ?

thread aloan, hope that helps you too.


guest
Guest
Quote
2020-06-24 16:29:04

in notepad ++
you can add the Coppercube keywords so they will colorcode which is nice.

but it does not catch all misspellings which is sad.

i use the ecma 262 pdf and never encountered a non compatibility issue with cc

also you can get ideas from js tricks and effects on webpages that some times are easy to convert to cc
such as the BSgenerator script (Dialog) i pulled from an old webpage, there are many variants also.


aloan
Registered User
Quote
2020-06-25 15:46:48

wrote:
I answered you on the

How do you detect if an animated texture has done running its sequence ?

thread aloan, hope that helps you too.


Oh yeah, thanks! I was able to animate using the changeNodeProperty (Just in Case had told how to) and it worked, so I put the working CCB there for download together with an animated walking npc!

Now I still don't fully get what doOnFunction does: according to what I understood, you can just write the action on notepad++ using onFunctionCall and it executes the action for you... If so, I wonder it can't be the same thing for behaviors!
It would be nice to have a little dummy ccb just to show the onFunctionCall in action (just a cube example).
I also downloaded the Ecma262.pdf and many other pdfs on JS.


Create reply:


Posted by: (you are not logged in)


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