OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bedges on 13 Apr 2005, 16:57:22
-
i've done some testing but i'm not finding the answer i seek.
i call a script which utilises _this, using [value1, value2] exec "scriptname.sqs". my question is, if i don't pass a value in one of those value fields, what will the _this return in the script?
i'm getting a "scalar bool array string 0xfcffffef" returned, but what i'm looking for is something more usable, like 'null'.
if i test for _this values in a script, do i always have to include something for the script to work with, even if it's just a null value?
-
The scal bool error thing means "doesn't exist, you've fucked up".
_this is an array of the parameters passed to the script by the call. If you don't pass anything then its an empty array.
Use a count command to see how many elements there are in the array before trying to select elements that don't exist.
-
mmmunderstood. i'll sidestep the whole 'count' issue and use a simple 0 for blank values.
cheers :)