Live Chat

Written in javascript??

The place to discuss all things Receiver.

Written in javascript??

Postby spleen387 » Fri Jun 28, 2013 1:50 am

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?
spleen387
 
Posts: 3
Joined: Fri Jun 28, 2013 1:31 am

Re: Written in javascript??

Postby Enemby » Fri Jun 28, 2013 6:32 pm

While the majority of Receiver was written with Javascript, it was built using Unity, which allows mixing and matching languages.
Enemby
 
Posts: 46
Joined: Fri Apr 05, 2013 10:02 pm

Re: Written in javascript??

Postby atomtengeralattjaro » Sat Jun 29, 2013 3:54 am

yeah, the Graveyard was also made in Unity, that's why you see the similarity. Unity allows scripting in javascript or C#.
atomtengeralattjaro
 
Posts: 130
Joined: Mon Oct 08, 2012 3:05 pm

Re: Written in javascript??

Postby Razor » Sat Aug 10, 2013 4:59 pm

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.
Razor
 
Posts: 10
Joined: Wed Nov 23, 2011 12:15 pm

Re: Written in javascript??

Postby andrikaa » Thu Feb 27, 2014 1:00 am

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.
andrikaa
 
Posts: 1
Joined: Thu Feb 13, 2014 1:04 am

Re: Written in javascript??

Postby Enemby » Fri Feb 28, 2014 1:05 am

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.
Enemby
 
Posts: 46
Joined: Fri Apr 05, 2013 10:02 pm

Re: Written in javascript??

Postby APsychonaut » Fri Feb 28, 2014 3:13 am

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++
APsychonaut
 
Posts: 56
Joined: Sun Feb 02, 2014 4:16 am
Location: A benificery of the 'glorious' US Empire.

Re: Written in javascript??

Postby z33ky » Fri Feb 28, 2014 8:10 am

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.
z33ky
 
Posts: 12
Joined: Mon May 28, 2012 7:23 am

It's not JavaScript!

Postby zv_odd » Tue Sep 23, 2014 4:30 am

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/UnityScript_versus_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.
zv_odd
 
Posts: 2
Joined: Mon Sep 22, 2014 10:54 pm

Re: Written in javascript??

Postby Korban3 » Sun Sep 28, 2014 6:31 pm

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.
User avatar
Korban3
 
Posts: 4146
Joined: Tue May 31, 2011 9:14 pm
Location: 42nd St E, Hell


Return to Receiver

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group cron