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 (Key to door)
QysteiN Offline
Junior Member

Posts: 45
Threads: 6
Joined: Nov 2011
Reputation: 0
#1
Script help (Key to door)

Yo yo. Im kinda stuck with something again.
I made the door and the key. But how do i make the key fit with the door? :<

I make YouTube videos and I'm currently working on a Amnesia custom story.

(This post was last modified: 01-30-2012, 08:49 PM by QysteiN.)
01-30-2012, 10:27 AM
Website Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Script help (Key to door)

http://www.frictionalgames.com/forum/thr...light=Keys

The search field is your friend.
01-30-2012, 10:43 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: Script help (Key to door)

void OnStart()
{
AddUseItemCallback("", "nameofkey", "nameofdoor", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("nameofdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("nameofkey");
}

(This post was last modified: 01-30-2012, 10:47 AM by flamez3.)
01-30-2012, 10:47 AM
Find
QysteiN Offline
Junior Member

Posts: 45
Threads: 6
Joined: Nov 2011
Reputation: 0
#4
RE: Script help (Key to door)

I created a script:
Anyone can spot whats wrong?

I get error whenever i try to load my custom story:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback(''awesomekey_1'', ''castle_1'', ''UsedKeyOnDoor'', True);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(''castle_1''' , false, true);
PlaySoundAtEntity('' '', ''unlock_door'' , ''castle_1'' , 0, false);
RemoveItem(''awesomekey_1'');
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

I make YouTube videos and I'm currently working on a Amnesia custom story.

01-30-2012, 11:11 AM
Website Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#5
RE: Script help (Key to door)

(01-30-2012, 11:11 AM)QysteiN Wrote: I created a script:
Anyone can spot whats wrong?

I get error whenever i try to load my custom story:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback(''awesomekey_1'', ''castle_1'', ''UsedKeyOnDoor'', True);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(''castle_1''' , false, true);
PlaySoundAtEntity('' '', ''unlock_door'' , ''castle_1'' , 0, false);
RemoveItem(''awesomekey_1'');
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
Dude what on earth are you doing, if you need help make your own thread......


01-30-2012, 11:14 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: Script help (Key to door)

You are using 2 ' to make the quotation. Hold shift and press the button left of the Enter to make ".
(01-30-2012, 11:14 AM)Saren Wrote:
(01-30-2012, 11:11 AM)QysteiN Wrote: I created a script:
Anyone can spot whats wrong?

I get error whenever i try to load my custom story:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback(''awesomekey_1'', ''castle_1'', ''UsedKeyOnDoor'', True);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(''castle_1''' , false, true);
PlaySoundAtEntity('' '', ''unlock_door'' , ''castle_1'' , 0, false);
RemoveItem(''awesomekey_1'');
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
Dude what on earth are you doing, if you need help make your own thread......
This is his/her thread.


(This post was last modified: 01-30-2012, 11:16 AM by flamez3.)
01-30-2012, 11:15 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#7
RE: Script help (Key to door)

Omg sry, I went into the wrong 1... xD
01-30-2012, 11:18 AM
Find
QysteiN Offline
Junior Member

Posts: 45
Threads: 6
Joined: Nov 2011
Reputation: 0
#8
RE: Script help (Key to door)

thanks flamez once again lol =D

I make YouTube videos and I'm currently working on a Amnesia custom story.

01-30-2012, 12:07 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#9
RE: Script help (Key to door)

(01-30-2012, 12:07 PM)QysteiN Wrote: thanks flamez once again lol =D
: )

01-30-2012, 12:08 PM
Find




Users browsing this thread: 4 Guest(s)