Frictional Games Forum (read-only)

Full Version: Lighting a stove and billboard
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, here's my problem. My CS is focused on realism, as a lot want. So, the place where this stove is, is in a place with a lot of dust. I want that the bonfire, when lit, casts a billboard too. So, in the level editor is impossible, but I thought of one thing:

Code:
AddUseItemCallback("", "tinderbox" + i, "bonfire", "Lit_stove", true);

void Lit_stove(string &in asEntity, string &in asEntity)
{
FadeLightTo("Light", 1, 1, 1, 1, true);  /////I think is something like that.
}

So, instead using the tinderbox in a bonfire with a connected light that makes shadows (what I currently have), a tinderbox that when used would lit everything by script. I need more help on the "tinderbox + i" part, is where I get lost. I could make a callback for every single tinderbox, but I would have to name them all.

Do I need a "for" for this? Also, is this possible? The billboards are connected to the light and jens said in a thread that the billboard could be activated and deactivated (it's spelled this way?) by connecting a billboard to a light and then fasing the light off, so the billboards appeared when the light was connected.

I know this must be a bit hard, but I'm in need of help.
Jens was saying that a way to deactive a billboard be by connecting it a light and setting the light value to zero (fadelightto("light", 0,0,0,true).

It is possible. Place the lights you want lit in the level editor. Copy their names and light values into FadeLightTo("Name of your light", 1, 1, 1, 1, true);
Numbers equals to Red green Blue Alpha - in that order. Connect appropriate lights to their respective billboards.
(10-02-2012, 06:29 PM)Acies Wrote: [ -> ]Jens was saying that a way to deactive a billboard be by connecting it a light and setting the light value to zero (fadelightto("light", 0,0,0,true).

It is possible. Place the lights you want lit in the level editor. Copy their names and light values into FadeLightTo("Name of your light", 1, 1, 1, 1, true);
Numbers equals to Red green Blue Alpha - in that order. Connect appropriate lights to their respective billboards.
By lights, you mean lights or lamps?
(10-02-2012, 06:31 PM)The chaser Wrote: [ -> ]By lights, you mean lights or lamps?
The lights (boxlight, spotlight, etc.), not the lamps.
You can interact with lamps as well.

FadeLightTo("Bonfire_1_PointLight_1", 0, 0, 0, 0, true);
FadeLightTo("Bonfire_1_SpotLight_1", 0, 0, 0, 0, true);

Will theoretically remove all light emission from the bonfire, without using the setlamplit command. It's all in the naming part; Objectname_lightname.

Just use the modeleditor to look up the names of lights attached to an entity.
As for the "tinderbox"+i part, you should use a for loop.

Code:
for(int i=1;i<=999;i++)
AddUseItemCallback("", "tinderbox" + i, "bonfire", "Lit_stove", true);


The player can't have more than 999 tinderboxes :S
AddUseItemCallback doesn't work with tinderboxes.