OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Terox on 09 Oct 2005, 23:55:14
-
the script system
Firstly i have a script that defines a set of variables (to be called upon later
this basically is a list of vehicle classnames with "_icon" added to the end of them
and then these are equalled to a "markertype"
eg
markerInit.sqs
classname1_icon = "markertype stringname"
classname2_icon = "markertype stringname"
classname3_icon = "markertype stringname"
i then basically have a marker setpos script which sets the marker type defined in the above script for a given vehicleclassname
Markersetpos script
;; only relevant code displayed
_v = vehicle _u
_type = call (typeof _v + "_Icon")
;;_type should then be redefined by the markerInit.sqs into a markertype
_m setmarkertype _type
My problem is, if for some reason the
classnameX_icon = "markerclass stringname" hasnt been declared, i need to fall back to a default marker
and therefore i need to be able to return whether _m is a real classname of marker
I dont want to use an
if (_m in array)
if (getmarkertype _m in array)
as there are approx 100 markers it could be and searching through such an array would be very cpu intensive
any help would be greatly appreciated
-
Scripts are not really my strong point, but:
_type = call (typeof _v + "Icon")
Should that not be?:
_type = call (typeof _v + "_Icon")
If not, I'll crawl back into my box. ::) ::)
Planck
-
Well spotted on the syntax error Planck
Have figured solution out anyway
if _type hadnt been listed in the markerInit.sqs
then _type returns "scalar bool array string 0xfcffffef" error
so i can use that
eg
if! (_type == "scalar bool array string 0xfcffffef")then