OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: OFPfreak on 25 Jun 2005, 06:41:55

Title: basic commands to frightening, horror commands
Post by: OFPfreak on 25 Jun 2005, 06:41:55
I've been noticing some things e.g.

setpos [getpos this select 0, getpos this select 1,10] for example is simple.

but

setpos [getpos this select 0, getpos this select 1, (getpos this select 2) +?] is complicated.

It's not any harder to write but.. its all so different with... any difference?
Title: Re:basic commands to frightening, horror commands
Post by: bedges on 25 Jun 2005, 08:12:39
the difference is in the logic of the command. in the first example, the height parameter is simply 10 meters. in the second example, you are both getting the height parameter of the given object, and also adding to it. if you were to type

Code: [Select]
setpos [getpos this select 0, getpos this select 1, getpos this select 2 +n]

without the brackets, flashpoint would most likely interpret this as trying to add 'n' to the command 'select 2' rather than the value that 'select 2' returns, which would cause an error. the brackets are used to separate the parts of the command, so you add 'n' to (the value in here).

Title: Re:basic commands to frightening, horror commands
Post by: OFPfreak on 25 Jun 2005, 08:29:06
well thanks.. I will call it "scarier than world war 3" for now since I don't know what the heck you mean. I'll learn that in high school ;D!
Title: Re:basic commands to frightening, horror commands
Post by: qqqqqq on 25 Jun 2005, 10:52:03
Create a test missionette and experiment.    Always the best way to get to understand a command or line of code.