Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to lock/unlock a chest
ingedoom Offline
Member

Posts: 120
Threads: 12
Joined: Feb 2012
Reputation: 0
#1
How to lock/unlock a chest

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);
}

[Image: 23778.png]
(This post was last modified: 02-27-2012, 01:23 PM by ingedoom.)
02-16-2012, 09:37 AM
Website Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#2
RE: Why wont this callback work? (spot a bug)

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

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
02-16-2012, 09:41 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Why wont this callback work? (spot a bug)

SetPropObjectStuckState is more for buttons. I'd expect a chest to be a swing door and not anything that has stuck states.

Tutorials: From Noob to Pro
02-16-2012, 09:47 AM
Website Find
ingedoom Offline
Member

Posts: 120
Threads: 12
Joined: Feb 2012
Reputation: 0
#4
RE: Why wont this callback work? (spot a bug)

(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".???

[Image: 23778.png]
02-16-2012, 10:33 AM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Why wont this callback work? (spot a bug)

(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.

Tutorials: From Noob to Pro
02-16-2012, 11:11 AM
Website Find
ingedoom Offline
Member

Posts: 120
Threads: 12
Joined: Feb 2012
Reputation: 0
#6
RE: Why wont this callback work? (spot a bug)

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?

[Image: 23778.png]
02-16-2012, 11:46 AM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#7
RE: Why wont this callback work? (spot a bug)

(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, 12:13 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Why wont this callback work? (spot a bug)

(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.

Tutorials: From Noob to Pro
02-16-2012, 08:12 PM
Website Find




Users browsing this thread: 1 Guest(s)