Frictional Games Forum (read-only)

Full Version: FadeLightTo not working with asterisk?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Does this function not support it? It doesn't say anywhere, and I'm pretty sure I've seen people use it before, but for some reason it's not working for me.

I have several light entities named "light_name1_name2" where each name differs from each light. I want to turn them all off to begin with by using FadeLightTo, but inputting "light_*" in the light name does not affect any of them. It works if I remove the asterisk and type the name of one individual light object.

Any help? At least confirm if it doesn't support asterisk so I won't have to spend time doing the impossible :p
(06-14-2014, 02:38 PM)Mudbill Wrote: [ -> ]Does this function not support it? It doesn't say anywhere, and I'm pretty sure I've seen people use it before, but for some reason it's not working for me.

I have several light entities named "light_name1_name2" where each name differs from each light. I want to turn them all off to begin with by using FadeLightTo, but inputting "light_*" in the light name does not affect any of them. It works if I remove the asterisk and type the name of one individual light object.

Any help? At least confirm if it doesn't support asterisk so I won't have to spend time doing the impossible :p


I know it works with asterisk. I've done it several times

If the names of your lights are "light_(number)" it should work with "light_*"

If the names of your lights are "light_(name)_(number)" it should work with "light_(name)_*"
So the asterisk just means any number, not any character? I thought it meant all.
The asterisk only defines the numbers in the end of the name.

If I have some lights named "lights_1" and so on it should be "lights_*"

If I have some lights named "lights_small_1 and so on it should be "lights_small_*"
But what if the number progression is not at the end? I use a co-ordinate system to define them, so they are named "light_x1y1_x2y1" and similarly (basically means the light object between these two co-ords). It didn't work to put "light_x*y*_x*y*" either. Is there any way to work around this that you know of?
As I can see then the way you've done it

it cuts off you light names at the first x. when you set it up like that it only sees "light_"


Just to understand the way that you done it. Can you write two of the light names? I dosen't quite get the co-ordinate system
It's quite simple, really. This figure uses the co-ordinate system:
[Image: lCqFCnj.png]
The dots are the positions (EG: x1y1, x2y1, x3y1 horizontally, and x1y1, x1y2, x1y3 vertically etc) and the lines are the light objects. The lights are named with "light_" + co-ord 1 + "_" + co-ord 2, so it looks like "light_x1y1_x1y2" for the light object between the dots of x1y1 and x1y2. Other light objects are named like "light_x2y2_x3y2" or "light_x1y3_x2y3".

Those are the names of the objects, and I'd like to disable them all at once using a simple script instead of manually naming each of them.
Just fought about it

Why not compound your lights and then use the compound in FadeLightTo?
Hm, well something seems odd. I tried combining 3 light objects, named the compound "light" and used the script
PHP Code:
FadeLightTo("light"000001); 
(name, r, g, b, a, radius, time)

yet nothing happened. Does this not work for compounds either perhaps?
PS: If it were to work for a compound, would you still be able to interact with each individual light object separately within it?
hmm.

Im afraid this is going beyond my scripting level.

But the reason I dont think it works with the asterisk is that they all have different names.

normally when you use the asterisk the names are the same and then only the last number seperates them.

So when you do it with your co-ordinate system Im afraid to say that Im at a lost on finding a solution on this one
Pages: 1 2