Author Topic: Newbie to programming, part 2- Questions  (Read 652 times)

                   Hello everyone! I have a couple questions in relation to Blockland's mechanics and JavaScript.

-Question 1: What exactly are Datablocks? And what does transmitting them do?
-Question 2: Can you create addons with JavaScript? I've been taking JS lessons for the past couple weeks, and I was wondering if that was possible.
-Question 3: What is Eval? Is it a programming language? Is it based off of JavaScript?
-Question 4: Is the in-game Console based off of JavaScript? (The Console that opens when you press ~)
-Question 5: What can you do with Eval? How does it work?

Thanks and I really appreciate the help!
« Last Edit: September 10, 2016, 07:47:44 AM by Zotron »

Torque is very similar to javascript although there's still a fine line between them; you have to use torque to make stuff

Torque is very similar to javascript although there's still a fine line between them; you have to use torque to make stuff

Oh thanks. So by knowing JS, I'll have a head start on Torque?
« Last Edit: September 10, 2016, 07:51:58 AM by Zotron »

eval is just an add-on that a server uses that allows selected people to access the host's console to use console commands

ie if you wanted to do something like "echo();", an admin or a superadmin can't do that to the server. only the host can do that

eval allows you to give people allowance to your console, so they actually can do "echo();" which does effect the server

eval is named because evaluate

Oh thanks. So by knowing JS, I'll have a head start on Torque?
less of a head start (you should still start from the beginning) but it's definitely easier to understand

eval is just an add-on that a server uses that allows selected people to access the host's console to use console commands

ie if you wanted to do something like "echo();", an admin or a superadmin can't do that to the server. only the host can do that

eval allows you to give people allowance to your console, so they actually can do "echo();" which does effect the server

eval is named because evaluate

OOOOOOOhhhhh Thanks

1. Datablocks are used to store persistant, common information about a type of object. For example, all players using the default player type of PlayerStandardArmor have the same mass, movement speeds, jet properties, etc. Transmitting just means the server sending them to clients, so the clients have that information.

2. No. Javascript knowledge may help you with syntax, as they are similar. But you need a distinctly different language: torquescript.

3.in addition to what Resonte said, there is a torque script function named eval, which takes a string of code and executes it. There honestly isn't a whole lot of need for it, and you don't want to use it unless you fully understand what the risks of the function are.

4. No. It's similar to the javascript console in a browser, in that you can execute arbitrary lines of code. But it still only uses torque script.

5. See 3
« Last Edit: September 10, 2016, 11:15:59 AM by Headcrab Zombie »