Frictional Games Forum (read-only)
Solved - Please remove - 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: Solved - Please remove (/thread-12229.html)

Pages: 1 2


Solved - Please remove - eagledude4 - 12-31-2011

Fixed.


RE: Changing a lamp entity's radius - Statyk - 12-31-2011

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)


RE: Changing a lamp entity's radius - Your Computer - 12-31-2011

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.


RE: Changing a lamp entity's radius - eagledude4 - 01-01-2012

@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:
Code:
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.



RE: Changing a lamp entity's radius - Your Computer - 01-01-2012

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.


RE: Changing a lamp entity's radius - Khyrpa - 01-01-2012

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



RE: Changing a lamp entity's radius - Your Computer - 01-01-2012

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

What, what?


RE: Changing a lamp entity's radius - eagledude4 - 01-01-2012

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



RE: Changing a lamp entity's radius - flamez3 - 01-01-2012

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

What, what?
Lol


RE: Changing a lamp entity's radius - Khyrpa - 01-01-2012

(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/tutorials/level_editor/tutorial_2#connecting_entities_with_ambient_lights

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