Frictional Games Forum (read-only)

Full Version: Lights ^.^ (Fast answer :D)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hii ^.^

i need help i wanna when player walk in area to all light's turn off so it's like this ???

AddEntityColideCallback("Player", "area2", "lightsdown", true, 1);


void SetLampLit("Light1", false, false);




----------------------------------------------------------------------

void SetLampLit(string& asName, bool abLit, bool abEffects);
(Un)lits a lamp.

asName - Name of the lamp
abLit - Set true if you want the lamp to be lit, set to false if you want the lamp to be unlit
abEffects - If you want to have the lamp fade in/out when it gets (un)lit
Yes, but without the void. And it should be in a callback function.
SomethingRidiculous appears Big Grin

Thanks man ! Smile

SO i set like this


AddEntityColideCallback("Player", "LightScript", "lightsdown", true, 1);

lightsdown("Torch1", false, false);


and it not works ?

and how to make when enter 1 area to turn off more then 1 light anyone know ?

and it say's expected identifer
No,
You have to do it like this :

AddEntityColideCallback("Player", "LightScript", "lightsdown", true, 1);

void lightsdown(string &in asParent, string &in asChild, int alState)
{
SetLampLit("Torch1", false, false);
}

Try that, it should do what you want.
---
You do NOT have to say FAST ANWSER...
We Always help asap as we can, don't worry about that!
yeah and how to make turn off many of them Smile ?
I guess you mean this :

void lightsdown(string &in asParent, string &in asChild, int alState)
{
SetLampLit("Torch1", false, false);
SetLampLit("Torch2", false, false);
SetLampLit("Torch3", false, false);
SetLampLit("Torch4", false, false);
SetLampLit("Torch5", false, false);
SetLampLit("Torch6", false, false);
SetLampLit("Torch7", false, false);
}

And so on, just add as how many you need\prefer.
yeah it is thanks Smile
Just a hint for you :
SetLampLit("Torch7", false, false);

The second false is for FADING the lights.
It gives a bit more of a realistic look.

so false,false = off inmidiatly
and false,true = fade the light to off.
I know that Tongue
And i need just 6 so ^.^

And pls reply to my next thread i made in a min
(03-22-2014, 02:00 PM)DnALANGE Wrote: [ -> ]I guess you mean this :

void lightsdown(string &in asParent, string &in asChild, int alState)
{
SetLampLit("Torch1", false, false);
SetLampLit("Torch2", false, false);
SetLampLit("Torch3", false, false);
SetLampLit("Torch4", false, false);
SetLampLit("Torch5", false, false);
SetLampLit("Torch6", false, false);
SetLampLit("Torch7", false, false);
}

And so on, just add as how many you need\prefer.

It's easier to do name it (in the Level Editor) Torch_1, Torch_2 and so on so that instead of 6 same function you could just write:
PHP Code:
SetLampLit("Torch_*"falsetrue); 

It's easier, cleaner and more efficient that way.
Pages: 1 2