06-23-2012, 09:00 AM
Pages: 1 2
06-23-2012, 09:12 AM
Fun with scripting! Assuming you have a basic understanding of how to write scripts, it will need to look like this:
void OnStart()
{
AddUseItemCallback("", "NAMEOFKEY", "NAMEOFDOOR", "NAMEOFFUNCTION", true);
}
void NAMEOFFUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NAMEOFDOOR", false, true);
RemoveItem("NAMEOFKEY");
}
If you already have an OnStart function in your script, add the "AddUseItemCallback" to it.
NAMEOFKEY - Replace with the name of your key
NAMEOFDOOR - Replace with the name of your door
NAMEOFFUNCTION - Can be named anything you'd like
void OnStart()
{
AddUseItemCallback("", "NAMEOFKEY", "NAMEOFDOOR", "NAMEOFFUNCTION", true);
}
void NAMEOFFUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NAMEOFDOOR", false, true);
RemoveItem("NAMEOFKEY");
}
If you already have an OnStart function in your script, add the "AddUseItemCallback" to it.
NAMEOFKEY - Replace with the name of your key
NAMEOFDOOR - Replace with the name of your door
NAMEOFFUNCTION - Can be named anything you'd like
06-23-2012, 09:59 AM
It keeps saying Item cannot be used this way.
This is what I have:
void OnStart()
{
AddUseItemCallback("", "key1", "door1", "OpenS", true);
}
void OpenS(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
RemoveItem("key1");
}
See anything wrong?
Keyname: key1
Doorname: door1
This is what I have:
void OnStart()
{
AddUseItemCallback("", "key1", "door1", "OpenS", true);
}
void OpenS(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
RemoveItem("key1");
}
See anything wrong?
Keyname: key1
Doorname: door1
06-23-2012, 11:07 AM
(06-23-2012, 09:12 AM)andyrockin123 Wrote: [ -> ]Fun with scripting! Assuming you have a basic understanding of how to write scripts, it will need to look like this:Y U NO Play sound at entity?
void OnStart()
{
AddUseItemCallback("", "NAMEOFKEY", "NAMEOFDOOR", "NAMEOFFUNCTION", true);
}
void NAMEOFFUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NAMEOFDOOR", false, true);
RemoveItem("NAMEOFKEY");
}
If you already have an OnStart function in your script, add the "AddUseItemCallback" to it.
NAMEOFKEY - Replace with the name of your key
NAMEOFDOOR - Replace with the name of your door
NAMEOFFUNCTION - Can be named anything you'd like
Anyways Andy, I've had a goddamned problem ever since i couldn't get that closet open with a crowbar, I can't make a key unlock a door no matter every right thing i do
06-23-2012, 12:04 PM
(06-23-2012, 11:07 AM)CrazyArts Wrote: [ -> ]ME TO(06-23-2012, 09:12 AM)andyrockin123 Wrote: [ -> ]Fun with scripting! Assuming you have a basic understanding of how to write scripts, it will need to look like this:Y U NO Play sound at entity?
void OnStart()
{
AddUseItemCallback("", "NAMEOFKEY", "NAMEOFDOOR", "NAMEOFFUNCTION", true);
}
void NAMEOFFUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NAMEOFDOOR", false, true);
RemoveItem("NAMEOFKEY");
}
If you already have an OnStart function in your script, add the "AddUseItemCallback" to it.
NAMEOFKEY - Replace with the name of your key
NAMEOFDOOR - Replace with the name of your door
NAMEOFFUNCTION - Can be named anything you'd like
Anyways Andy, I've had a goddamned problem ever since i couldn't get that closet open with a crowbar, I can't make a key unlock a door no matter every right thing i do
06-23-2012, 12:28 PM
Have you checked the file name of the HPS file to see if it matches the file name of the MAP file?
06-23-2012, 12:31 PM
(06-23-2012, 12:28 PM)Your Computer Wrote: [ -> ]Have you checked the file name of the HPS file to see if it matches the file name of the MAP file?Ofcourse i have, i have checked everything.
Heck, desperately i've even copied the script from another custom story to see if it works, still no.
06-23-2012, 12:35 PM
Did you make an hps file by renaming a text file .hps? I'm pretty sure that doesn't work; you need an hps file template to work with.
06-23-2012, 12:46 PM
(06-23-2012, 12:35 PM)andyrockin123 Wrote: [ -> ]Did you make an hps file by renaming a text file .hps? I'm pretty sure that doesn't work; you need an hps file template to work with.How do I get a hps file template?
06-23-2012, 12:49 PM
(06-23-2012, 12:35 PM)andyrockin123 Wrote: [ -> ]Did you make an hps file by renaming a text file .hps? I'm pretty sure that doesn't work; you need an hps file template to work with.I've got that alredy! It's the same problem with the closet, Cannot use item this way. Dammit this is slowing down my development every day
Pages: 1 2