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
Script Help Lighting a stove and billboard
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#1
Lighting a stove and billboard

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:

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.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-02-2012, 06:02 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#2
RE: Lighting a stove and billboard

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.

[Image: mZiYnxe.png]


10-02-2012, 06:29 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Lighting a stove and billboard

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-02-2012, 06:31 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#4
RE: Lighting a stove and billboard

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

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-02-2012, 06:35 PM
Website Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#5
RE: Lighting a stove and billboard

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.

[Image: mZiYnxe.png]


10-02-2012, 06:41 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#6
RE: Lighting a stove and billboard

As for the "tinderbox"+i part, you should use a for loop.

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


The player can't have more than 999 tinderboxes :S

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
(This post was last modified: 10-02-2012, 06:42 PM by Wapez.)
10-02-2012, 06:42 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: Lighting a stove and billboard

AddUseItemCallback doesn't work with tinderboxes.

Tutorials: From Noob to Pro
10-03-2012, 02:00 AM
Website Find




Users browsing this thread: 1 Guest(s)