Nervly
Junior Member
Posts: 40
Threads: 2
Joined: Feb 2012
Reputation:
0
|
RE: 3 Questions: Cave In and Destroying bookshelf
(06-20-2012, 02:08 PM)FastHunteR Wrote: Bothering? I have fun helping people
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
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?
|
|
06-20-2012, 02:13 PM |
|