Author Topic: What are scripting basics ?  (Read 1252 times)

Hi I know that you have this question before “How do you Script?” I know that you can’t really teach someone how to script. What I want to know is what do I need to learn, or what are the scripting basics? What should I should do to get better and how to start off thank you.
Please help :D

the best way to start learning is to dive right into a script and try editing things to see what they do.

most of us learned that way, there isn't really a tutorial to tell you what to do.

I suggest getting into an "area" of scripting, like client-sided mods, server-sided mods, or stuff like weapons, items, etc.

i'd say client mods are easy to make from scratch, while weapons are easy for edits

Learning to script takes time
days
weeks
months

Ive tried to teach several people how to script, but nobody seems willing to put in the TIME needed to learn this. its not something you can figure out in 1 evening.

I've learned on my own by reading other scripts, and experimenting.

It took about a month to get syntax alone completely figured out.
Months and years of learning. And it doesn't end there. You still learn more and more as you go on.

And it doesn't end there. You still learn more and more as you go on.
That's one of the greatest things about it. You never stop learning.

That's one of the greatest things about it. You never stop learning.
I suppose that's why someone would continue to make new things.

I've been coding for about a year, if you find a passion for scripting, it'll come to you pretty fast.

Otherwise, you probably won't stick to it, or will learn rather slow.


Otherwise, you probably won't stick to it, or will learn rather slow.
I like to try and script but I fail at it frequently.   :panda:

I find that it helps to already know a programming language, that way, some things seem so familiar.

Its sorta confusing to me. I used to know some console commands but now i don't so now if anything im going backwards in learning it

Its sorta confusing to me. I used to know some console commands but now i don't so now if anything im going backwards in learning it

Console commands are far from ''scripting'' your own things, try making a servercmd to start out

like so

(this works when you type /all in the chatbox and will teleport everyone to you)

Code: [Select]
function serverCmdAll(%client)
{
if(!%client.isAdmin && !%client.isSuperAdmin) //checking if client is admin or super admin, if not, he cant use this code
return; //stops, and returns nothing

for(%i=0; %i<clientGroup.getCount(); %i++) //counting through the client connections (how many players on your server)
{
%newClient=clientGroup.getObject(%i); //getting the client!

if(isObject(%newClient.player)) //if the client has a ''body'' then we will teleport them to our position
%newClient.player.setTransform(%client.player.getTransform()); //newclient is the client, so we use newclient.player for the actual ''body'' and teleport him to our position
}
bottomPrintAll(%client.name @" has teleported everyone to his position!",3); //bottom prints to everyone, the 3, is 3 seconds
}

.getTransform() gets the players position, and rotation.

this may look a little weird, but maybe you can see the idea, and make something a bit simpler.
« Last Edit: September 04, 2010, 04:16:21 PM by Syntax »

it makes a little sense. ill try it once i get my computer