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
Code help: Trigger when lit
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#7
RE: Code help: Trigger when lit

Candles actually have an option in their entity options called CallbackFunc, and one of the Types it can function as is 'OnIgnite', much easier with much less inventory checking. Basically, you define a function name for it to point to, for example I tested it with 'testignite' as the function name. Then, in your script, you have something like this:

void testignite(string &in EntityName, string &in Type)
{
    if(Type == "OnIgnite")
    {
        AddDebugMessage("Ignited_callback_scare", false);
        PlaySoundAtEntity("rawr", "guardian_ontop.snt", "Player", 0.0f, false);
    }
}

In that fully functional sample, when the candle is ignited with a tinderbox, it sends out a debug message and a scary sound.
10-03-2010, 03:19 AM
Find


Messages In This Thread
RE: Code help: Trigger when lit - by HakePT - 10-02-2010, 09:38 PM
RE: Code help: Trigger when lit - by Jordo76 - 10-02-2010, 09:46 PM
RE: Code help: Trigger when lit - by Noj - 10-02-2010, 11:15 PM
RE: Code help: Trigger when lit - by Entih - 10-03-2010, 03:19 AM



Users browsing this thread: 1 Guest(s)