Frictional Games Forum (read-only)

Full Version: Entity won't activate.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
If the entity is a StaticProp entity, it won't work to disable it. What entity are you trying to do this with?
(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.
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?
(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
Show the script. It's easier to find the mistake that way
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.).