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
Solved - Please remove
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#1
Solved - Please remove

Fixed.

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-01-2012, 09:07 PM by eagledude4.)
12-31-2011, 10:56 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Changing a lamp entity's radius

SetLampLit("string &in asName", bool abX, bool abX);

The string is the name of the lamp/torch, the first bool is if it is lit or not, the second bool is for effects, such as fade and smoke.


SetLightVisible("string &in asName", bool abX);

The string is the name of the point/spot/boxlight, and the bool is if it is on or off (true or false)
(This post was last modified: 12-31-2011, 11:03 PM by Statyk.)
12-31-2011, 11:02 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Changing a lamp entity's radius

The best way would be to connect the light to the lamp entity in the level editor. However, if you want to adjust the lamp's light radius, you're going to need to edit the entity in the model editor.

Tutorials: From Noob to Pro
(This post was last modified: 12-31-2011, 11:04 PM by Your Computer.)
12-31-2011, 11:03 PM
Website Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#4
RE: Changing a lamp entity's radius

@Your Computer: Thanks for the reply, but I don't want to tinker with the default models, and I want to learn some scripting functions from this.

@Statyk: How do I achieve something similar to:
if (candlestick_wall_1.isActive()) {
        SetLightVisible("HallwayLight1", true);
    }

I'm trying to figure out the correct functions to use, but I get "Permission Denied" when trying to view the script functions. I am logged in.

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-01-2012, 12:24 AM by eagledude4.)
01-01-2012, 12:20 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Changing a lamp entity's radius

Strings do not have the method "isActive" (assuming candlestick_wall_1 is a variable of type string). I don't think there's a way to properly determine whether or not a light or entity is active, but such an event should be able to do without having to check.

Tutorials: From Noob to Pro
01-01-2012, 12:29 AM
Website Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#6
RE: Changing a lamp entity's radius

(01-01-2012, 12:29 AM)Your Computer Wrote: Strings do not have the method "isActive" (assuming candlestick_wall_1 is a variable of type string). I don't think there's a way to properly determine whether or not a light or entity is active, but such an event should be able to do without having to check.
what?

Since you have multiple point lights you want to light up when a single candle entity is lit. I would find the candle entity in level editor, place a name for the callback under PlayerInteractCallback and check PlayerInteractCallbackAutoRemove. That makes it so when you use a tinderbox on the candle, it counts as an interaction, calls the callback and lights the candle.
Lets say the PlayerInteractCallback was named as lit_candle_1 and the point lights you want to light up are black and named as point_light_1, point_light_2 and point_light_3.
Then you go to your .hps file and write something like this (not inside any void thingies brackets):

void lit_candle_1(string &in asEntity)
{
for(int i=0;i<4;i++) FadeLightTo("point_light_"+i, redvalue, greenvalue, bluevalue, alphavalue, -1, 0.5f);
}

in case you want different values for your point light (or dont know how that for(int i=0... thing works) use separate FadeLightTo's

And please don't use SetLightVisible it looks ugly when lights around appear faster than the entitys own point light.

Would you like the point lights to flicker like the candles own one (its cool)? That would make things just a little bit more complicated.

01-01-2012, 01:17 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: Changing a lamp entity's radius

(01-01-2012, 01:17 AM)Khyrpa Wrote: what?

What, what?

Tutorials: From Noob to Pro
01-01-2012, 01:30 AM
Website Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#8
RE: Changing a lamp entity's radius

(01-01-2012, 01:17 AM)Khyrpa Wrote: Since you have multiple point lights you want to light up when a single candle entity is lit.
Not exactly, I have a one point light for every candle. So lighting candlestick_wall_1 will only trigger light_1.

Flickering lights would make it look more realistic, but I'm not gonna bother with that until I get a little more advanced with scripting.

Also, I'm having a glitch where a point light is set to inactive, but is visible when testing the map.

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-01-2012, 01:56 AM by eagledude4.)
01-01-2012, 01:49 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#9
RE: Changing a lamp entity's radius

(01-01-2012, 01:30 AM)Your Computer Wrote:
(01-01-2012, 01:17 AM)Khyrpa Wrote: what?

What, what?
Lol

01-01-2012, 02:03 AM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#10
RE: Changing a lamp entity's radius

(01-01-2012, 01:49 AM)eagledude4 Wrote: Not exactly, I have a one point light for every candle. So lighting candlestick_wall_1 will only trigger light_1.

Flickering lights would make it look more realistic, but I'm not gonna bother with that until I get a little more advanced with scripting.

Also, I'm having a glitch where a point light is set to inactive, but is visible when testing the map.
Then why don't you just write
light_1 in ConnectedLight in entity properties in level editor? No need to script anything.
http://wiki.frictionalgames.com/hpl2/tut...ent_lights

You cant set light unactive in level editor. You have to script SetLightVisible

01-01-2012, 02:20 AM
Find




Users browsing this thread: 3 Guest(s)