OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Blanco on 16 Jun 2004, 19:53:56

Title: script labels as parameter?
Post by: Blanco on 16 Jun 2004, 19:53:56
I've seen this in "script1.sqs" :
Code: [Select]
#label1
... code... more code...


#label2

... code... more code...

Then in another script in the same mission I saw this :

["label2"] exec "script1.sqs"

I found this executes the code started from #label1 in script1.sqs. Interesting... I wanna know more...  :)
Can I add more parameters?
like this :
["label1", mygrp] exec "script1.sqs"
Is "label1" or mygrp the first parameter in the exec array?


 
Title: Re:script labels as parameter?
Post by: Artak on 16 Jun 2004, 20:05:47
Indeed. This cuts down the number of files/global variables in your mission.
All you need to is to exec the script like you have it there and put
_bookmark = _this select 0
goto _bookmark
in the begining of the script.