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
Check LampLit?
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#1
Check LampLit?

hey guys, i was wondering how to call a check on weather 2 lamps have been lit or not.

E.g. Player lights 2 lamps, calls an easter egg sound.

I have a feeling it has something to do with GetPropIsInteractedWith(string& asName);, but i wouldn't know how to call that...

In other words, what would a callback be when a player uses a tinderbox?

Can i get a hand?
________________________
Edit, Nevermind, just figured it out|| SetEntityCallbackFunc(string& asName, string& asCallback);

void MyFunc(string &in asEntity, string &in OnIgnite)

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-21-2012, 12:01 PM by Tripication.)
01-21-2012, 11:44 AM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#2
RE: Check LampLit?

You could do variable and every time you lit a candle it adds one to it
and checks when its 2 ---> Easter egg sound

When Life No Longer Exists
Full-conversion mod
01-21-2012, 12:03 PM
Website Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#3
RE: Check LampLit?

Thats exactly what i did.

void OnStart
{

SetEntityCallbackFunc("EE1", "AddAndCheck1");
SetEntityCallbackFunc("EE2", "AddAndCheck2");
}


void AddAndCheck1(string &in asEntity, string &in OnIgnite)
{
AddLocalVarInt("EE", 1);
EasterEgg();
}

void AddAndCheck2(string &in asEntity, string &in OnIgnite)
{
AddLocalVarInt("EE", 1);
EasterEgg();
}


void EasterEgg()
{
if (GetLocalVarInt("EE") == 2)
{
SetEntityActive("Otis", true);
}
}

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
01-21-2012, 12:05 PM
Find




Users browsing this thread: 1 Guest(s)