Frictional Games Forum (read-only)
Troubles with Lever and secret shelf door... - 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: Troubles with Lever and secret shelf door... (/thread-19393.html)



Troubles with Lever and secret shelf door... - 31tashi - 12-01-2012

I checked other posts and it just doesn't seem to click with me i guess.. This will be my first time making a custom story and scripting so i'm a noobie, forgive me if i dont understand something completely.
On to the problem:
I used the script from the wiki and set in all the necessaries. Whenever i pull or push my lever, nothing happens...
My Script:

void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("shelf",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}

I'm trying to make my shelf rotate at an angle from about 90 degrees to 0 degrees... But yeah if i could have some help it would be really appreciated. c:


RE: Troubles with Lever and secret shelf door... - 31tashi - 12-01-2012

(12-01-2012, 06:56 AM)31tashi Wrote: I checked other posts and it just doesn't seem to click with me i guess.. This will be my first time making a custom story and scripting so i'm a noobie, forgive me if i dont understand something completely.
On to the problem:
I used the script from the wiki and set in all the necessaries. Whenever i pull or push my lever, nothing happens...
My Script:

void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("shelf",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}

I'm trying to make my shelf rotate at an angle from about 90 degrees to 0 degrees... But yeah if i could have some help it would be really appreciated. c:
Can't anyone help? My lever is named lever and my shelf's name is shelf..


RE: Troubles with Lever and secret shelf door... - The chaser - 12-01-2012

If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.


RE: Troubles with Lever and secret shelf door... - 31tashi - 12-01-2012

(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3

(12-01-2012, 07:43 PM)31tashi Wrote:
(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3
Oh but is there a way to maybe add a monster on to my shelf func? Like to say when the lever is pulled not only does the shelf move but a monster is spawned too?... And how do you make the little blue thing that flashes onto your screen when you finished a quest in the regular amnesia? (Sorry if this is asking too much)


RE: Troubles with Lever and secret shelf door... - The chaser - 12-01-2012

(12-01-2012, 07:43 PM)31tashi Wrote:
(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3

(12-01-2012, 07:43 PM)31tashi Wrote:
(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3
Oh but is there a way to maybe add a monster on to my shelf func? Like to say when the lever is pulled not only does the shelf move but a monster is spawned too?... And how do you make the little blue thing that flashes onto your screen when you finished a quest in the regular amnesia? (Sorry if this is asking too much)
Of course, just put this in your shelf_func:

SetEntityActive("Monster", true);

For the blue thing, I think you do:

void GiveSanityBoost();
void GiveSanityBoostSmall();


Hope it helped Wink


RE: Troubles with Lever and secret shelf door... - 31tashi - 12-02-2012

(12-01-2012, 10:07 PM)The chaser Wrote:
(12-01-2012, 07:43 PM)31tashi Wrote:
(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3

(12-01-2012, 07:43 PM)31tashi Wrote:
(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3
Oh but is there a way to maybe add a monster on to my shelf func? Like to say when the lever is pulled not only does the shelf move but a monster is spawned too?... And how do you make the little blue thing that flashes onto your screen when you finished a quest in the regular amnesia? (Sorry if this is asking too much)
Of course, just put this in your shelf_func:

SetEntityActive("Monster", true);

For the blue thing, I think you do:

void GiveSanityBoost();
void GiveSanityBoostSmall();


Hope it helped Wink
How do you properly put in the GiveSanityBoost thing? I don't think i understand completely...


RE: Troubles with Lever and secret shelf door... - UnseenLegend ( NL ) - 12-02-2012

(12-02-2012, 06:32 PM)31tashi Wrote:
(12-01-2012, 10:07 PM)The chaser Wrote:
(12-01-2012, 07:43 PM)31tashi Wrote:
(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3

(12-01-2012, 07:43 PM)31tashi Wrote:
(12-01-2012, 07:37 PM)The chaser Wrote: If you have map_cache delete it. I don't see anything wrong in the script. Remain that the shelf needs an area to rotate from.
I fixed it... Some reason my script didn't save so that's the reason nothing would happen, Thank you though. :3
Oh but is there a way to maybe add a monster on to my shelf func? Like to say when the lever is pulled not only does the shelf move but a monster is spawned too?... And how do you make the little blue thing that flashes onto your screen when you finished a quest in the regular amnesia? (Sorry if this is asking too much)
Of course, just put this in your shelf_func:

SetEntityActive("Monster", true);

For the blue thing, I think you do:

void GiveSanityBoost();
void GiveSanityBoostSmall();


Hope it helped Wink
How do you properly put in the GiveSanityBoost thing? I don't think i understand completely...
it's very easy you could just place the ''GiveSanityBoostSmall();''
within the void.