Home   Help Search Login Register  

Author Topic: Scripting Help???  (Read 711 times)

0 Members and 1 Guest are viewing this topic.

brandonb

  • Guest
Scripting Help???
« on: 24 Dec 2004, 05:16:10 »
I am somewhat of a newb when it comes to Mission Editing in OFP, Even though i bought the game 3 years ago or so. Yes i have been making very basic Missions since that time, Involving waypoints and stuff like that, But when it comes to scripting I have tried for 3 years and still have almost no clue about scripting, Usually i am good with this kinda stuff, I use to make my own websites and new lots of html, But this is just complicated. I have read countless tutors and the lose me almost at the very beginning of when they try to explain it, It almost fells like they are repeating themself over and over, They explain waypoints and those aspects of the game very well but when it comes down to scripting it is just very hard for me i dunno why, They lose me, Can anybody help or am i uncurable??

Dubieman

  • Guest
Re:Scripting Help???
« Reply #1 on: 24 Dec 2004, 05:28:09 »
Err, well um,

Welcome ;D to OFPEC, ask us anything on OFP and we can answer it if its editor or addon related.

However the only ways to learn are tutorials, taking apart simple things others did, or just teaching yourself.

We can't really cure you, ask us something and you'll get the answer. Keep going, you'll prolly ask tons of Qs and we keep answerin until you do learn. ;)

And read the one of the top posts, something about finding the answer to your question by Macguba.

Cheers :)
« Last Edit: 24 Dec 2004, 05:29:12 by GuiltyRoachKillar »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re:Scripting Help???
« Reply #2 on: 24 Dec 2004, 13:56:25 »
Well, if you don't know any programming languages first, it makes it a lot harder because OpFl scripting is not particularly intuitive. Also, if you haven't taken much algebra it makes it harder.  However, there are some very good tutorials, in particular make sure you read Dinger's intro to variables and arrays.

If you have a specific problem or a script that you've written that doesn't work, just post it in the appropriate forum and you will alwys get some help from somebody.
urp!

bored_onion

  • Guest
Re:Scripting Help???
« Reply #3 on: 24 Dec 2004, 14:51:57 »
scripting is definitely learnt in phases, at least it was for me.

for ages I used the editor to do really basic attacks, really dull missions and poorly made cutscenes. then i sort of bumped into ofpec and came across the command reference. i started used tiny codes in the activation fields of triggers and it instantly made my missions better. slowly i learned more and more until I discovered that other people had made this weird things called scripts and they were contained in the mission folder. using the command "exec" to make the scripts go I jumped another huge editing gaps. Then one day I thought, gee those scripts are fine but wouldnt it be nice to make my own scripts that did what I want? It seemed daunting but once you get past all of the terminology and syntax conventions I realised that scripts were just different ways of writing the activation code for triggers and that there power lay in their versatility and use of variables. Once I'd read tutorials I slowly picked it up and then I joined the OFPEC forum. This was a major step and I eventually managed to refine my skills by question and answer to what they are today. That was the way I learned.

To be able to help you, I think it would be useful to know if you can use the "activation" fields of triggers and whether you are familiar with the command manual. After that you can start on external scripts to really get things moving.

brandonb

  • Guest
Re:Scripting Help???
« Reply #4 on: 25 Dec 2004, 01:13:38 »
ok well maybe i left some parts out. I have been writing very basic scripts. Like this one _this AddWeapon "Beretta". And I named it Beretta when i saved it, And i type in the code in the INT field and it works, So i know how to do some very basic things.... I kinda understand Varibles and stuff like that but I dont understand value and Bools or Arrays, I have taken Algebra. So i do understand math, But I am kinda confused on those parts, I want to know how to get people to move where i want them too. And maybe add some sound scripts and stuff like that?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Scripting Help???
« Reply #5 on: 25 Dec 2004, 01:39:34 »
Variables, as you probably know, will contain one value, for instance, the variable a might contain the value 10:

a =10

Arrays are a special kind of variable that contain more than one value. For example, myarray might contain a list of 4 numbers......7, 4, 15, 12:

myarray = [7,4,15,12]

Each element can be referenced with select

Example

myarray select 2

Which would be 15 because the first element in the array is 0, the next is 1......and so on.

Boolean values are easy enough, they can be either of 2 values.......0(false).....or......1(true).


I trust this has muddied the waters a bit.  
 ::)


Planck
I know a little about a lot, and a lot about a little.

Dubieman

  • Guest
Re:Scripting Help???
« Reply #6 on: 25 Dec 2004, 01:39:59 »
Well again, tutorials are the best way to go as we are not always gonna have the full amount of info on any given subject.

Boolean variables....-->  bobby = true

in trigger condition put         bobby
and the trigger will activate when the script has bobby =true. That's only one of many uses for the boolean variable.

Arrays...I'm not too knowledgeable on them, but they allow you to store/put info into one area and apply it to many things without putting the same code over and over again, also it can basically list objects in a small area, and is used in calling certain scripts, eventhandlers, and most things in ofp.

Like I said, I'm not to knowledgeable on arrays. :-\

But whatever the case, learning will take awhile, it did and still does with me. :o ::) ;D