OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Flauta on 07 Mar 2005, 02:44:38

Title: what??? why dosnt' works!!!
Post by: Flauta on 07 Mar 2005, 02:44:38
really no idea why this ownmade script dosnt works...., well, it works, but it dont care about te ~x secounds11

the scrpit is very simple, a period of secounds, then a explocion on a pre-selected area.... but all the explcions oucrs at the same time!!!!

please forgoth mi english... and tellme why dosnt works propely!!!
 this is the scrpit.....

_0 = [] exec "0.sqs"
_1 = [] exec "1.sqs"
_2 = [] exec "2.sqs"
_3 = [] exec "3.sqs"
_4 = [] exec "4.sqs"
_5 = [] exec "5.sqs"
_6 = [] exec "6.sqs"
_7 = [] exec "7.sqs"
_8 = [] exec "8.sqs"
_9 = [] exec "9.sqs"
_10 = [] exec "10.sqs"
_11 = [] exec "11.sqs"
_12 = [] exec "12.sqs"
_13 = [] exec "13.sqs"
_14 = [] exec "14.sqs"
_15 = [] exec "15.sqs"
_16 = [] exec "16.sqs"
_17 = [] exec "17.sqs"
_18 = [] exec "18.sqs"
_19 = [] exec "19.sqs"
_20 = [] exec "20.sqs"
_21 = [] exec "21.sqs"
_22 = [] exec "22.sqs"
_23 = [] exec "23.sqs"
_24 = [] exec "24.sqs"
_25 = [] exec "25.sqs"

#begin

_0

~4

_2
~1
_4
~4
_3
~3
_6
~5
_7
~4
_23
~1
_21
~0.5
_12
~2
_17
~4
_16
~5
_2
~7
_8
~2
_9
~3
_18
~4
_15
~1
_12
~2
_11
~3
_10
~4
_0
~2
_24
~1
_13
~5
_1
~4
_25
~2
_4
~2
_7
~1
_6
~4
_8
~5
_0
~1
_7
~1
_6
~2
_21
~5
_22
~7
_23
~7
_24
~3
_25
~4
_18
~2
_3
~6
_17
~3
_16
~1
_21
~1
_25
~1
_15
~3
_13
~6
_10
~3
_0
~1
_2
~1
_4
~5
_3
~4
_6
~8
_7
~4
_23
~3
_21
~2
_12
~1
_17
~4
_16
~2
_2
~5
_8
~1
_9
~3
_18
~2
_15
~5
_12
~6
_11
~3
_10
~2
_0
~1
_24
~4
_13
~3
_1
~2
_25
~1
_4
~4
_7
~1
_6
~8
_8
~1
_0
~4
_7
~3
_6
~2
_21
~5
_22
~3
_23
~4
_24
~3
_25
~3
_18
~5
_3
~1
_17
~1
_16
~1.4
_21
~1.6
_25
~0.6
_15
~0.4
_13
~1
_10
~0.9
exit


very simple hu?????
Title: Re:what??? why dosnt' works!!!
Post by: Planck on 07 Mar 2005, 04:26:36
<clunk>  ;D

I'm sure there are easier ways of doing whatever you are trying to do.

Care to explain?


Planck
Title: Re:what??? why dosnt' works!!!
Post by: Taggart on 07 Mar 2005, 07:49:50
I just use something like this, scripting may be inaccurate, am at work cannot check it:

#start
name=laserguidedbomb getmarkerpos "bomb1"
~5
name=laserguidedbomb getmarkerpos "bomb2"
~5
name=laserguidedbomb getmarkerpos "bomb3"
exit

Obviously link this script with a trigger, hope it helps  :)
Title: Re:what??? why dosnt' works!!!
Post by: bedges on 07 Mar 2005, 11:35:59
or, using what you already have, why not cut off the end bit, and simply use

Code: [Select]
[] exec "0.sqs"
~wait
[] exec "1.sqs"
~wait
[] exec "2.sqs"
~wait
[] exec "3.sqs"
...

as for the reason your script doesn't work, you're assigning an instruction to a variable and then simply stating the variable. it's like saying "when somebody asks my name, say Flauta", and then instead of asking your name they say

Code: [Select]
"when somebody asks your name."
~wait a little while
"when somebody asks your name."
~wait a little while
...

a wee bit silly :P all the explosions are happening at the same time, because there are no pauses between the [] exec "number.sqs" commands. (i think - don't quote me on that one)

as mentioned above, there are better, simpler ways to do this. Taggart's suggestion is a good place to begin.

good luck :)

Title: Re:what??? why dosnt' works!!!
Post by: Flauta on 07 Mar 2005, 23:07:50
well: Really Bedges y cant get your point... you say doing the "_0 = [] exec "0.sqs"" thing wont work...??? well ill try changing all the _0's and see what happends....

but I still cant understand why all the explotions ocurs at the same time....

Thanks Anyway
Title: Re:what??? why dosnt' works!!!
Post by: h- on 07 Mar 2005, 23:53:18
The explosions happen because _0 = [] exec "0.sqs" and so on executes the script in question...

That line of yours says _0 is execute this script and so OFP executes the script, thus explosions occur...
(in other words you can't assign/store a command line into a variable)

So, do what has been suggested already (by Taggart for example)...
Title: Re:what??? why dosnt' works!!!
Post by: Roni on 08 Mar 2005, 02:52:10
I think HateR has the answer.  To test this simply add a line like

hint "Begin barrage"

after the assignments but before the part that is supposed to start the execution of each script, and another line like

hint "End barrage"

at the end of it.

My guess is that you'll see all the barrages go off at once, the first hint, a VERY long delay, then the second hint.  this is because the assignment (_0="this exec 0.sqs" or whatever) is not happening.  The script sees the execution command and just does it.

FWIW I have developed my own little version of the same thing which should do what you want.  ;D  It basically creates a number of barrages of varying size and density centred around a fixed point, along with some random smoke and fire effects just to spice things up.  All variables can be easily set by changing the numbers at the start of the script.

Unfortunately it's on my PC at home and not the laptop here at work - if you'd like a copy just send me an em.

Cheers



roni