Frictional Games Forum (read-only)
Removing entities - 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: Removing entities (/thread-11281.html)



Removing entities - Sauron The King - 11-09-2011

Hello,

I'm making a custom story in which you have to set a painting on fire with a candle and tinderboxes. I've made the following script:
The painting will get on fire as soon as I lit the candle. But the fire won't go out at all, nor will the painting go away. I've used "SetEntityActive" with "false" as bool. The fire will appear, but nothing will disappear at all. What is wrong?

Code:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityCallbackFunc("candlestick01_1", "painting03_1_Burns");
}
///////////////////////////////////////////////////
///The Oratory

void painting03_1_Burns(string &in asEntity, string &in type)
{
AddTimer("Schilderij_Verbrand_1", 0.3, "Schilderij_Verbrand_1");
}

void Schilderij_Verbrand_1(string &in asTimer)
{
SetEntityActive("13_burner_2", true);
SetEntityActive("13_burner_3", true);
AddTimer("Schilderij_Verbrand_2", 0.15, "Schilderij_Verbrand_2");
}

void Schilderij_Verbrand_2(string &in asTimer)
{
SetEntityActive("13_burner_4", true);
SetEntityActive("13_burner_5", true);
AddTimer("Schilderij_Verbrand_3", 0.15, "Schilderij_Verbrand_3");
}

void Schilderij_Verbrand_3(string &in asTimer)
{
SetEntityActive("13_burner_6", true);
SetEntityActive("13_burner_7", true);
AddTimer("Schilderij_Verbrand_4", 0.15, "Schilderij_Verbrand_4");
}

void Schilderij_Verbrand_4(string &in asTimer)
{
SetEntityActive("13_burner_8", true);
SetEntityActive("13_burner_9", true);
AddTimer("Schilderij_Verbrand_5", 0.15, "Schilderij_Verbrand_5");
}

void Schilderij_Verbrand_5(string &in asTimer)
{
SetEntityActive("13_burner_10", true);
SetEntityActive("13_burner_11", true);
AddTimer("Schilderij_Verbrand_6", 0.15, "Schilderij_Verbrand_6");
}

void Schilderij_Verbrand_6(string &in asTimer)
{
SetEntityActive("13_burner_12", true);
SetEntityActive("13_burner_13", true);
AddTimer("Schilderij_Verbrand_7", 0.15, "Schilderij_Verbrand_7");
}

void Schilderij_Verbrand_7(string &in asTimer)
{
SetEntityActive("13_burner_14", true);
SetEntityActive("13_burner_15", true);
AddTimer("Schilderij_Verbrand_8", 0.15, "Schilderij_Verbrand_8");
}

void Schilderij_Verbrand_8(string &in asTimer)
{
SetEntityActive("13_burner_16", true);
SetEntityActive("13_burner_17", true);
AddTimer("Schilderij_weg", 0.5, "Schilderij_weg");
}

void Schilderij_weg(string &in asTimer)
{
SetEntityActive("Compound_10", false);
AddTimer("vuur_weg16and17", 0.15, "vuur_weg_16and17");
}

void vuur_weg_16and17(string &in asTimer)
{
SetEntityActive("13_burner_16", false);
SetEntityActive("13_burner_17", false);
AddTimer("vuur_weg14and15", 0.15, "vuur_weg_14and15");
}

void vuur_weg14and15(string &in asTimer)
{
SetEntityActive("13_burner_14", false);
SetEntityActive("13_burner_15", false);
AddTimer("vuur_weg12and13", 0.15, "vuur_weg_12and13");
}

void vuur_weg12and13(string &in asTimer)
{
SetEntityActive("13_burner_12", false);
SetEntityActive("13_burner_13", false);
AddTimer("vuur_weg10and11", 0.15, "vuur_weg_10and11");
}

void vuur_weg10and11(string &in asTimer)
{
SetEntityActive("13_burner_10", false);
SetEntityActive("13_burner_11", false);
AddTimer("vuur_weg8and9", 0.15, "vuur_weg_8and9");
}

void vuur_weg8and9(string &in asTimer)
{
SetEntityActive("13_burner_8", false);
SetEntityActive("13_burner_9", false);
AddTimer("vuur_weg6and7", 0.15, "vuur_weg_6and7");
}

void vuur_weg6and7(string &in asTimer)
{
SetEntityActive("13_burner_6", false);
SetEntityActive("13_burner_7", false);
AddTimer("vuur_weg4and5", 0.15, "vuur_weg_4and5");
}

void vuur_weg4and5(string &in asTimer)
{
SetEntityActive("13_burner_4", false);
SetEntityActive("13_burner_5", false);
AddTimer("vuur_weg2and3", 0.15, "vuur_weg_2and3");
}

void vuur_weg2and3(string &in asTimer)
{
SetEntityActive("13_burner_2", false);
SetEntityActive("13_burner_3", false);
}



RE: Removing entities - Statyk - 11-09-2011

I think I see it... from where you start setting entities INACTIVE, you have the functions titled as the TIMER NAMES, NOT the callback the timer calls for. I fixed it up a bit. Let me know how it turned out. (just copy and replace the whole thing):

//___________________________________
Code:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityCallbackFunc("candlestick01_1", "painting03_1_Burns");
}
///////////////////////////////////////////////////
///The Oratory

void painting03_1_Burns(string &in asEntity, string &in type)
{
AddTimer("Schilderij_Verbrand1", 0.3, "Schilderij_Verbrand_1");
}

