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
lamp question
Danny Boy Offline
Posting Freak

Posts: 2,718
Threads: 85
Joined: Mar 2011
Reputation: 81
#1
lamp question

is it possible to make a script that wend i lit a lamp... for example other lights will turn on?
07-15-2011, 11:26 PM
Website Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: lamp question

Yes, but you'll have to record if they have a tinderbox or not when they click on it.

You could simply have this, except it might not always work:

void OnStart()
{
     SetEntityPlayerInteractCallback("Lamp_1", "Func01", true);
}
void Func01(string &in asEntity)
{
     SetLightVisible("Lamp_2", true);
     SetLightVisible("Lamp_3", true);
}

Lamp_1 is the name of the candle or light that the player lights with a tinderbox and Lamp_2 and Lamp_3 are the ones that get set lit after you light Lamp_1. You can add many as you would like to it, but like I said, it won't completely work if the player touches the lamp without a tinderbox.

(This post was last modified: 07-16-2011, 12:05 AM by Kyle.)
07-15-2011, 11:32 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#3
RE: lamp question

(07-15-2011, 11:32 PM)Kyle Wrote: Yes, but you'll have to record if they have a tinderbox or not when they click on it. You could simply have this, except it might not always work:
- snip -
Well to remedy that I would suggest doing it this way.

Select the entity you want the function to be triggered on and then go into the entity tab. In the "Callback Func" box write a function name, my example will be "IgniteLamp1"

Now, in your .hps file, place this not inside any of the main functions...

void IgniteLamp1(string &in asEntityName, string &in asType)
     {
          if(asType=="OnIgnite") {
                SetLampLit("Lamp2", true, false);
                SetLampLit("Lamp3", true, false);
            }
     }

When you are done with that, go to every lamp you want lit and place in the "Callback Func" box the same function name. Of course you'll need to edit the correct names and such Smile

Insanity. Static.
(This post was last modified: 07-16-2011, 02:15 AM by Juby.)
07-16-2011, 02:12 AM
Find




Users browsing this thread: 1 Guest(s)