Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help PLEASE HELP KEY DOESNT WORK
Author Message
Hartmann Offline
Member

Posts: 52
Joined: Jun 2012
Reputation: 0
Post: #1
PLEASE HELP KEY DOESNT WORK
Hey i have some problems with my custom story. the key wont open the door, this is my script


////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
}


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

}
(This post was last modified: 06-17-2012 08:37 PM by Hartmann.)
06-17-2012 08:37 PM
Find all posts by this user Quote this message in a reply
GrAVit Offline
Senior Member

Posts: 321
Joined: Oct 2011
Reputation: 4
Post: #2
RE: PLEASE HELP KEY DOESNT WORK
(06-17-2012 08:37 PM)Hartmann Wrote:  Hey i have some problems with my custom story. the key wont open the door, this is my script


////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
}


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

}
Do you mean open or unlock? Did you name the entities the same as in the script?

06-17-2012 08:51 PM
Find all posts by this user Quote this message in a reply
Hartmann Offline
Member

Posts: 52
Joined: Jun 2012
Reputation: 0
Post: #3
RE: PLEASE HELP KEY DOESNT WORK
(06-17-2012 08:51 PM)GrAVit Wrote:  
(06-17-2012 08:37 PM)Hartmann Wrote:  Hey i have some problems with my custom story. the key wont open the door, this is my script


////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
}


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

}
Do you mean open or unlock? Did you name the entities the same as in the script?
06-18-2012 06:35 AM
Find all posts by this user Quote this message in a reply
Dutton Offline
Member

Posts: 121
Joined: Apr 2012
Reputation: 2
Post: #4
RE: PLEASE HELP KEY DOESNT WORK
(06-17-2012 08:37 PM)Hartmann Wrote:  Hey i have some problems with my custom story. the key wont open the door, this is my script





////////////////////////////

// Run first time starting map



void OnStart()

{

AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);

}



void KeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);

}





////////////////////////////

// Run when leaving map

void OnLeave()

{



}
On your KeyOnDoor func you used


SetSwingDoorLocked("mansion_1", false, true);

true = locks the door

which means when you use the key on the door. the door will be locked



EDIT:

Sorry i didn't realise i was talking about the bool abEffects statement...

[Image: Youtube-Buttons-34-48-.png]
(This post was last modified: 06-18-2012 07:13 AM by Dutton.)
06-18-2012 07:10 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)