Frictional Games Forum (read-only)
Declaring an entity - 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: Declaring an entity (/thread-18160.html)



Declaring an entity - JPiiONEFOURONE - 09-05-2012

Hey guys,

I am connecting a point light to a candlestick, so when the candlestick is lit by the player, the point light activates.

[Image: Untitled.png]

In my mapname.hps file, I have the following function.

Code:
void LightCandle1(string &in asEntity)
{
    SetLightVisible(PointLight_1, true);
}

When I try to load the map, I get this error;

[Image: Untitled2.png]

How do I fix this error?

Thanks,

JPiiONEFOURONE


RE: Declaring an entity - Your Computer - 09-05-2012

(09-05-2012, 10:21 AM)JPiiONEFOURONE Wrote: How do I fix this error?

By converting the undeclared variable into a string.


RE: Declaring an entity - Obliviator27 - 09-05-2012

You could always set the pointlight to 0, 0, 0, 0 and put it into the ConnectedLight field. This way, when the candle is lit, the pointlight will take on the color of the candle.


RE: Declaring an entity - Steve - 09-05-2012

by declaring pointlight1 so make it this:
SetLightVisible("PointLight_1", true);


RE: Declaring an entity - GoranGaming - 09-05-2012

You could also write the name of the point light in "COnnected Light", it works, trust me


RE: Declaring an entity - FlawlessHappiness - 09-05-2012

As Steve said. To "Declare" is what i just did with the word: Declare. You put it between these " " 2 fellows.


RE: Declaring an entity - failedALIAS - 09-05-2012

"Declaring an entity."
No thanks, I'm an atheist.