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


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

(09-20-2010, 09:40 PM)Armored Cow Wrote: Ok, I guess that makes sense.

Thanks for the help Smile

No problem, just giving back to the community. Smile

Edit:
One thing I forgot: If you just make a mesh to an entity then it has no collision.
I.e. everything (including the player) will pass through it. So you have to make a collision box as well.
To see how that works, just open an existing entity.


RE: Activate/Deactivate Static Objects etc. - MulleDK19 - 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.

Active is broken for Point Lights. At least in my levels. I have to loop through my lights and do SetEntityActive("name", false); in OnStart to turn them off.


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

Alright, I came around to play with the lights and still the inactive checkbox in the editor doesn't seem to do anything for lights (at least for pointlights). So I can confirm what MulleDK19 says.
But it doesn't even work for me if I deactivate the Pointlight OnStart.
This...
Code:
void OnStart()
{
[...other code...]

SetEntityActive("PointLight_1", false);
}
...does not deactivate the Pointlight ingame.
Just for details:
The only thing I changed apart from its position is its radius (set to 9) and its color.

What DOES work though is the tip with the FadeLightTo() function.
Wwhen I use this...
Code:
FadeLightTo("PointLight_1", 0.0f, 0.0f, 0.0f, 0.0f, 9.0f, 0.1f);
... in OnStart(), then the Pointlight is effectively switched off at the beginning.
Turning it on again this way works as well:
Code:
FadeLightTo("PointLight_2", 0.604f, 0.516f, 0.155f, 1.0f, 9.0f, 0.1f);

So I guess I'll just have to use a workaround for now. Or I'm doing something wrong which I just can't see?
Because what MulleDK19 did, oddly doesn't seem to work for me. Huh


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

It's SetLightActive if you want to disabled them like an entity I think.


RE: Activate/Deactivate Static Objects etc. - Pandemoneus - 09-21-2010

(09-21-2010, 07:31 AM)jens Wrote: It's SetLightActive if you want to disabled them like an entity I think.

Could be worth a try, but it's not in the wiki in the list of the Script Functions.


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

SetLightVisible then... It's not easy trying to remember them all!


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

(09-21-2010, 07:31 AM)jens Wrote: It's SetLightActive if you want to disabled them like an entity I think.

(09-21-2010, 10:54 AM)jens Wrote: SetLightVisible then... It's not easy trying to remember them all!

Ah dammit, I should've looked for that in the list myself.
Sorry for asking an unnecessary question, but thanks for answering anyway!
The Mod Tools you've released are really easy to use and make complicated stuff easy to handle. Smile
---------------------------------

EDIT:
Ok, there's one question I have which is not really related to the thread in particular, but to angelscripting in general:
What exactly does the prefix "a" as in "as", "al", "ab", etc. mean?
Example:
Code:
void  PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
I guess the second letter represents the respective type, like bool for abLoop, or float for afFadeTime.

But what does the first letter ("a") stand for?
Does it just mean AngelScript?
So, for example, abLoop would mean: "This is an angelscript boolean named Loop"?


RE: Activate/Deactivate Static Objects etc. - Pandemoneus - 09-21-2010

You are probably right about your guess.
as = string
ab = boolean
af = float
and so on.


RE: Activate/Deactivate Static Objects etc. - gosseyn - 09-21-2010

yes, i think you got it right, i read it like that too, means angel+type.


RE: Activate/Deactivate Static Objects etc. - Equil - 09-25-2010

I actually wanted to know how to activate that red goo stuff like it does in the main game, but I can't seem to find any entities of it in the editor, only static objects, and even there I can't find all the models of it I remember seeing.. can someone verify this?