Frictional Games Forum (read-only)
Help please - 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: Help please (/thread-22634.html)



Help please - Sabrak - 08-29-2013

Hello everyone i need a little help here. I am creating a secret way with closet (when player press button, the shelf will "move away"). So i created one shelf with some things (books, golden statue and some other things) and one same but not active. Later i made script
Quote:void OnStart()
{
//////////Button//////////
SetEntityPlayerInteractCallback("Button", "Secret", true);
}

//////////Secret patch//////////
void Secret(string &in asEntity)
{
SetEntityActive("shelf_high01_1", false);
SetEntityActive("book_row03_4", false);
SetEntityActive("book_row03_5", false);
SetEntityActive("book_row03_6", false);
SetEntityActive("book_row03_3", false);
SetEntityActive("book_row03_2", false);
SetEntityActive("book_row03_1", false);
SetEntityActive("paperpile01_1", false);
SetEntityActive("paperpile01_2", false);
SetEntityActive("genie_bottle_1", false);
SetEntityActive("book_pile01_2", false);
SetEntityActive("book_row03_11", false);
SetEntityActive("book_row03_10", false);
SetEntityActive("arabic_statue_gold_1", false);
SetEntityActive("book_row03_7", false);
SetEntityActive("book_row03_8", false);
SetEntityActive("book_row03_9", false);
SetEntityActive("shelf_high01_2", true);
SetEntityActive("book_row03_19", true);
SetEntityActive("book_row03_23", true);
SetEntityActive("book_row03_24", true);
SetEntityActive("book_row03_20", true);
SetEntityActive("book_row03_21", true);
SetEntityActive("book_row03_22", true);
SetEntityActive("paperpile01_3", true);
SetEntityActive("paperpile01_4", true);
SetEntityActive("genie_bottle_2", true);
SetEntityActive("book_pile01_3", true);
SetEntityActive("book_row03_25", true);
SetEntityActive("book_row03_29", true);
SetEntityActive("arabic_statue_gold_2", true);
SetEntityActive("book_row03_26", true);
SetEntityActive("book_row03_27", true);
SetEntityActive("book_row03_28", true);
SetEntityActive("Billboard_76", false);
SetEntityActive("Billboard_74", false);
PlaySoundAtEntity("Mechanism1", "move_gate", "Button", 0, false);
AddTimer("", 5.0f, "Stop");
}

//////////Stop button sound//////////
void Stop(string &in asTimer)
{
StopSound("Mechanism1", 2.0f);
}

void OnEnter()
{

}

void OnLeave()
{

}
but only entity that changes is golden statue and "genie bottle Big Grin". Where i made mistake? (Sorry for my english xD)


RE: Help please - Adrianis - 08-29-2013

It looks like it's because all the other items, the ones that don't change, are Static objects & billboards - only Entities can be 'activated' or 'de-activated' using SetEntityActive


RE: Help please - Kreekakon - 08-29-2013

SetEntityActive does not affect entities which are "StaticProps".

If you want to change this open the entity of your choice in the model editor, and change its "User-Defined Variables" to "Object", and save a new file.


RE: Help please - Sabrak - 08-29-2013

and is there any other way how to activate or de-activate static objects or billboards with script?


RE: Help please - Kreekakon - 08-29-2013

(08-29-2013, 04:53 PM)Sabrak Wrote: and is there any other way how to activate or de-activate static objects or billboards with script?

Billboards you can attach to a light, and then turn the light off with script which in turn will render the billboards invisible as well.

As for static objects, you pretty much have to convert them into proper entities in the model editor.


RE: Help please - Sabrak - 08-29-2013

ok, thanks Big Grin i will now continue with my custom story Smile i was stuck at this 2 hours Big Grin