void Schilderij_Verbrand_1(string &in asTimer)
{
SetEntityActive("13_burner_2", true);
SetEntityActive("13_burner_3", true);
AddTimer("Schilderij_Verbrand2", 0.15, "Schilderij_Verbrand_2");
}

void Schilderij_Verbrand_2(string &in asTimer)
{
SetEntityActive("13_burner_4", true);
SetEntityActive("13_burner_5", true);
AddTimer("Schilderij_Verbrand3", 0.15, "Schilderij_Verbrand_3");
}

void Schilderij_Verbrand_3(string &in asTimer)
{
SetEntityActive("13_burner_6", true);
SetEntityActive("13_burner_7", true);
AddTimer("Schilderij_Verbrand4", 0.15, "Schilderij_Verbrand_4");
}

void Schilderij_Verbrand_4(string &in asTimer)
{
SetEntityActive("13_burner_8", true);
SetEntityActive("13_burner_9", true);
AddTimer("Schilderij_Verbrand5", 0.15, "Schilderij_Verbrand_5");
}

void Schilderij_Verbrand_5(string &in asTimer)
{
SetEntityActive("13_burner_10", true);
SetEntityActive("13_burner_11", true);
AddTimer("Schilderij_Verbrand6", 0.15, "Schilderij_Verbrand_6");
}

void Schilderij_Verbrand_6(string &in asTimer)
{
SetEntityActive("13_burner_12", true);
SetEntityActive("13_burner_13", true);
AddTimer("Schilderij_Verbrand7", 0.15, "Schilderij_Verbrand_7");
}

void Schilderij_Verbrand_7(string &in asTimer)
{
SetEntityActive("13_burner_14", true);
SetEntityActive("13_burner_15", true);
AddTimer("Schilderij_Verbrand8", 0.15, "Schilderij_Verbrand_8");
}

void Schilderij_Verbrand_8(string &in asTimer)
{
SetEntityActive("13_burner_16", true);
SetEntityActive("13_burner_17", true);
AddTimer("Schilderij_weg", 0.5, "Schilderij_wegCall");
}

void Schilderij_wegCall(string &in asTimer)
{
SetEntityActive("Compound_10", false);
AddTimer("vuur_weg16and17", 0.15, "vuur_weg_16and17");
}

void vuur_weg_16and17(string &in asTimer)
{
SetEntityActive("13_burner_16", false);
SetEntityActive("13_burner_17", false);
AddTimer("vuur_weg14and15", 0.15, "vuur_weg_14and15");
}

void vuur_weg_14and15(string &in asTimer)
{
SetEntityActive("13_burner_14", false);
SetEntityActive("13_burner_15", false);
AddTimer("vuur_weg12and13", 0.15, "vuur_weg_12and13");
}

void vuur_weg_12and13(string &in asTimer)
{
SetEntityActive("13_burner_12", false);
SetEntityActive("13_burner_13", false);
AddTimer("vuur_weg10and11", 0.15, "vuur_weg_10and11");
}

void vuur_weg_10and11(string &in asTimer)
{
SetEntityActive("13_burner_10", false);
SetEntityActive("13_burner_11", false);
AddTimer("vuur_weg8and9", 0.15, "vuur_weg_8and9");
}

void vuur_weg_8and9(string &in asTimer)
{
SetEntityActive("13_burner_8", false);
SetEntityActive("13_burner_9", false);
AddTimer("vuur_weg6and7", 0.15, "vuur_weg_6and7");
}

void vuur_weg_6and7(string &in asTimer)
{
SetEntityActive("13_burner_6", false);
SetEntityActive("13_burner_7", false);
AddTimer("vuur_weg4and5", 0.15, "vuur_weg_4and5");
}

void vuur_weg_4and5(string &in asTimer)
{
SetEntityActive("13_burner_4", false);
SetEntityActive("13_burner_5", false);
AddTimer("vuur_weg2and3", 0.15, "vuur_weg_2and3");
}

void vuur_weg_2and3(string &in asTimer)
{
SetEntityActive("13_burner_2", false);
SetEntityActive("13_burner_3", false);
}

//_________________________



RE: Removing entities - Sauron The King - 11-10-2011

Thanks for the fast response, I've used your code. Now the fire will disappear, but the painting won't go away at all. I've tried renaming it in both the script and in the level Editor, but it will just stay where it is Dodgy
Any ideas how to remove it?



RE: Removing entities - Unearthlybrutal - 11-10-2011

Is the painting static? I don't know if that really matters if its entity anyway... :/


RE: Removing entities - Sauron The King - 11-10-2011

(11-10-2011, 07:36 PM)Unearthlybrutal Wrote: Is the painting static? I don't know if that really matters if its entity anyway... :/
Yes it is, but even if I place another painting instead of that one, it won't disappear, I really don't get it Huh





RE: Removing entities - darkside - 11-10-2011

I don't know which one of them is the painting but I assume it's the compound. Try to disable the things without the compound.



RE: Removing entities - Statyk - 11-10-2011

Like darkside said. I've never tried disabling a compound before, but that could be the problem. change the name from "Compound_10" in the script to the specific name of the painting. and if you need multiple things disabled from the compound, you're going to have to write a script to disable each on it's own.



RE: Removing entities - Sauron The King - 11-11-2011

(11-10-2011, 08:31 PM)Statyk Wrote: Like darkside said. I've never tried disabling a compound before, but that could be the problem. change the name from "Compound_10" in the script to the specific name of the painting. and if you need multiple things disabled from the compound, you're going to have to write a script to disable each on it's own.
I've tried removing more paintings, but none of them will disappear. That's why I've replaced the paintings with curtains, these will disappear. So that's good for now Angel

Thanks for helping guys!