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
Request Lantern Off
laser50 Offline
Member

Posts: 242
Threads: 22
Joined: Apr 2011
Reputation: 0
#1
Lantern Off

Imma keep this quick and simple since my cat pissed in my room, I can't find where it is comming from and it smells.
----


What was the code to make a Lantern turn off?
05-29-2011, 04:35 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Lantern Off

Ever checked the wiki? Might come in handy -> http://wiki.frictionalgames.com/hpl2/amn..._functions

void SetLanternActive(bool abX, bool abUseEffects);

Makes the player use his lantern.


bool GetLanternActive();

Checks whether the player currently uses his lantern.


void SetLanternDisabled(bool abX);

Enables/Disables the player's ability to use his lantern.


void SetLanternLitCallback(string& asCallback);

Sets the function to call when the player uses his lantern.
Callback syntax: MyFunc(bool abLit)

05-29-2011, 05:04 PM
Website Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#3
RE: Lantern Off

SetLanternActive(false, true); // To turn off the lantern.
SetLanternDisabled(true); // To deactivate the lantern.

[Image: 18694.png]
05-29-2011, 05:04 PM
Find
laser50 Offline
Member

Posts: 242
Threads: 22
Joined: Apr 2011
Reputation: 0
#4
RE: Lantern Off

Thanks, Those 2 Functions got me another step further. but i came onto a new question.


In a youtube movie, I saw this door. Not opening or being destroyed, But someone began banging on it.

How do i make something like this?
05-29-2011, 05:55 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#5
RE: Lantern Off

void OnStart()
{
AddEntityCollideCallback("Player", "AreaDoor", "CollideDoor", true, 1);
}

void CollideDoor(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("door", 0, 0, 20, "World"); // 0, 0, 20 are the x y z coordinates. You may have to adjust them a bit.
GiveSanityDamage(6.0f, true);
PlaySoundAtEntity("", "hit_wood.snt", "door", 0.0f, false);
AddTimer("DoorTimer", 1.0f, "TimerDoor");
}

void TimerDoor(string &in asTimer)
{
AddPropImpulse("door", 0, 0, 20, "World");
PlaySoundAtEntity("", "scare_male_terrified.snt", "door", 0.0f, false);
SetPropHealth("door", 20); //Only if you wish to damage the door.
}

[Image: 18694.png]
05-29-2011, 06:34 PM
Find
laser50 Offline
Member

Posts: 242
Threads: 22
Joined: Apr 2011
Reputation: 0
#6
RE: Lantern Off

Thank you. I hope the stuff i'm trying works out Big Grin
05-29-2011, 08:19 PM
Find




Users browsing this thread: 1 Guest(s)