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
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#7
RE: 3 Questions: Cave In and Destroying bookshelf

(06-20-2012, 02:08 PM)FastHunteR Wrote: 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.
That's good to hear Smile
Now I see why I couldn't find the AddUseItemCallback, I was in this website: http://wiki.frictionalgames.com/hpl1/doc..._reference
Thanks for the script, where do I put it for it to work?

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
06-20-2012, 02:13 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 Nervly - 06-20-2012, 02:13 PM



Users browsing this thread: 4 Guest(s)