I am currently in the process of making a new Amnesia Custom Story, Darkness Hollows. It takes place in an underground tunnel system. The first chapter you are in the tunnels trying to make your way up to the surface. I have a story written up but I'm to lazy to type it at the moment. If any bros are happy to help me script it, please let me know, I know how to script but for some reason, it just isn't working. Please I need help and I really want this to get done. I haven't finished the entire level yet though.
Creating New Amnesia Custom Story, Need help with scripting!
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
The forums have been archived. Please read this thread for more information.
-
-
-
PhaZe wrote:
Post the malfunctioning script here and we can try and fix it for you.
or just contact our scripting wizard flamez3. ;D
-
Kneesocks wrote:
PhaZe wrote:
Post the malfunctioning script here and we can try and fix it for you.
or just contact our scripting wizard flamez3. ;D
Or give us little people a chance to be helpful D; -
PhaZe wrote:
Kneesocks wrote:
PhaZe wrote:
Post the malfunctioning script here and we can try and fix it for you.
or just contact our scripting wizard flamez3. ;D
Or give us little people a chance to be helpful D; -
PhaZe wrote:
Kneesocks wrote:
PhaZe wrote:
Post the malfunctioning script here and we can try and fix it for you.
or just contact our scripting wizard flamez3. ;D
Or give us little people a chance to be helpful D;
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "metaldoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("cellar_wood01_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void SetSwingDoorLocked("metaldoor_1", false, true);
{PlaySoundAtEntity("", "doorlock_ed", "metaldoor_1", 0.0f, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metaldoor_1", false, true);
PlaySoundAtEntity("", "doorunlock_ed", "metaldoor_1", 0.0f, false);
RemoveItem("key_tomb_rusty_1");
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("metaldoor_1") == true)
SetMessage("Messages", "FirmlyLocked", 0);
}
} -
Don't forget to add stephano, Mr.Chair, Piggeh, and the BroBro's Forever :thumbsup:
-
Ethanpheng24 wrote:
Don't forget to add stephano, Mr.Chair, Piggeh, and the Bro -
Naasej wrote:
PhaZe wrote:
Kneesocks wrote:
PhaZe wrote:
Post the malfunctioning script here and we can try and fix it for you.
or just contact our scripting wizard flamez3. ;D
Or give us little people a chance to be helpful D;
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "metaldoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("cellar_wood01_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void SetSwingDoorLocked("metaldoor_1", false, true);
{PlaySoundAtEntity("", "doorlock_ed", "metaldoor_1", 0.0f, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metaldoor_1", false, true);
PlaySoundAtEntity("", "doorunlock_ed", "metaldoor_1", 0.0f, false);
RemoveItem("key_tomb_rusty_1");
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("metaldoor_1") == true)
SetMessage("Messages", "FirmlyLocked", 0);
}
}
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "metaldoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("cellar_wood01_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metaldoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metaldoor_1", 0.0f, false);
RemoveItem("key_tomb_rusty_1");
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("metaldoor_1") == true)
SetMessage("Messages", "FirmlyLocked", 0);
}
//It should work now. But why do you have two triggers for one function? Is it incase the player decides to choose a different path than you intended for him/her? -
PhaZe wrote:
Naasej wrote:
PhaZe wrote:
Kneesocks wrote:
PhaZe wrote:
Post the malfunctioning script here and we can try and fix it for you.
or just contact our scripting wizard flamez3. ;D
Or give us little people a chance to be helpful D;
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "metaldoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("cellar_wood01_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void SetSwingDoorLocked("metaldoor_1", false, true);
{PlaySoundAtEntity("", "doorlock_ed", "metaldoor_1", 0.0f, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metaldoor_1", false, true);
PlaySoundAtEntity("", "doorunlock_ed", "metaldoor_1", 0.0f, false);
RemoveItem("key_tomb_rusty_1");
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("metaldoor_1") == true)
SetMessage("Messages", "FirmlyLocked", 0);
}
}
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "metaldoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("cellar_wood01_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metaldoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metaldoor_1", 0.0f, false);
RemoveItem("key_tomb_rusty_1");
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("metaldoor_1") == true)
SetMessage("Messages", "FirmlyLocked", 0);
}
//It should work now. But why do you have two triggers for one function? Is it incase the player decides to choose a different path than you intended for him/her? -
Naasej wrote:
Ethanpheng24 wrote:
Don't forget to add stephano, Mr.Chair, Piggeh, and the Bro
Hahaha good luck on making a legit map broBro's Forever :thumbsup: -
Well, you have:
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
and
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
Both of these trigger the same function. I dunno if that might be a problem. If it still doesnt work, try removing one of these from the .hps -
PhaZe wrote:
Naasej wrote:
PhaZe wrote:
Kneesocks wrote:
PhaZe wrote:
Post the malfunctioning script here and we can try and fix it for you.
or just contact our scripting wizard flamez3. ;D
Or give us little people a chance to be helpful D;
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "metaldoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("cellar_wood01_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void SetSwingDoorLocked("metaldoor_1", false, true);
{PlaySoundAtEntity("", "doorlock_ed", "metaldoor_1", 0.0f, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metaldoor_1", false, true);
PlaySoundAtEntity("", "doorunlock_ed", "metaldoor_1", 0.0f, false);
RemoveItem("key_tomb_rusty_1");
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("metaldoor_1") == true)
SetMessage("Messages", "FirmlyLocked", 0);
}
}
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "metaldoor_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("cellar_wood01_1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metaldoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metaldoor_1", 0.0f, false);
RemoveItem("key_tomb_rusty_1");
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("metaldoor_1") == true)
SetMessage("Messages", "FirmlyLocked", 0);
}
//It should work now. But why do you have two triggers for one function? Is it incase the player decides to choose a different path than you intended for him/her? -
Heres the script I know works for unlocking doors:
--start--
void OnStart()
{
AddUseItemCallback("", "key1", "lockeddoor1", "UseKey", true);
}
void UseKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockeddoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "lockeddoor1", 0, false);
RemoveItem("key1");
}
--end--
Now also you have to make sure that the entity's internal names match the ones in the code. So you name the key "key1" and the door "lockeddoor1", or whatever you wanna name them. -
PhaZe wrote:
Well, you have:
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
and
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
Both of these trigger the same function. I dunno if that might be a problem. If it still doesnt work, try removing one of these from the .hps -
Naasej wrote:
PhaZe wrote:
Well, you have:
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
and
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
Both of these trigger the same function. I dunno if that might be a problem. If it still doesnt work, try removing one of these from the .hps
Name = Internal name = The name of the entity. If you copy this script, and put it in your .hps, and your key is named "dolphin", you replace "key1" with "dolphin" in the script. The entityname in the script has to match the one of the entitys internal name. -
PhaZe wrote:
Naasej wrote:
PhaZe wrote:
Well, you have:
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
and
SetEntityPlayerInteractCallback("cellar_wood01_1", "func_slam", true);
Both of these trigger the same function. I dunno if that might be a problem. If it still doesnt work, try removing one of these from the .hps
Name = Internal name = The name of the entity. If you copy this script, and put it in your .hps, and your key is named "dolphin", you replace "key1" with "dolphin" in the script. The entityname in the script has to match the one of the entitys internal name. -
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0