Frictional Games Forum (read-only)
Activate/Deactivate Static Objects etc. - 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: Activate/Deactivate Static Objects etc. (/thread-4583.html)

Pages: 1 2 3


Activate/Deactivate Static Objects etc. - mansarde - 09-19-2010

Apologies if this has been answered, but I didn't find anything about my problem afer searching for "deactive", "deactivate", "inactive", etc.

What I was trying to do:
Having a "static object" inactive (in the editor) and then activating it by an event.

It seems though, that you can only change the active/inactive state of entities.
So am I to understand that the possibility to make other objects inactive is only so you can't see them in the level editor? That'd really be a bummer.

But, if it is indeed possible to activate/deactivate "static objects" and others via script, then how do I do it?

For example:
I placed an inactive "bed_nice_1" in a room. After I walk into an area I want the bed to be activated (i.d. to appear). Normally I would expect this to work:
Code:
SetEntityActive("bed_nice_1", false);
But it only seems to work with entities, as I'v mentioned before.
So what (if at all!) do I have to do to achieve something similar with non-entities, like static objects and the like?

Any insight would be greatly appreciated, thanks in advance! Smile

EDIT: Ok, what's more: Even if I deactivate a static object in the editor, it still shows up ingame. :\


RE: Activate/Deactivate Static Objects etc. - jens - 09-20-2010

Static objects are static because they are static Smile

So you can only do what you want by using entities. You can use the model editor, to create an entity out of a static object.


RE: Activate/Deactivate Static Objects etc. - mansarde - 09-20-2010

(09-20-2010, 07:48 AM)jens Wrote: Static objects are static because they are static Smile

So you can only do what you want by using entities. You can use the model editor, to create an entity out of a static object.

Hmm, I have to admit it does make more sense this way.^^
I was just confused because in the level editor you can deactivate them.
So I guess it's a redundant checkbox then, thx for the clarification! Smile

But there's still something I'd like to know:
If I deactivate a light source like (for example) a boxlight, then it'll still be active ingame. Now, I accept that the effect a boxlight creates would, in real life, either be there or not and wouldn't be something you could switch off, like lamps.
But is there a possibility (or workaround) to make switchable boxlights (or pointlights)?
Can I achieve this the same way like what you told me about static objects (i.e. making an entity with a model of a static object)?
I just ask, because I don't believe I can just make an entity with a light-"model"... or can I ? Huh

Again, any help would be appreciated!
And thank you again for your tip regarding the static objects. Big Grin


RE: Activate/Deactivate Static Objects etc. - jens - 09-20-2010

A light should be possible to set to active false, if that is not working then something strange is going on. At least it works for pointlights and spotlights. If it is not workingin the editor you can use the script FadeLight to fade a light to for example black (0,0,0,0) and it will not be visible.


RE: Activate/Deactivate Static Objects etc. - mansarde - 09-20-2010

(09-20-2010, 04:54 PM)jens Wrote: A light should be possible to set to active false, if that is not working then something strange is going on. At least it works for pointlights and spotlights. If it is not workingin the editor you can use the script FadeLight to fade a light to for example black (0,0,0,0) and it will not be visible.

Alright, I'll try that.
Thank you very much for your help! Smile


RE: Activate/Deactivate Static Objects etc. - Armored Cow - 09-20-2010

I'd like to make a static object an entity because I want to blow it up, like the rocks in storage (although I'll be doing it offscreen so I just need it to disappear actually).

You said to open it in the model editor but it only lets you open entities.

So how do I go about doing this?


RE: Activate/Deactivate Static Objects etc. - mansarde - 09-20-2010

(09-20-2010, 09:07 PM)Armored Cow Wrote: I'd like to make a static object an entity because I want to blow it up, like the rocks in storage (although I'll be doing it offscreen so I just need it to disappear actually).

You said to open it in the model editor but it only lets you open entities.

So how do I go about doing this?

What you first need is the mesh of the static object.
For that you have to import the mesh into the Model Editor.
Go to File-> Import Mesh.

Then select the mesh from the "static object" folder (or any other folder) that you wanted.
Once that's imported, you have to go to Settings-> User defined variables.
Here you can change the Type from "static object" to something different.
Like, for example, "object".
This is basically all you need to do, to make an entity out of a solid object.

To sum it up:
Import the mesh -> change its type to "object" (or whatever you like) and save it in the entities folder.
Then you can use it as an entity in the level editor.
Hope that helps. Smile

Learned it myself a few hours ago and am happy since then.^^


RE: Activate/Deactivate Static Objects etc. - Armored Cow - 09-20-2010

Will I need to put the .ent file into my custom_stories folder when letting other people play the map?


RE: Activate/Deactivate Static Objects etc. - mansarde - 09-20-2010

(09-20-2010, 09:36 PM)Armored Cow Wrote: Will I need to put the .ent file into my custom_stories folder when letting other people play the map?

I haven't played around with custom stories yet, but I guess you will have to do exactly that. The only alternative is to let them extract your custom entities to their own entities folder.

EDIT:
Did you read this already? -> http://hpl2.frictionalgames.com/amnesia:custom_story
It's not explicitly indicated there, but from the folder structure they are talking about there I think you are supposed to create a similar folder structure in your custom story like in the "redist" folder.
I.e. I think you can just create a subfolder inside your custom story folder calles "entities" and put your custom entities in there (in subfolders themselves of course). Just try it out and see what works.^^


RE: Activate/Deactivate Static Objects etc. - Armored Cow - 09-20-2010

Ok, I guess that makes sense.

Thanks for the help Smile