Frictional Games Forum (read-only)
FadeLightTo not working with asterisk? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: FadeLightTo not working with asterisk? (/thread-25478.html)

Pages: 1 2


FadeLightTo not working with asterisk? - Mudbill - 06-14-2014

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


RE: FadeLightTo not working with asterisk? - Lizard - 06-14-2014

(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)_*"


RE: FadeLightTo not working with asterisk? - Mudbill - 06-14-2014

So the asterisk just means any number, not any character? I thought it meant all.


RE: FadeLightTo not working with asterisk? - Lizard - 06-14-2014

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_*"


RE: FadeLightTo not working with asterisk? - Mudbill - 06-14-2014

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?


RE: FadeLightTo not working with asterisk? - Lizard - 06-14-2014

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


RE: FadeLightTo not working with asterisk? - Mudbill - 06-14-2014

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.


RE: FadeLightTo not working with asterisk? - Lizard - 06-15-2014

Just fought about it

Why not compound your lights and then use the compound in FadeLightTo?


RE: FadeLightTo not working with asterisk? - Mudbill - 06-15-2014

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?


RE: FadeLightTo not working with asterisk? - Lizard - 06-15-2014

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