Frictional Games Forum (read-only)

Full Version: Troubles with Lever and secret shelf door...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:
(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..
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.
(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)
(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
(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...
(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.