(06-09-2012, 12:24 PM)Robosprog Wrote: Add a timer before you set them inactive? I think that's a solution.
Elaborating: I assume you have the script set up where once you step into the area the statues spawn? As far as my knowledge goes, you could create a timer so say, 5 seconds afterwards it activates another line that deactivates them.
(06-09-2012, 12:36 PM)beecake Wrote: AddTimer("", 5, KnightsDespawn);
void KnightsDespawn(string &in asTimer)
{
SetEntityActive("Knight1", false);
SetEntityActive("Knight2", false);
SetEntityActive("Knight3", false);
SetEntityActive("Knight4", false);
SetEntityActive("Knight5", false);
}
Ty!
(06-09-2012, 12:36 PM)beecake Wrote: AddTimer("", 5, KnightsDespawn);
void KnightsDespawn(string &in asTimer)
{
SetEntityActive("Knight1", false);
SetEntityActive("Knight2", false);
SetEntityActive("Knight3", false);
SetEntityActive("Knight4", false);
SetEntityActive("Knight5", false);
}
Uhm.. Could you clear my code? Because im getting error: main(92, 1) : ERR UNEXPECTED END OF FILE
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("cabinettrap", "Spawn", true);
AddUseItemCallback("", "giantkey1", "cellarmain", "KeyOnDoor2", true);
SetEntityPlayerInteractCallback("note1", "Morsot1", true);
AddEntityCollideCallback("Player", "knact", "knact", true, 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_1");
}
void Spawn(string &in asEntity)
{
SetEntityActive("corpse1", true);
AddTimer("Scare", 0.5f, "Scare1");
}
void Scare1(string &in asTimer)
{
GiveSanityDamage(10, true);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellarmain", false, true);
PlaySoundAtEntity("", "unlock_door", "cellarmain", 0, false);
RemoveItem("giantkey1");
}
void Morsot1(string &in item)
{
SetEntityActive("morso1", true);
}
void knact(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("kn1", true);
SetEntityActive("kn2", true);
SetEntityActive("kn3", true);
SetEntityActive("kn4", true);
SetEntityActive("kn5", true);
SetEntityActive("kn6", true);
SetEntityActive("kn7", true);
AddTimer("", 3, KnightsDespawn);
void KnightsDespawn(string &in asTimer)
{
SetEntityActive("kn1", false);
SetEntityActive("kn2", false);
SetEntityActive("kn3", false);
SetEntityActive("kn4", false);
SetEntityActive("kn5", false);
SetEntityActive("kn6", false);
SetEntityActive("kn7", false);
}