Page 1 of 1

Written in javascript??

Posted: Fri Jun 28, 2013 1:50 am
by spleen387
whats this im hearing about reciver being written in javascript? im currently working on a game in webgl but I had know idea you could port it too the desktop? is that what that resolution configurer thing at the start the im seeing more and more frequently in games is? like tale of tales: "the graveyard" has the same menu, is it an engine im seeing?

Re: Written in javascript??

Posted: Fri Jun 28, 2013 6:32 pm
by Enemby
While the majority of Receiver was written with Javascript, it was built using Unity, which allows mixing and matching languages.

Re: Written in javascript??

Posted: Sat Jun 29, 2013 3:54 am
by atomtengeralattjaro
yeah, the Graveyard was also made in Unity, that's why you see the similarity. Unity allows scripting in javascript or C#.

Re: Written in javascript??

Posted: Sat Aug 10, 2013 4:59 pm
by Razor
Yeah I opened the project, it is Javascript.
But this is well known amongst people who know what engine it uses.
Essentially, it's sort of like modding Unity. (Not really, but it's the only possible way I can explain it to who's new to these things)

Think of Garry's Mod: You can script stuff for it in Lua, but the core game surely wasn't written in Lua.

Re: Written in javascript??

Posted: Thu Feb 27, 2014 1:00 am
by andrikaa
What exactly is javascript? and is there a way I can enable it on my computer because when I'm on different websites I keep getting pop-ups saying that I need javascript to continue.

Re: Written in javascript??

Posted: Fri Feb 28, 2014 1:05 am
by Enemby
andrikaa wrote:What exactly is javascript? and is there a way I can enable it on my computer because when I'm on different websites I keep getting pop-ups saying that I need javascript to continue.
Not really relevant to the discussion but I'll answer you anyway.

Javascript is a interpreted programming language, meaning it is used to create software or webpages on the fly, which are compiled when you run the scripts.

Javascript should run by default if you have a modern browser. If you're using a browser like Internet Explorer, Safari, or Opera, you'll want to upgrade to a more consistently updated (and better) browser like Mozilla Firefox or Google Chrome.

Re: Written in javascript??

Posted: Fri Feb 28, 2014 3:13 am
by APsychonaut
Razor wrote: Think of Garry's Mod: You can script stuff for it in Lua, but the core game surely wasn't written in Lua.
off topic: Source is either in C or C++

Re: Written in javascript??

Posted: Fri Feb 28, 2014 8:10 am
by z33ky
To expand on the answers already given:

In both Unity and your web browser (assuming your browser uses Gecko (e.g. Firefox) or WebKit (e.g. Chrome)) you can program things using JavaScript (Trident (e.g. Internet Explorer) for example implements JScript instead, but see the next sentence).
Actually, Unity does not implement JavaScript, but an ECMAScript dialect (one of which is also JavaScript).

That does not mean that you can easily execute code written for the one with the other.
While the language itself stays the same (assuming you use the same dialect or restrict yourself to the common elements), the execution environment changes.

What that means is that for example this:

Code: Select all

function f(x) {
    return x + 40;
}

y = f(2);
will work fine in both Unity and your browser, because here we only use the language, but this

Code: Select all

alert('yay!');
will only work in your browser (unless Unity has/adds it own alert-function).
The alert-function is not part of JavaScript itself, but is provided by the browser as an environment so you can interact with it.
Likewise, Unity will provide things to interact with the game engine.

Some libraries providing additional functionality could be used in both of them, perhaps something like Box2D, if it is written purely in a compatible dialect without using any 'external functionality'.

And you can theoretically implement a JavaScript engine anywhere. You could use it as the default shell of an operating system if you wished to do so. You can write web servers in Javascript, see node.js.

Unity also allows use of other languages, like C# and a Python-dialect called Boo.
APsychonaut wrote:
Razor wrote: Think of Garry's Mod: You can script stuff for it in Lua, but the core game surely wasn't written in Lua.
off topic: Source is either in C or C++
Source is written in C++, though some code fragments look like C and there are a few lines inline assembler.
The build-system also used to have some Perl, not sure if it's still there.
And Shaders are written in HLSL, though maybe they switched to GLSL or something for OS X and Linux, or perhaps they use a HLSL->GLSL translation tool.
And you could argue that they've implemented a programming language for use in mapping, that is their I/O system. I have no reference to back this claim, but my guess is that it's even turing complete with the entities provided by default. It's a stretch to call that a programming language anyways.

It's not JavaScript!

Posted: Tue Sep 23, 2014 4:30 am
by zv_odd
It's worth Noting that Unity's "JavaScript" language has NOTHING TO DO actual JavaScript.
It's not even ECMA Script. http://wiki.unity3d.com/index.php/Unity ... JavaScript

UnityScript as it should be called, has some slight syntax similarities to JavaScript and that's where the similarities end.
It's horribly confusing for anyone trying to learn UnityScript or actual JavaScript, especially if you come across documentation on the wrong one.

What is UnityScript?
It's a Mono/.NET Common Language Infrastructure language ( just like C# or Boo) that was designed to be used with Unity3D. It's compiled into Mono CLI bytecode; Unlike JavaScript it's not an interpreted language. Unlike JavaScript it's a statically typed language.
Its syntax more closely resembles JScript.NET than JavaScript.
It seems to have simply sprung into existence from Unity's development and has no official language specification. I personally hate it for this.
That said, it's fairly easy to use and an OK language. Until you need to manually type cast something or actually want to know what features you can expect from your programming language.

Re: Written in javascript??

Posted: Sun Sep 28, 2014 6:31 pm
by Korban3
No, you're all wrong. Except for the UnityScript stuff.

JavaScript is a disgusting waste of time that some guys threw together in a back room when they realized they needed something for webpage programming. They told themselves "We'll fix it later, this is only temporary." but before they could rectify their abomination by inventing HTML5 on the spot, a unicorn pranced in and impaled them all, leaving us stuck with JavaScript.

Re: Written in javascript??

Posted: Tue May 09, 2023 3:47 am
by luckywin90
Excellent stuff; I'll let my friends know about it and have them check it out. I appreciate you sharing! Whenever you have more time, go to: stumble guys