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
Script Help Locking Doors ,Give Item ,and Lights
taylor23 Offline
Junior Member

Posts: 3
Threads: 0
Joined: Jan 2013
Reputation: 0
#11
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
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#12
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 ?

[Image: the-cabin-in-the-woods-masked-people.jpg]
01-23-2013, 11:09 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#13
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
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#14
RE: Locking Doors ,Give Item ,and Lights

mansion_1

[Image: the-cabin-in-the-woods-masked-people.jpg]
01-23-2013, 11:29 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#15
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
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#16
RE: Locking Doors ,Give Item ,and Lights

Have you test it by yourself ?

[Image: the-cabin-in-the-woods-masked-people.jpg]
01-23-2013, 12:01 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#17
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
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#18
RE: Locking Doors ,Give Item ,and Lights

Is there any other script ? Anyone ?

[Image: the-cabin-in-the-woods-masked-people.jpg]
01-23-2013, 12:31 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#19
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.
(This post was last modified: 01-23-2013, 01:10 PM by FlawlessHappiness.)
01-23-2013, 01:08 PM
Find
nivramm Offline
Junior Member

Posts: 18
Threads: 1
Joined: Jan 2013
Reputation: 0
#20
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
Find




Users browsing this thread: 2 Guest(s)