Frictional Games Forum (read-only)
Scripting fatal errors? - 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: Scripting fatal errors? (/thread-18772.html)

Pages: 1 2 3 4 5 6 7 8 9


RE: Scripting fatal errors? - Rapsis - 11-08-2012

It is a shelf. Lol.
Gee, I guess I'm not that original after all.


RE: Scripting fatal errors? - The chaser - 11-08-2012

(11-08-2012, 03:04 PM)Rapsis Wrote: It is a shelf. Lol.
Gee, I guess I'm not that original after all.
Well then, SetMoveObjectState should work.


RE: Scripting fatal errors? - Rapsis - 11-08-2012

It doesn't work. The shelf is supposed to move backwards because there are other shelves on the right and the left, here's the script:


void openbookshelf_1(string &in asEntity, int alState)
{
SetMoveObjectState("shelf_high01_7", 1.0f);
}


RE: Scripting fatal errors? - FlawlessHappiness - 11-08-2012

The shelf is made to move either left or right.


RE: Scripting fatal errors? - Kreekakon - 11-08-2012

In that case open up the shelf's .ent in the model editor, and go to user defined variables. Mess around with MoveAxis, and OpenAmount to achieve your desired effect.

Be careful not to save over the original .ent though!


RE: Scripting fatal errors? - The chaser - 11-08-2012

(11-08-2012, 03:58 PM)Rapsis Wrote: It doesn't work. The shelf is supposed to move backwards because there are other shelves on the right and the left, here's the script:


void openbookshelf_1(string &in asEntity, int alState)
{
SetMoveObjectState("shelf_high01_7", 1.0f);
}
Then you'll need to change the map OR using a different model . This one moves in the Z axis.
Put it in entities/gameplay/shelf_move.


RE: Scripting fatal errors? - Rapsis - 11-09-2012

In what folder should I put this entity, so people who download the mod would have it too?

The bookshelf doesn't move even when I rotate it or change it's position so there's nothing around it, here's the script:


void OnStart()
{
SetEntityConnectionStateChangeCallback("book_moveable_win", "openbookshelf_1");
}

...


void openbookshelf_1(string &in asEntity, int alState)
{
SetMoveObjectState("shelf_high01_7", 1.0f);
}


RE: Scripting fatal errors? - The chaser - 11-09-2012

The book_moveable isn't a lever, so this script is useless for it. It is an object slide, so you could make a script area near the book, and, when it collides with the area, stuck it and move the shelf.


RE: Scripting fatal errors? - Rapsis - 11-09-2012

Using a lever doesn't work either.


RE: Scripting fatal errors? - The chaser - 11-09-2012

(11-09-2012, 05:11 PM)Rapsis Wrote: Using a lever doesn't work either.
Are you completely sure? Watch out with names, they could be the cause.
Also, you must do this in order to get it working:

void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("shelf",1.0f);
}
}