Frictional Games Forum (read-only)
Problem deactivating entity - 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: Problem deactivating entity (/thread-24232.html)



Problem deactivating entity - DoReMiFaSoLaTi - 12-27-2013

I'm working on a custom story and I've spawned the entity "Deformed Man" (Statue). The name of the entity is deformed_man_1, in my .hps-file I've deactivated this entity at the beginning:
Code:
void OnStart()
{
//Player Enviroment//
FadeOut(0);
AddTimer("", 1, "StartTheGame");
SetLightVisible("PointLight_2", false);

//Music//
PlaySoundAtEntity("", "general_rain.ogg", "Player", 3, true);
PlaySoundAtEntity("", "general_thunder.ogg", "Player", 3, true);

//Collides//
AddEntityCollideCallback("armour_rusty_head_1", "ScriptArea_1", "LevelDoorIs", true, 1);

//Interactions//
SetEntityPlayerInteractCallback("armour_rusty_head_1", "ShowStatue", true);

//Enteties//
SetEntityActive("level_wood_1", false);
SetEntityActive("deformed_man_1", false);
}

(This is only the OnStart() part of the code)
The problem is: the entity is still active when I start the map (which it should not be). I've also tried deactivating it from the Level Editor, this didn't work either. (I've looked for map cache-files, but they are removed)

Please help me


RE: Problem deactivating entity - daortir - 12-27-2013

You cannot make the deformed_man entity active/inactive, I had this issue weeks ago when I tried to make a Weeping Angel-like encounter.

I solved this problem using the statues from the ptest folder, those can be de-activated.

I think you could also edit the deformed_man statue to make it de-activable, but I won't help you on that because I don't know anything about it.


RE: Problem deactivating entity - DoReMiFaSoLaTi - 12-27-2013

(12-27-2013, 12:06 AM)daortir Wrote: You cannot make the deformed_man entity active/inactive, I had this issue weeks ago when I tried to make a Weeping Angel-like encounter.

I solved this problem using the statues from the ptest folder, those can be de-activated.

I think you could also edit the deformed_man statue to make it de-activable, but I won't help you on that because I don't know anything about it.

Thank you so much! This helped alot.


RE: Problem deactivating entity - daortir - 12-27-2013

My pleasure. Here have a cookie, it improves everything : >.


RE: Problem deactivating entity - WALP - 12-27-2013

If you absolutely need to make the deformed man activate/deactivate-able I would probably look at making a copy of its entity file and changing its type in the model editor, as the cause of the issue is likely that it is of a type that does not support the function.


RE: Problem deactivating entity - daortir - 12-27-2013

What type would you use, The Mug ? I am curious about it because I don't know how to do it and I think it might come in handy :3


RE: Problem deactivating entity - WALP - 12-27-2013

Well I would find another entity that works with SetEntityActive(), and has the necessary features you need for the entity that needs to be changed. Then I would open it in the modeleditor and look at what type it is.
Then I would make a copy of the problematic entity and change it to be that type and it should work, TADA!


RE: Problem deactivating entity - Acies - 12-27-2013

Object subtype static (or any other subtype under object) will allow the object to be activated/deactivated.

Having it as Staticobject - no subtype doesn't allow the entity to be activated/deactivated.


RE: Problem deactivating entity - Traggey - 12-28-2013

Moved to the right section.


RE: Problem deactivating entity - Damascus - 12-29-2013

Basically objects of the type StaticProp will always be active, no matter what. Make a copy of the entity for your custom stories folder and change it to Type:Object, SubType: Static. c: