Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Scripting??


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 PredeX   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 January 2002 - 12:04 PM

I guess this is a newbie question however i just didnt have the time to do any research on that topic, so heres my question: What the heck does scripting do or what are scripting engine? (I looked at the new article a bit already, but that didnt help a lot) Thx in advance PredeX

Sponsor:

#2 krez   GDNet+   -  Reputation: 443

Like
Likes
Like

Posted 15 January 2002 - 12:30 PM

it is good to do anything that you don''t want to hard-code into your program. for example, if you made a game where people could build their own levels and stuff, they could use a script to tell the game how to run the level, without learning c++ or having to recompile the game.

--- krez (krezisback@aol.com)

#3 ATronic   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 January 2002 - 12:39 PM

A script is a language that does not usually need to be compiled. For example, I might make a game that reads a text file. Each time the game reads the word "Pop" it prints "You hear a loud noise", and each time it reads "Scream" it prints "A terrible scream echoes from the end of the hall." So the following script:

-Pop
-Scream
-Pop
Would have the following output:

"You hear a loud noise."
"A terrible scream echoes from the end of the hall."
"You head a loud noise."

Mind you, this is a simple example. You could have a more complex script that looks like this:

CreateCharacter(Bob)
AnimateCharacter(Bob, ANIM_RUN)
OnDeath(Bob) PlaySound(Scream):DestroyCharacter(Bob)

So the main advantage to scripts are that you can change elements of a game or level without a rebuild of your project. There are other advantages too. The main disadvantage is that you are limited by the abilities of your scripting language, and can do less than if you just coded something. But it''s generally worth it. For more info, consult the most useful source of info on the net: www.google.com

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

#4 EvilCrap   Members   -  Reputation: 134

Like
Likes
Like

Posted 15 January 2002 - 02:23 PM

A scripting engine is a program that acts like a virtual processor - it reads instructions, and executes them, from a software level.
a program is compiled to a native, machine-level form, when its run, its instructions can literally manipulate the processor

When a scriptor runs a Script, the Scriptor is the program being ran by the processor, it examines symbols, like words, and then performs some action based on their meaning.

program is to a cpu what a script is to a scriptor, and a scriptor is a program. get it?

like in previous posts, a script can basically look like normal code :
DoThis(x);
DoThat©;

scripts and programs are really only different at runtime. a program needs to be compiled, or organized and broken into a set of assembly instructions - Prior to runtime. A Script can be busted up and organized on the fly, during runtime, because its instructions are scripted, and not literaly executed.

html is a script.

an important thing to keep in mind is that scripts can be compiled to compressed forms. for instnace, instead of storing and scripting, "CreateCharacter(bob)", you would store and script "AB H!", or some set of symbolic information. it would still be scripted -its not directly executed by the processor as a literal machine command, it is scripted by the scriptor.



#5 ATronic   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 January 2002 - 02:43 PM

What EvilCrap said is exactly right. Another example of a scripting language is Java. I assume you have heard the term Virtual Machine (VM). This is what "understands" the "code". Java is said to be slower, this is due to the fact that is goes through that layer.

JAVA SCRIPT ---> VM ---> MACHINE CODE

Also, as EvilCrap said, there can be compilation or compression. Compiled binary scripts are common in games, as they are VERY fast to read, and take a ton less space. Hope everyone here has cleared up your understanding of scripts.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

#6 PredeX   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 January 2002 - 11:01 AM

Thx a lot for your posts, with your help I got some basic understanding how scripts work!

PredeX




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS