Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved Check LampLit?
Author Message
Tripication Offline
Member

Posts: 172
Joined: Dec 2011
Reputation: 6
Post: #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 all posts by this user Quote this message in a reply
Unearthlybrutal Offline
Senior Member

Posts: 693
Joined: May 2011
Reputation: 24
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Tripication Offline
Member

Posts: 172
Joined: Dec 2011
Reputation: 6
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)