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
Entity won't activate.
Spazatron Offline
Junior Member

Posts: 33
Threads: 17
Joined: Oct 2012
Reputation: 2
#1
Entity won't activate.

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.
(This post was last modified: 10-29-2014, 07:14 PM by Spazatron.)
10-29-2014, 07:12 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Entity won't activate.

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
Find
Spazatron Offline
Junior Member

Posts: 33
Threads: 17
Joined: Oct 2012
Reputation: 2
#3
RE: Entity won't activate.

(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.
(This post was last modified: 10-29-2014, 07:22 PM by Spazatron.)
10-29-2014, 07:20 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Entity won't activate.

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?

(This post was last modified: 10-29-2014, 08:05 PM by Mudbill.)
10-29-2014, 08:04 PM
Find
Spazatron Offline
Junior Member

Posts: 33
Threads: 17
Joined: Oct 2012
Reputation: 2
#5
Rainbow  RE: Entity won't activate.

(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
10-29-2014, 08:16 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Entity won't activate.

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

Trying is the first step to success.
10-29-2014, 08:34 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#7
RE: Entity won't activate.

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

[Image: 18694.png]
10-29-2014, 10:39 PM
Find




Users browsing this thread: 2 Guest(s)