taylor23
Junior Member
Posts: 3
Threads: 0
Joined: Jan 2013
Reputation:
0
|
RE: Locking Doors ,Give Item ,and Lights
That is very helpful and nice ideas for opening the door.
But The more interest comes when we open by playing.
Shop Shutter
(This post was last modified: 01-28-2013, 05:44 AM by taylor23.)
|
|
01-23-2013, 07:58 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Locking Doors ,Give Item ,and Lights
(01-22-2013, 02:49 PM)BeeKayK Wrote: Weird it should work. Does anything happen to the door? Does the sound play?
Does it say "Cannot use item this way"?
The sound plays but it won't open the door.
NOTE : I check the "locked" thingy in the level editor. Does that change the script or something ?
|
|
01-23-2013, 11:09 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Locking Doors ,Give Item ,and Lights
No that makes no difference.
What is the name of the door?
Trying is the first step to success.
|
|
01-23-2013, 11:18 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Locking Doors ,Give Item ,and Lights
mansion_1
|
|
01-23-2013, 11:29 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Locking Doors ,Give Item ,and Lights
Then i have no idea... It should work
Trying is the first step to success.
|
|
01-23-2013, 11:33 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Locking Doors ,Give Item ,and Lights
Have you test it by yourself ?
|
|
01-23-2013, 12:01 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Locking Doors ,Give Item ,and Lights
Nope... Not right now... I could do that.
Trying is the first step to success.
|
|
01-23-2013, 12:25 PM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Locking Doors ,Give Item ,and Lights
Is there any other script ? Anyone ?
|
|
01-23-2013, 12:31 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Locking Doors ,Give Item ,and Lights
I think i know why it doesn't work...
Give me some minutes
*TESTING*
EDIT:
Ok it works to me with this function:
void UseKeyOnDoor01(string &in asItem, string &in asEntity)
{
if(GetSwingDoorLocked("mansion_1") == true)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "lock_door.snt", "mansion_1", 0, true);
return;
}
if(GetSwingDoorLocked("mansion_1") == false)
{
SetSwingDoorLocked("mansion_1", true, true);
PlaySoundAtEntity("", "lock_door.snt", "mansion_1", 0, true);
return;
}
}
Trying is the first step to success.
|
|
01-23-2013, 01:08 PM |
|
nivramm
Junior Member
Posts: 18
Threads: 1
Joined: Jan 2013
Reputation:
0
|
RE: Locking Doors ,Give Item ,and Lights
Maybe you could script a function for locking and one for unlocking…and add at the end of both functions
an AddUseItemCallback which calls the other function…so locking causes the unlockfunction to run if key is again used on the door and otherway round.
But then u need to delete the AddUseItemCallback after collision…for having not both active^^.
I guess there is a more proper way…but i would try it like this. Dont know if it even works, only an idea.
edit: didn't see BeeKayK's post…forget mine if the if-way works
(This post was last modified: 01-23-2013, 01:11 PM by nivramm.)
|
|
01-23-2013, 01:09 PM |
|
|