Frictional Games Forum (read-only)

Full Version: How to lock/unlock a chest
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When i pick up my note i want the chest to unstuck, the map does not crash when i load it and all my other scripting works fine. It's just this thing i can't make happen ;(.


Any suggestions? Am i making the setpropstuckstate wrong perhaps?


Here is my callback


void OnStart()
{
SetEntityCallbackFunc("bloodynote", "interactnote1");

}




Here is my function:


void interactnote1(string &in asEntity, string &in type)
{
SetPropObjectStuckState("lanternchest", 0);
}
void interactnote1(string &in asEntity, string &in OnPickup)
{
SetPropObjectStuckState("lanternchest", 0);
}
Try that, i've been away a while, so ima bit rusty. but give it a shot
SetPropObjectStuckState is more for buttons. I'd expect a chest to be a swing door and not anything that has stuck states.
(02-16-2012, 09:47 AM)Your Computer Wrote: [ -> ]SetPropObjectStuckState is more for buttons. I'd expect a chest to be a swing door and not anything that has stuck states.
Yeah i would expect that too, but if you look in lvleditor then the chest has no toggle for "locked" but instead you can set stuckstate none max or min. Perhaps i should try make my callback unlock the door in the map just to make sure it works....

Which script do you suggest i use to make the chest "openable".???
(02-16-2012, 10:33 AM)pingo2 Wrote: [ -> ]Yeah i would expect that too, but if you look in lvleditor then the chest has no toggle for "locked" but instead you can set stuckstate none max or min. Perhaps i should try make my callback unlock the door in the map just to make sure it works....

Which script do you suggest i use to make the chest "openable".???

It's probably a lever then. Try SetLeverStuckState instead.
Thx guys i finally made it work! Here is the final script:

//--------------------------------------------------
void OnStart()
{
SetEntityCallbackFunc("bloodynote", "interactnote1");

}


void interactnote1(string &in asEntity, string &in OnPickUp)
{
SetLeverStuckState("lanternchest", 0, false);
}
//------------------------------------------------

Btw i set the bool effect false, didint know what it was for. But if i set it to true then what do you guess would happen?
(02-16-2012, 11:46 AM)pingo2 Wrote: [ -> ]Thx guys i finally made it work! Here is the final script:

//--------------------------------------------------
void OnStart()
{
SetEntityCallbackFunc("bloodynote", "interactnote1");

}


void interactnote1(string &in asEntity, string &in OnPickUp)
{
SetLeverStuckState("lanternchest", 0, false);
}
//------------------------------------------------

Btw i set the bool effect false, didint know what it was for. But if i set it to true then what do you guess would happen?
Nothing special I think Smile

(02-16-2012, 11:46 AM)pingo2 Wrote: [ -> ]Btw i set the bool effect false, didint know what it was for. But if i set it to true then what do you guess would happen?

Normally it plays a sound and (or) animation.