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
Level Editor Help Entities won't go unactive and light
Ermu Offline
Member

Posts: 86
Threads: 13
Joined: Jan 2012
Reputation: 2
#1
Entities won't go unactive and light

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?
02-27-2012, 02:31 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#2
RE: Entities won't go unactive and light

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.

Socialism (noun): A great way to run out of other people's money.
02-27-2012, 03:02 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#3
RE: Entities won't go unactive and light

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.

02-27-2012, 03:19 PM
Find




Users browsing this thread: 2 Guest(s)