[SOLVED]Now I see you... Oh wait a minute, I don't - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: [SOLVED]Now I see you... Oh wait a minute, I don't (/thread-6383.html) |
[SOLVED]Now I see you... Oh wait a minute, I don't - rmdashrf - 01-26-2011 Hi I was wondering how to make an object "disappear" or alter its state when the Player is not looking at it. I'm assuming there is some sort of callback? (For an example, watch 0:36 to 1:00 in this video: http://www.youtube.com/watch?v=4bZOvt72S5g&feature=related) (Also the "paint the man cut the lines" level where there are bodies that hang in the hallway but disappear after you look away). Thanks in advance! RE: Now I see you... Oh wait a minute, I don't - Tanshaydar - 01-26-2011 Code: /** RE: Now I see you... Oh wait a minute, I don't - Tottel - 01-26-2011 I'm guessing void SetEntityActive(string& asName, bool abActive); In combination with an area which is triggered when you have looked at it, and then look away again. I haven't done this before, but you can probably use this then: void SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt); I haven't used this Callback before; what I would do is make a new variable that adds one when you look at the object. When you look away, it adds another one. Make a check if the variable is 2. If so, SetEntityActive(); But there's probably a simpler method with that callback. Feel free to experiment. RE: [SOLVED]Now I see you... Oh wait a minute, I don't - Frontcannon - 01-26-2011 I've done exactly this with the skull scene in my custom story, here is the script (sorry, it's a bit complicated): Code: //those are in OnStart() |