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.

    • Creating New Amnesia Custom Story, Need help with scripting!

      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.
    • 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);

      }
      }
    • 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?
      please point out what you mean
    • 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?
      also, the key won't work for the metal door, could you help me?
    • 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
      I just removed one, but the key problem still isn't fixed...
    • 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
      I just removed one, but the key problem still isn't fixed...



      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
      I just removed one, but the key problem still isn't fixed...



      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.
      by any chance do you have a skype? it be faster and easier...