Frictional Games Forum (read-only)
Why the hell wont this work?! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Why the hell wont this work?! (/thread-11766.html)



Why the hell wont this work?! - Brute - 12-09-2011

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("LeverExit" , "ShelfDestroyer" , "OpentheExit" , true , 1);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
////////////////////////////
// Actual functions

void OpentheExit(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("SHELF", false);
PlaySoundAtEntity("", "levelexitopen.snt", "LeverExit", 0.5f, false);
}

====================================================
Help, I am freaking out! Angry
The Shelf didn't dissapear!


RE: Why the hell wont this work?! - flamez3 - 12-09-2011

(12-09-2011, 03:30 PM)Brute Wrote: ////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("LeverExit" , "ShelfDestroyer" , "OpentheExit" , true , 1);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
////////////////////////////
// Actual functions

void OpentheExit(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("SHELF", false);
PlaySoundAtEntity("", "levelexitopen.snt", "LeverExit", 0.5f, false);
}

====================================================
Help, I am freaking out! Angry
The Shelf didn't dissapear!
Some entities don't deactivate in amnesia. Such as the desk and tables.


RE: Why the hell wont this work?! - Acies - 12-09-2011

Some entities cannot be set to SetEntityActive = false. You can circumvent this by opening the shelf in ModelEditor and set the "static" to "Object + static". Then save it as a new .ent file. Place that new entity instead of the shelf and you should be set to go.



RE: Why the hell wont this work?! - flamez3 - 12-09-2011

(12-09-2011, 03:45 PM)Acies Wrote: Some entities cannot be set to SetEntityActive = false. You can circumvent this by opening the shelf in ModelEditor and set the "static" to "Object + static". Then save it as a new .ent file. Place that new entity instead of the shelf and you should be set to go.
Thanks, handy to know if I need something like that done. ^^


RE: Why the hell wont this work?! - Brute - 12-09-2011

Oh my goodness! Are you guys kidding me??? XD
So many hours, just to knowing THIS?!

Thanks guys, it work now! Smile