Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing entities
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#1
Removing entities

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?

//////////////////////////////////////////////////
// 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);
}
11-09-2011, 10:15 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Removing entities

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):

//___________________________________
//////////////////////////////////////////////////
// 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);
}

//_________________________
(This post was last modified: 11-09-2011, 10:34 PM by Statyk.)
11-09-2011, 10:31 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#3
RE: Removing entities

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?
11-10-2011, 07:28 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#4
RE: Removing entities

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

When Life No Longer Exists
Full-conversion mod
11-10-2011, 07:36 PM
Website Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#5
RE: Removing entities

(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


11-10-2011, 08:18 PM
Find
darkside Offline
Junior Member

Posts: 20
Threads: 2
Joined: Aug 2011
Reputation: 0
#6
RE: Removing entities

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.

Snowy background, anyone?
Now, where was that grunt with the santa hat ....
(This post was last modified: 11-10-2011, 08:27 PM by darkside.)
11-10-2011, 08:26 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#7
RE: Removing entities

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.
11-10-2011, 08:31 PM
Find
Sauron The King Offline
Junior Member

Posts: 42
Threads: 10
Joined: Oct 2011
Reputation: 0
#8
RE: Removing entities

(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!


11-11-2011, 01:34 PM
Find




Users browsing this thread: 1 Guest(s)