Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FadeLightTo not working with asterisk?
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#1
FadeLightTo not working with asterisk?

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
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#2
RE: FadeLightTo not working with asterisk?

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

CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 06-14-2014, 07:07 PM by Lizard.)
06-14-2014, 07:02 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: FadeLightTo not working with asterisk?

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

06-14-2014, 07:23 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#4
RE: FadeLightTo not working with asterisk?

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

CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 06-14-2014, 07:37 PM by Lizard.)
06-14-2014, 07:37 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: FadeLightTo not working with asterisk?

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?

06-14-2014, 07:50 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#6
RE: FadeLightTo not working with asterisk?

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

CURRENT PROJECT:
A Fathers Secret == Just started
06-14-2014, 08:13 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#7
RE: FadeLightTo not working with asterisk?

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.

06-14-2014, 09:45 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#8
RE: FadeLightTo not working with asterisk?

Just fought about it

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

CURRENT PROJECT:
A Fathers Secret == Just started
06-15-2014, 12:53 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#9
RE: FadeLightTo not working with asterisk?

Hm, well something seems odd. I tried combining 3 light objects, named the compound "light" and used the script
PHP Code: (Select All)
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?

(This post was last modified: 06-15-2014, 01:04 AM by Mudbill.)
06-15-2014, 01:03 AM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#10
RE: FadeLightTo not working with asterisk?

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

CURRENT PROJECT:
A Fathers Secret == Just started
06-15-2014, 01:12 AM
Find




Users browsing this thread: 2 Guest(s)