Author Topic: Coding, Advanced Lesson?  (Read 1734 times)

Well, many may know that I can make vehicles and weapons with ease. But what about game modes, client sided scripts and stuff like that? I can understand how to change a projectile's info or change image states but what I don't understand is the stuff like this

[
       [
             [gdfgg((%#@345840)
               =%x var};
       ]
]
Yes, I know that is not real and it won't do anything and there are many errors in the syntax but I was using it as an example. Is there anything that will help me learn some of this type of stuff?


The trick is to make code in a way that is easily readable, understandable, and makes sense.  Code smooshed together on good mods would make people who may look to learn from it develop bad coding habits.  It makes bug finding alot harder also.

My code will be a lot sloppier now that I don't have Torsion anymore, back to boring ol' notepad. I might buy Torsion later.

My code will be a lot sloppier now that I don't have Torsion anymore, back to boring ol' notepad. I might buy Torsion later.
It's easy to format well.  Tab is your friennnnd

My code will be a lot sloppier now that I don't have Torsion anymore, back to boring ol' notepad. I might buy Torsion later.
I should re download my Torsion. For some reason all my trials work again with my fixed computer. Any "Complex code" you recomend me to look at?

I suggest learning how to code weapons from the default weapons.  JVS Doors is a good place to learn alot about events and a number of other things.  RTB is a good place for learning client-side code.

I suggest learning how to code weapons from the default weapons.  JVS Doors is a good place to learn alot about events and a number of other things.  RTB is a good place for learning client-side code.
I can make weapons easily.

It's allot of memorization. You can't really learn casually, you have to take a good few weeks and study everything. It's basically like math too so it takes a good amount of practice.

What I'd recommend is not to try to reach any of your major script goals right off the bat, it will simply not work. Start from the beginning and go through every example you can find (console method or otherwise). Essentially memorization by practice, then you can start making very basic scripts like serverCmd functions and the like. You also need to criticize your stuff constantly, remember it's probably never good enough and you should be constantly improving.

Also another nice small tutorial site

http://www.freewebs.com/torquescript/index.htm

Go through all the tutorial sites you can find, it will be repetitive but it's to beat the different approaches and details into your brain.

Here's an example of coding in torosion.

And yes, I know there are errors in it.


Looks like Notepad++ witch is what i use.

I think starting with AIPlayers helped me a lot because because I had to concentrate more on...  active.. code rather than simple definitions.

Experience helps a lot, I think the 3-4 years I've spent in torque script has made me pretty efficient, even if I have poor work ethic. I specialize in game modes and personally hate making weapons or messing with datablocks. You're making it sound like you're having trouble with the syntax which isn't really an advanced problem. Once you have the syntax, the concepts behind systems are a big deal, understanding object oriented programming is a big plus. In order to make things like gamemodes it helps to know how it will work before you make it; you can't just go step by step like with a weapon because you, not the engine, have to make the code fit together.

The code I'm going to release soon will be sloppy because it's been worked on and off for a year. The sloppiness comes from forgetting how I wanted the code to originally work, so commenting is definitely something you could do too.
« Last Edit: June 25, 2009, 09:32:45 PM by Nitramtj »

You can't really learn casually
Unless you're me.

At any rate, coding is logic-based. Your example is an example of why you have issues because you don't see the logic.
When I code, I'm usually reading it out loud to myself and translating pieces of it.

How loud do you read aloud Rky?