Frictional Games Forum (read-only)
[SCRIPT] Lighting a stove and billboard - 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: [SCRIPT] Lighting a stove and billboard (/thread-18595.html)



Lighting a stove and billboard - The chaser - 10-02-2012

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.


RE: Lighting a stove and billboard - Acies - 10-02-2012

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.


RE: Lighting a stove and billboard - The chaser - 10-02-2012

(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?


RE: Lighting a stove and billboard - Robby - 10-02-2012

(10-02-2012, 06:31 PM)The chaser Wrote: By lights, you mean lights or lamps?
The lights (boxlight, spotlight, etc.), not the lamps.


RE: Lighting a stove and billboard - Acies - 10-02-2012

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.


RE: Lighting a stove and billboard - Wapez - 10-02-2012

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


RE: Lighting a stove and billboard - Your Computer - 10-03-2012

AddUseItemCallback doesn't work with tinderboxes.