Nervly
Junior Member
Posts: 40
Threads: 2
Joined: Feb 2012
Reputation:
0
|
RE: 3 Questions: Cave In and Destroying bookshelf
(06-21-2012, 09:59 PM)FastHunteR Wrote: oh, i didn't see that one.
at the very last function, change its name to something else than PlaySound, since it already exists a bit up. Also, change the timer right above it to its name. It's now working
I saw in the Engine scripts a command to create particle systems at entities.
I used it at the end of the script, you'll see it easily.
It is giving me a error. Other thing I wanted to do, if the particle system doesn't work, was making the player not able to move while it fades out and in, otherwise he can pass through the cave in before it appears :/
Here's the script:
Quote: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)
void CreateParticleSystemAtEntity(string& "ParticleSystem_1", string& "ps_break_cavein", string& "cave_in_1", bool abSavePS);
{
PlaySoundAtEntity("", "explosion_rock_large.snt", "cave_in_1", 0, false);
SetEntityActive("cave_in_1", true);
SetEntityActive("cave_in_2", true);
}
(This post was last modified: 06-22-2012, 01:26 AM by Nervly.)
|
|