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
Activate/Deactivate Static Objects etc.
mansarde Offline
Junior Member

Posts: 42
Threads: 3
Joined: Sep 2010
Reputation: 0
#1
Question  Activate/Deactivate Static Objects etc.

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:
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. :\
09-19-2010, 10:58 PM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#2
RE: Activate/Deactivate Static Objects etc.

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.
09-20-2010, 07:48 AM
Website Find
mansarde Offline
Junior Member

Posts: 42
Threads: 3
Joined: Sep 2010
Reputation: 0
#3
RE: Activate/Deactivate Static Objects etc.

(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
09-20-2010, 04:34 PM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#4
RE: Activate/Deactivate Static Objects etc.

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.
09-20-2010, 04:54 PM
Website Find
mansarde Offline
Junior Member

Posts: 42
Threads: 3
Joined: Sep 2010
Reputation: 0
#5
RE: Activate/Deactivate Static Objects etc.

(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
09-20-2010, 05:00 PM
Find
Armored Cow Offline
Member

Posts: 72
Threads: 3
Joined: Sep 2010
Reputation: 0
#6
RE: Activate/Deactivate Static Objects etc.

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?
09-20-2010, 09:07 PM
Find
mansarde Offline
Junior Member

Posts: 42
Threads: 3
Joined: Sep 2010
Reputation: 0
#7
RE: Activate/Deactivate Static Objects etc.

(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.^^
09-20-2010, 09:32 PM
Find
Armored Cow Offline
Member

Posts: 72
Threads: 3
Joined: Sep 2010
Reputation: 0
#8
RE: Activate/Deactivate Static Objects etc.

Will I need to put the .ent file into my custom_stories folder when letting other people play the map?
09-20-2010, 09:36 PM
Find
mansarde Offline
Junior Member

Posts: 42
Threads: 3
Joined: Sep 2010
Reputation: 0
#9
RE: Activate/Deactivate Static Objects etc.

(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.^^
09-20-2010, 09:37 PM
Find
Armored Cow Offline
Member

Posts: 72
Threads: 3
Joined: Sep 2010
Reputation: 0
#10
RE: Activate/Deactivate Static Objects etc.

Ok, I guess that makes sense.

Thanks for the help Smile
09-20-2010, 09:40 PM
Find




Users browsing this thread: 1 Guest(s)