void OnStart()
{
//servant_brute_NoSound_1
string brute = "servant_brute_NoSound_1";
for (int x = 1; x <= 17; x++) //Initialize all wall-phase collision detections
{
AddEntityCollideCallback(brute, "block_box_"+x, "WallPhase", false, 1); //When the brute collides with a block_box, deactivate the block box.
}
ShowEnemyPlayerPosition(brute);
}
void WallPhase(string &in asParent, string &in asChild, int alState) //when enemy interacts with block_box, it deactivates it
{
string x = StringSub(asChild, 11, 2);
SetEntityActive(asChild, false); //Deactivate box
AddEntityCollideCallback("servant_brute_NoSound_1", "ScriptArea_"+x, "WallSeal", true, -1); //Waits for enemy to leave area
}
void WallSeal(string &in asParent, string &in asChild, int alState) //Called when enemy leaves area
{
string x = StringSub(asChild, 11, 2); //get substring to obtain the number that tells us which box to reactivate.
SetEntityActive("block_box_"+x, false); //Reactivate box
FadeEnemyToSmoke(asParent, false); //TEST TO SEE IF THIS METHOD IS CALLED. RIGHT NOW, IT IS NOT.
}
I'm currently trying to come up with a system to have an enemy be able to phase through walls, much like the one in SCP-CB. Right now, I surround my wall pieces in thin block_box'es and change the wall's collide value to false. Since I cannot change that value freely with scripting alone, I turn to using blockboxes as the
actual object that you collide with when you walk into a wall.
Sidenote: while typing this, I just realized that I could just have 2 walls in the same exact spot, 1 that collides, and one that doesn't. When the enemy collides with the collide-able wall, it deactivates that wall, but leave the non-collide-able wall activated. Although, I'm not sure If I can activate/deactivate walls. And it's too late now to change from blockboxes, but whatevs.
Anyway, I also surround the wall with thin ScriptAreas, so that when the enemy is finished walking through the wall, it can reactivate the blockbox so that the player cannot walk through it.
What I've noticed is that the function that is supposed to be called after the enemy leaves the area is not being called. I've had problems with this in the past, and maybe I just need some straight answers. Why is the function not being called when the enemy exits the area.
SetEntityActive("block_box_"+x, false); //Reactivate box
Here's one problem, forgot to change false to true when I copy-pasted.