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
Script Help Lights ^.^ (Fast answer :D)
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#1
Question  Lights ^.^ (Fast answer :D)

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

(This post was last modified: 03-22-2014, 01:17 PM by Straxedix.)
03-22-2014, 01:16 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Lights ^.^ (Fast answer :D)

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-22-2014, 01:17 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#3
RE: Lights ^.^ (Fast answer :D)

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

(This post was last modified: 03-22-2014, 01:42 PM by Straxedix.)
03-22-2014, 01:20 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: Lights ^.^ (Fast answer :D)

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!
(This post was last modified: 03-22-2014, 01:59 PM by DnALANGE.)
03-22-2014, 01:57 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#5
RE: Lights ^.^ (Fast answer :D)

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

03-22-2014, 01:58 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#6
RE: Lights ^.^ (Fast answer :D)

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.
(This post was last modified: 03-22-2014, 02:00 PM by DnALANGE.)
03-22-2014, 02:00 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#7
RE: Lights ^.^ (Fast answer :D)

yeah it is thanks Smile

03-22-2014, 02:22 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#8
RE: Lights ^.^ (Fast answer :D)

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.
(This post was last modified: 03-22-2014, 02:36 PM by DnALANGE.)
03-22-2014, 02:31 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#9
RE: Lights ^.^ (Fast answer :D)

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, 03:12 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#10
RE: Lights ^.^ (Fast answer :D)

(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: (Select All)
SetLampLit("Torch_*"falsetrue); 

It's easier, cleaner and more efficient that way.

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-23-2014, 01:35 AM
Find




Users browsing this thread: 3 Guest(s)