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
#43
RE: 3 Questions: Cave In and Destroying bookshelf

void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}
{
AddEntityCollideCallback("Player", "cavein_area", "cavein_function", true, 1);
void cavein_function(string &in asParent, string &in asChild, int alState)
AddTimer("Timer_1", 2, "PlaySound");
}
no initiated function, nothing is doing those last 3 rows.
take the AddEntityCollideCallback("Player", "cavein_area", "cavein_function", true, 1);
and put it into OnStart()
I'll correct and post the whole script for you:
void OnStart()
{
AddUseItemCallback("", "stone_hammer_1", "shelf", "DestroyShelf", true);
AddEntityCollideCallback("Player", "cavein_area", "cavein_function", true, 1);
}
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("", "break_wood.snt", "shelf", 0, false);
SetEntityActive("shelf", false);
SetEntityActive("book_row02_1", false);
SetEntityActive("book_row01_2", false);
SetEntityActive("book_pile01_1", false);
SetEntityActive("candlestick01_4", false);
SetEntityActive("book_row03_1", false);
SetEntityActive("book_open_1", false);
SetEntityActive("book_row02_2", false);
SetEntityActive("book_pile02_1", false);
SetEntityActive("book_pile01_2", false);
SetEntityActive("book_row02_3", false);
SetEntityActive("candlestick01_2", false);
SetEntityActive("candlestick01_3", false);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}

void cavein_function(string &in asParent, string &in asChild, int alState)
{
AddTimer("Timer_1", 2, "PlaySound");
}
void PlaySound(string &in asTimer)
{
PlaySoundAtEntity("", "explosion_rock_large.snt", "cave_in_1", 0, false);
SetEntityActive("cave_in_1", true);
}

By the way, you maybe want to play the cave in sound at yourself, since if that cave in is too far away, you won't hear it. Putting the sound by you, you hear it like if it's a huge explosion/cave in
(This post was last modified: 06-21-2012, 09:30 PM by Cruzore.)
06-21-2012, 09:28 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-21-2012, 09:28 PM



Users browsing this thread: 1 Guest(s)