Frictional Games Forum (read-only)
[SCRIPT] Lights ^.^ (Fast answer :D) - 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: [SCRIPT] Lights ^.^ (Fast answer :D) (/thread-24902.html)

Pages: 1 2


Lights ^.^ (Fast answer :D) - Straxedix - 03-22-2014

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


RE: Lights ^.^ (Fast answer :D) - PutraenusAlivius - 03-22-2014

Yes, but without the void. And it should be in a callback function.


RE: Lights ^.^ (Fast answer :D) - Straxedix - 03-22-2014

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


RE: Lights ^.^ (Fast answer :D) - DnALANGE - 03-22-2014

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!


RE: Lights ^.^ (Fast answer :D) - Straxedix - 03-22-2014

yeah and how to make turn off many of them Smile ?


RE: Lights ^.^ (Fast answer :D) - DnALANGE - 03-22-2014

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.


RE: Lights ^.^ (Fast answer :D) - Straxedix - 03-22-2014

yeah it is thanks Smile


RE: Lights ^.^ (Fast answer :D) - DnALANGE - 03-22-2014

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.


RE: Lights ^.^ (Fast answer :D) - Straxedix - 03-22-2014

I know that Tongue
And i need just 6 so ^.^

And pls reply to my next thread i made in a min


RE: Lights ^.^ (Fast answer :D) - PutraenusAlivius - 03-23-2014

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