Frictional Games Forum (read-only)
[LVL ED] Entities won't go unactive and light - 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: [LVL ED] Entities won't go unactive and light (/thread-13625.html)



Entities won't go unactive and light - Ermu - 02-27-2012

Hey!

I have 2 problems.

_____________________________________________________________________

First:
So, my problem is that i have a scare where entities show up all sudden, but the entities are active at all times before even triggering the script. I have set all the entities unactive from Level Editor and also tried to set then unactive with script... But they won't go unactive at all.

[Image: 1zezibb.jpg]

[Image: rmljc8.jpg]


Script:

void OnStart()
{
AddEntityCollideCallback("Player", "candlestick_redarea", "redscare", true, 1);
SetLocalVarInt("redfurni", 0);
}

void CheckRedFurni()
{
if(GetLocalVarInt("redfurni") == 1)
{
SetEntityActive("redfurniture_1", true);
SetEntityActive("redfurniture_2", true);
SetEntityActive("redfurniture_3", true);
SetEntityActive("redfurniture_4", true);
SetEntityActive("redfurniture_5", true);
SetEntityActive("redfurniture_6", true);
SetEntityActive("redfurniture_7", true);
SetEntityActive("redfurniture_8", true);
SetEntityActive("redfurniture_9", true);
SetEntityActive("redfurniture_10", true);
SetEntityActive("redfurniture_11", true);
SetEntityActive("redfurniture_12", true);
SetEntityActive("redfurniture_13", true);
}
else
{
SetEntityActive("redfurniture_1", false);
SetEntityActive("redfurniture_2", false);
SetEntityActive("redfurniture_3", false);
SetEntityActive("redfurniture_4", false);
SetEntityActive("redfurniture_5", false);
SetEntityActive("redfurniture_6", false);
SetEntityActive("redfurniture_7", false);
SetEntityActive("redfurniture_8", false);
SetEntityActive("redfurniture_9", false);
SetEntityActive("redfurniture_10", false);
SetEntityActive("redfurniture_11", false);
SetEntityActive("redfurniture_12", false);
SetEntityActive("redfurniture_13", false);
}
}

void redscare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("candlestick_redred_*", false);
SetEntityActive("candlestick_red_*", true);
PlaySoundAtEntity("", "15_the_big_scream.snt", "Player", 0, false);
SetEntityActive("redfurniture_*", true);
AddDebugMessage("Lights on", false);
AddLocalVarInt("redfurni", 1);
}

______________________________________________________________________________________________

Second problem:

Is that, the red light (also shown in the picture above) goes trough wall and floor to the other rooms.. Also some candle lights go trough walls and i want to block this from happening. Can anything be done to this?


RE: Entities won't go unactive and light - Prelauncher - 02-27-2012

To your second question the answer is unfortunately no, there´s nothing to be done about lights shining through walls. But what you can do is to angle the light. Rotate the lamps in the editor and you´ll see what I mean. Proper lighting is (in my opinion) a hard thing to grasp at first when using the level editor. I recommend using pointlights to get the desired look since the area being lit by the lamps themselves are not that big.


RE: Entities won't go unactive and light - Obliviator27 - 02-27-2012

In regards to your first question, some items just cannot be set to inactive. Try using SetPropActiveAndFade instead, as this occasionally works. Otherwise, you'll have to use different entities, or teleport the player to a different area that looks the same, but has the furniture.