Home   Help Search Login Register  

Author Topic: Name to object  (Read 542 times)

0 Members and 1 Guest are viewing this topic.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Name to object
« 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
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Name to object
« Reply #1 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
« Last Edit: 20 Feb 2005, 14:33:32 by THobson »

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:Name to object
« Reply #2 on: 21 Feb 2005, 10:29:14 »
Thank you,THobson
Solved
 :thumbsup:
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.