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
N00B needs help AGAIN
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#1
Bug  N00B needs help AGAIN

Hello I'm trying to make lamps go out when a player goes into an area but it doesn't work Sad (No errors)

AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);

. . .

void Function01(string &in asEntity)
{
SetEntityActive("candlestick01_1", false);
SetEntityActive("PointLight_1", false);
}

...
05-01-2011, 01:28 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#2
RE: N00B needs help AGAIN

(05-01-2011, 01:28 PM)X4anco Wrote: Hello I'm trying to make lamps go out when a player goes into an area but it doesn't work Sad (No errors)

AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);

. . .

void Function01(string &in asEntity)
{
SetEntityActive("candlestick01_1", false);
SetEntityActive("PointLight_1", false);
}
void OnStart()
{
AddEntityCollideCallback("Player", "LightsOut", "LightsOut", true, 1);
}
[...]

void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candles", false, false); //Lamp inactive
SetLightVisible("BoxLight_1", false); //Light inactive
}
Try that and see if it works, change the names to your correct ones, of course! Smile
(This post was last modified: 05-01-2011, 01:51 PM by Roenlond.)
05-01-2011, 01:51 PM
Find
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#3
RE: N00B needs help AGAIN

Thank you SO much Big Grin Big Grin Big Grin Big Grin
Oh one quick question how would I get a sound to play at the same time ? :/
coDe
_________________


PlaySoundAtEntity("", "guardian_activated1", "player", 0, true);

...
(This post was last modified: 05-01-2011, 02:09 PM by X4anco.)
05-01-2011, 02:05 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#4
RE: N00B needs help AGAIN

(05-01-2011, 02:05 PM)X4anco Wrote: Thank you SO much Big Grin Big Grin Big Grin Big Grin
Oh one quick question how would I get a sound to play at the same time ? :/
coDe
_________________


PlaySoundAtEntity("", "guardian_activated1", "player", 0, true);

I would use:
void OnStart()
{
AddEntityCollideCallback("Player", "LightsOut", "LightsOut", true, 1);
}
[...]

void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candles", false, false); //Lamp inactive
SetLightVisible("BoxLight_1", false); //Light inactive
PlayGuiSound("guardian/guardian_activated1.ogg", 1);
}

I didn't test it, but it should work.
(This post was last modified: 05-01-2011, 03:00 PM by Roenlond.)
05-01-2011, 03:00 PM
Find
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#5
RE: N00B needs help AGAIN

Thankyou Big Grin Big Grin Big Grin

...
05-01-2011, 09:43 PM
Find
ricky horror Offline
Member

Posts: 54
Threads: 8
Joined: Apr 2011
Reputation: 0
#6
RE: N00B needs help AGAIN

also, PlaySoundAtEntity and PlayMusic works too

Amnesia: Ricky's Horror - Full Conversion
05-02-2011, 12:11 AM
Find




Users browsing this thread: 1 Guest(s)