Frictional Games Forum (read-only)
Entity won't activate. - 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: Entity won't activate. (/thread-27037.html)



Entity won't activate. - Spazatron - 10-29-2014

I have an entity that needs to be activated at a certain point with SetEntityActive. I have pretty much the exact same script elsewhere in the game and it works fine, but this time it doesn't want to work. It's not a scripting error, because it happens in a timer with other bits of code and they work fine, it's just this one line of code that doesn't work. I've tried changing the entity to another one, I've tried setting the physics to static, I've tried replaying the story from scratch under a different profile, and it still won't show up. I've also tried moving the line of code (SetEntityActive) to a different place in the script but again, it doesn't work.


RE: Entity won't activate. - Mudbill - 10-29-2014

If the entity is a StaticProp entity, it won't work to disable it. What entity are you trying to do this with?


RE: Entity won't activate. - Spazatron - 10-29-2014

(10-29-2014, 07:15 PM)Mudbill Wrote: If the entity is a StaticProp entity, it won't work to disable it. What entity are you trying to do this with?

I'm trying to do it with an Item (something you can pick up and then gets stored in your inventory). Like I said, it can't be the type of entity that's the problem because it works with the exact same entity elsewhere in the script.


RE: Entity won't activate. - Mudbill - 10-29-2014

Did you try adding a AddDebugMessage script next to it and check if it's running?
Is the name actually matching the level editor and script?


RE: Entity won't activate. - Spazatron - 10-29-2014

(10-29-2014, 08:04 PM)Mudbill Wrote: Did you try adding a AddDebugMessage script next to it and check if it's running?
Is the name actually matching the level editor and script?

Yes and yes. Still not working. I honestly cannot see anything wrong with the map, the name of the entity or the coding. Huh


RE: Entity won't activate. - FlawlessHappiness - 10-29-2014

Show the script. It's easier to find the mistake that way


RE: Entity won't activate. - Ongka - 10-29-2014

AngelScript (C++) is case-sensitive, so check if the item name is written exactly the same.
SetEntityActive("Key_01", true); doesn't work if the item is called KEY_01 in the level editor.
If that doesn't work make sure your function gets executed (add debug messages, check area names and CollideCallbacks for typos etc.).