OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Teote on 29 Apr 2003, 01:12:55
-
I notice that OFP scripting is just like C\C++ and I was wondering if OFP script making is C\C++, and if it is then, when OFP reads scripts will it cut out spaces like C\C++ does or is it more spaces related like VB or QBasic? ???
I'm wondering this cause I like to write code very spaces out and easy to read and want to do that with my OFP scripts, but I'm not too sure if I can.
Also I was wondering how many people out there program and in what lang? ;D
I program in C, C++, VB (VB Rocks), PHP, Some Python (Eewww), A little Delphi, and I'm going to be learning Java. ;D
-
You know what I realized I put this topic under Gerneral Editing when it should have been under Gerneral Script
-
Nope.
OFP scripting isn't C++, it isn't visual basic or pascal or whatever.
It is a unique language, with some aspects of a lot of different programming languages.
I strongly suggest that you ignore C++ (or whatever language you're used to) syntaxs, as when you least expect it OFP scripting will be different.
If you assume it's the same as another language (when in many cases it's not), you may end up getting into trouble ;)
Having said that, there definately are some similarities...
[size=0.5]Edit: Don't worry about it... General editing and General Scripting are going to be the same forum pretty soon anyway ;)[/size]
-
To answer the specific question about spaces, in general I think you can.
You can certainly leave as many lines spaces between each line as you like, that's no problem
and I suspect you can leave extra spaces between words as well though I'm not so sure. No harm in trying.
-
Another thing to note is that OFP scripts are interpreted, just like the old style BASIC. That is why scripts execute so slowly. OFP functions are preloaded (sort of compiled) and are runnning to the exclusion of everything else. In other words, everything stops when a function is run. But they are much faster than scripts. That is also why functions should be very small with very short or no loops.
-
I strongly suggest that you ignore C++ (or whatever language you're used to) syntaxs, as when you least expect it OFP scripting will be different.
rofl ;D
yeah - da best way 2 learn OFP sciptin lang is 2 learn OFP scriptin lang ::)
LCD OUT