OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Plane on 20 Feb 2005, 13:17:33

Title: Name to object
Post by: Plane on 20 Feb 2005, 13:17:33
I'm making a mission with tons of lights, and include a script to make them flash with the sequence. I name the lights by "L#" (# means a number)
Such as L1,L8... Now in the script i want to use the name to let them on or off.

So I tried this:
Code: [Select]
Format["L%1", _x] inflame truebut it raise a error: Type string, expect object

so is there a function or a way to convert name to object
Title: Re:Name to object
Post by: THobson on 20 Feb 2005, 14:32:58
Try:

{call format["L%1 inflame true",_x]} forEach  (arrayof all the lamps)

or if you have a loop where the counter is _i try:

call format["L%1 inflame true",_i]

This is not guarnteed. but experiment with creating a string that contains the instruction you want and then use   call
Title: Re:Name to object
Post by: Plane on 21 Feb 2005, 10:29:14
Thank you,THobson
Solved
 :thumbsup: