How to lock/unlock a chest - 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: How to lock/unlock a chest (/thread-13366.html) |
How to lock/unlock a chest - ingedoom - 02-16-2012 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); } RE: Why wont this callback work? (spot a bug) - Tripication - 02-16-2012 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
RE: Why wont this callback work? (spot a bug) - Your Computer - 02-16-2012 SetPropObjectStuckState is more for buttons. I'd expect a chest to be a swing door and not anything that has stuck states. RE: Why wont this callback work? (spot a bug) - ingedoom - 02-16-2012 (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".??? RE: Why wont this callback work? (spot a bug) - Your Computer - 02-16-2012 (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.... It's probably a lever then. Try SetLeverStuckState instead. RE: Why wont this callback work? (spot a bug) - ingedoom - 02-16-2012 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? RE: Why wont this callback work? (spot a bug) - SilentStriker - 02-16-2012 (02-16-2012, 11:46 AM)pingo2 Wrote: Thx guys i finally made it work! Here is the final script:Nothing special I think RE: Why wont this callback work? (spot a bug) - Your Computer - 02-16-2012 (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. |