Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Level Editor Help New Question: How to create a door
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#6
RE: 3 Questions: Cave In and Destroying bookshelf

Bothering? I have fun helping people Smile
So, that callback you stated, I couldn't even find it in the engine scripts page. Where did you get that one from? I would suggest use AddUseItemCallback. Go to the Engine scripts page on the wiki(http://wiki.frictionalgames.com/hpl2/amn..._functions) and search for that callback to understand which is for what. Here's an example script:

void OnStart()
{
AddUseItemCallback("", "hammer", "shelf", "DestroyShelf", true);
}
void DestroyShelf(string &in asItem, string &in asEntity)
{
//Do your stuff, whatever you want to do, here. Example:
FadeOut(2);
AddTimer("Timer_1", 2, "PlaySound");
}
void PlaySound(string &in asTimer)
{
PlaySoundAtEntity("", "YOURBREAKSOUNDHERE.snt", "shelf", 0, false);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}

This script basically makes you fade out for 2 seconds after you used the hammer on the shelf, plays the sound you wish for, and after 1 second it fades back in for 2 seconds.
06-20-2012, 02:08 PM
Find


Messages In This Thread
New Question: How to create a door - by Nervly - 06-20-2012, 12:55 PM
RE: 3 Questions: Cave In and Destroying bookshelf - by Cruzore - 06-20-2012, 02:08 PM



Users browsing this thread: 1 Guest(s)