Frictional Games Forum (read-only)
[SCRIPT] Appearing wall - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Appearing wall (/thread-29181.html)



Appearing wall - jewjitsu - 01-07-2015

I have been trying to figure this out all day yesterday and today until now and am at my wits end.

Code:
void OnEnter()
{
AddEntityCollideCallback("Player", "ClosePassage", "Dwallvis", true, 1);
SetEntityVisible("defaultmove_1", false);
}

Then later on in my code I have

Code:
void Dwallvis(string &in asParent, string &in asChild, int alState)
{
SetEntityVisible("defaultmove_1", true);
}

I made a scriptarea called ClosePassage. It is not working and I have no idea why it isn't, for the love of Cthulhu please someone help me.


RE: Appearing wall - DnALANGE - 01-07-2015

The awnser could be very easy here;
IF it is a STATIC OBJECT they can NOT be enabled\disabled.
it sorta CAN be done,
But i guess you are a beginner and i think you should work on the engine \ editor(s) a little first.
IF you want to know we can explane but you might not understand what we talk about.
About your WALL ; You can disable \ eneble 99% of the Entities, so please try adding an entitie in stead of a STATIC OBJECT.
Hope we helped here.
For more questions, be free to ask them, That's why we are here Wink
Good luck.


RE: Appearing wall - jewjitsu - 01-07-2015

First I want to say thank you so much for replying. I already made it an entity and had researched how to make walls move, I tried making the entity inactive, and being nothing else worked I last tried to make it invisible before posting here.

Code:
defaultmove_1

Is the mansionbase default wall, I imported it into the model editor and exported it as an entity. My code above still does not make "defaultmove_1" invisible. Can anyone help?


RE: Appearing wall - DnALANGE - 01-07-2015

You sure you created a body?
Without it the entitie wont work.
do not overwrite original files ever.
just save it as defaultmove_2 for example..
also be sure you have the wall in your story and if the names match in editor and script..
does your script work?
try with playgui, its the fastest and easyest way to test..
if you hear your .ogg then we go to the next step.
good luck.


RE: Appearing wall - Mudbill - 01-07-2015

Alright, just check your entity to make sure it has a body and that the type is set to Object > Static instead of StaticProp (which is default). StaticProp cannot be enabled/disabled.

Also, you can try using SetEntityActive instead of Visible. That's what I normally use. I think if you set it invisible, the collision box will still remain, whereas active will disable the entity completely.


RE: Appearing wall - jewjitsu - 01-08-2015

Thanks guys! It was the StaticProp that I didn't know about. It works now. <3