Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 4 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[cancelled] test map (free script to learn)
iNs Offline
Junior Member

Posts: 21
Threads: 4
Joined: Mar 2011
Reputation: 0
#1
[cancelled] test map (free script to learn)

A small unfinished map.
Maybe someone can find some usefull things.
I did some nice scripting, you could be interested in.

- time spent working on it: ~ 60 hours
- I dont have time to finish it. So here you go - it is free for download.

[Map]
- It is only a half map atm (5 Rooms, 4 Hallways, 1 Hall with Stairs)
- 1 bedroom, 1 guestroom, 1 living room, 1 secret room, 1 dinner room
- 1 hatch locked with a padlock
- 1 big hall with stairs and big windows
- I tried to make scary atmosphere in every room
- location: mansion
- current play time is about 20 to 25 minutes

[Scripting]
- Script Areas for preventing light to shine trough walls
- Script Areas for scare events
- interact functions to scare player
- key to unlock door / chest
- acid to damage a padlock
- notification messages that door is locked and/or key is needed
- mementos (quest) and notification (letter)
- 1 puzzle to solve (access to secret room)
- 1 scare event, where player is automatically walking and interacting

[Story]
- there is no name for the map yet
- there is no complete story yet
- german and english language file included

---
Download: Test Map v0.3b - RAR archive

complete Script-file:
PHP Code: (Select All)
//-----------------------------------------------------------------------------
//--- created by iNs - Copyright © 2011 --- Test.hps v0.3b (beta) ---
//-----------------------------------------------------------------------------
//--- Last Update: 11. April 2011 ---
//-----------------------------------

void OnEnter()
{
  
//--- PRELOADING ---//
  
PreloadSound("react_breath1.ogg");        // wake up (Intro)
  
PreloadSound("react_breath2.ogg");        // wake up (Intro)
  
PreloadSound("react_breath4.ogg");        // open cabinet: broom
  
PreloadSound("insanity_whisper01.ogg");    // open cabinet: broom
  
PreloadSound("unlock_door");                // unlock door / chest
  
PreloadSound("lock_door");                // secret book succes
  
PreloadSound("gameplay_tick");            // secret books wrong
  
PreloadSound("02_puzzle.ogg");            // room 2 painting

  // callback function for all keys (Name, KeyName, ObjectName, FunctionName, Destroy_Item?)
  
AddUseItemCallback("UseExit""Room1_KeyChest""Room1_Chest""UseKey_Chest"true);
  
AddUseItemCallback("UseExit""Room2_KeyStorage""StorageRoom_Door""UseKey"true);

  
// Use Item Callback - Cellar Padlock / acid
  
AddUseItemCallback("UseAcid""ChemicalContainer""Cellar_Padlock""UseAcid"true);

  
// ROOM 2 SECRET BOOKS for SECRET STORAGE ROOM
  
SetLocalVarInt("VarSecretMoves"0);
  
SetLocalVarString("VarSecretCode""");

  for(
int i=1;i<=4;i++)
  {
    
AddEntityCollideCallback("SecretBook_"+i"AreaSecretBook_"+i"CollideSecretBook"false0);
  }

  
//--- STATUS of LIGHTS ---//
  
AddEntityCollideCallback("Player""Room1_CandleSmall_ON""CandleSmall_On"false1);
  
AddEntityCollideCallback("Player""Room1_CandleSmall_OFF""CandleSmall_Off"false1);
  
AddEntityCollideCallback("Player""Room1_CandleBig_ON""CandleBig_On"false1);
  
AddEntityCollideCallback("Player""Room1_CandleBig_OFF""CandleBig_Off"false1);
  
AddEntityCollideCallback("Player""Room3_Candles_ON""Room3Candles_On"false1);
  
AddEntityCollideCallback("Player""Room3_Candles_OFF""Room3Candles_Off"false1);
  
AddEntityCollideCallback("Player""StairHall_Candles_ON""StairHallCandles_On"false1);
  
AddEntityCollideCallback("Player""StairHall_Candles_OFF1""StairHallCandles_Off"false1);
  
AddEntityCollideCallback("Player""StairHall_Candles_OFF2""StairHallCandles_Off"false1);

  
// ROOM 2 - PAINTING - (delete callback after collide)
  
AddEntityCollideCallback("Room2_Painting""AreaPainting""PuzzleSound"true1);

  
// STORAGE ROOM - STATUE - (delete callback after collide)
  
AddEntityCollideCallback("StorageRoom_Door""AreaStatue""SmashStatue"true1);

  
// ROOM 3 - ON ENTER - (delete callback after collide)
  
AddEntityCollideCallback("Player""Room3_AreaDoor""BeginVision"true1);

  
// ROOM 4 - Area next to table - (delete callback after collide)
  
AddEntityCollideCallback("Player""Room4_AreaTable""BreakTables"true1);

  
// HALLWAY - enable grunts - (delete callback after collide)
  
AddEntityCollideCallback("Player""HallM_AreaGrunt""EnableHallGrunts"true1);

  
//--- ROOM 3 - MOVE  ---//
  
AddEntityCollideCallback("Player""MoveL_1""MoveLeft_1"false1);
  
AddEntityCollideCallback("Player""MoveL_2""MoveLeft_2"false1);
  
AddEntityCollideCallback("Player""MoveL_3""MoveLeft_3"false1);
  
AddEntityCollideCallback("Player""MoveR_1""MoveRight_1"false1);
  
AddEntityCollideCallback("Player""MoveR_2""MoveRight_2"false1);
  
AddEntityCollideCallback("Player""MoveR_3""MoveRight_3"false1);
  
AddEntityCollideCallback("Player""Stop_1""StopMove_1"false1);
  
AddEntityCollideCallback("Player""Stop_2""StopMove_2"false1);
  
AddEntityCollideCallback("Player""Stop_3""StopMove_3"false1);

  
//--- EXIT AREA - PLAY CREDITS  ---//
  
AddEntityCollideCallback("Player""ExitArea""Credits"false1);

  
//--- CHECKPOINT ---//
  
CheckPoint ("Room1_Checkpoint""PlayerStartArea_2""PlayerDied""DeathMessage""Dead");

  
// dead human body - push down
  
AddPropImpulse("Room3_Body"0300"World");
}

//-----------------------------------------------------------------------------

void OnStart()
{
  
// no lantern oil and no tinderboxes at start!
  
SetPlayerLampOil(0.0f);

  
// Lock the Chest in Room1
  
SetLeverStuckState("Room1_Chest", -1false);

  
//--- DEBUG --- //
  
if(ScriptDebugOn())
  {
    
// Lantern
    
GiveItemFromFile("lantern""lantern.ent");
    
SetPlayerLampOil(100.0f);

    
// Tinderbox - 10x
    
for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i"tinderbox.ent");
  }
  else
  {
    
// play Intro
    
Intro();
  }
}

//-----------------------------------------------------------------------------
//--- INTRO ---
//-----------------------------------------------------------------------------

void Intro()
{
  
// Debug Message
  
AddDebugMessage("Begin Intro"false);

  
// disbale player movement
  
SetPlayerActive(false);

  
// black screen
  
FadeOut(0.0f);

  
// look at cabinet's left lower corner
  
StartPlayerLookAt("Room1_LookAt_1"13"");

  
AddTimer("1",  5"IntroTimer"); //  5 seconds
}

//---

void IntroTimer(string &in asTimer)
{
  if(
asTimer == "1")
  {
    
// close door
    
SetSwingDoorClosed("Room1_Door"truetrue);

    
AddTimer("2"1"IntroTimer"); //  1 second
  
}
  else if(
asTimer == "2")
  {
    
// set player crouching
    
SetPlayerCrouching(true);
    
SetPlayerActive(false);

    
// play 'breathing sound' as 'wake up noise'
    
PlayGuiSound("react_breath1.ogg"0.5f);

    
// blur
    
FadeRadialBlurTo(0.102);
    
FadeRadialBlurTo(0.102);

    
// normal screen
    
FadeIn(13.0f);
    
FadeImageTrailTo(12);

    
// let player look next to door
    
StartPlayerLookAt("Room1_LookAt_2"23"");

    
AddTimer("3"2"IntroTimer"); //  2 seconds
  
}
  else if(
asTimer == "3")
  {
    
StopPlayerLookAt();

    
// black screen
    
FadeOut(2.5f);

    
// Change all settings to default
    
FadeRadialBlurTo(05);
    
FadeImageTrailTo(05);
    
FadePlayerRollTo(03333);

    
// normal screen
    
FadeIn(2.7f);

    
SetMessage("Message""Hint0"0);
    
AddDebugMessage("End Intro"false);

    
AddTimer("4"1"IntroTimer"); //  1 second
  
}
  else if(
asTimer == "4")
  {
    
// play 'breathing sound' as 'wake up noise'
    
PlayGuiSound("react_breath2.ogg"0.5f);

    
SetPlayerActive(true);
    
SetPlayerCrouching(false);

    
// ambient music 'scary'
    
PlayMusic("18_amb"false0.850true);

    
AddTimer("5"30"IntroTimer"); // 30 seconds
  
}
  else if(
asTimer == "5")
  {
    
// ambient music 'normal'
    
PlayMusic("10_amb"true0.550true);
  }
}

//-----------------------------------------------------------------------------
//--- INTERACT FUNCTION ---
//-----------------------------------------------------------------------------

void Interact(string &in asEntity)
{
  
// Is entity locked door?
  
if (GetSwingDoorLocked(asEntity))
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    if (
asEntity == "StorageRoom_Door")
    {
      if (
HasItem("Room2_KeyStorage"))
      {
        
SetMessage("Messages""StorageDoorKey_Message"4);
      }
      else if (
GetSwingDoorLocked("StorageRoom_Door"))
      {
        
SetMessage("Messages""StorageDoorNoKey_Message"4);
      }
    }
    else
    {
      
SetMessage("Messages""DoorLocked_Message"3);
    }
  }

  
//---

  
else if (asEntity == "Room1_Door")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    if (!
HasItem("Room1_Lantern"))
    {
      
SetMessage("Messages""Room1_Door_Message"4);
    }
  }

  
//---

  
else if (asEntity == "Room1_Chest")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    if (
GetLeverState(asEntity) == -1)
    {
      
AddDebugMessage("Room1_Chest is locked!"false);

      if (!
QuestIsAdded("Room1_Chest"))
      {
        
// quest name, language file name
        
AddQuest("Room1_Chest","Room1_Chest");
        
SetMessage("Messages""Room1_Chest_Message"3);
      }
      else if (!
QuestIsCompleted("Room1_Chest"))
      {
        
SetMessage("Messages""Room1_Chest_Message"3);
      }
      else if (
HasItem("Room1_KeyChest"))
      {
        
SetMessage("Messages""Room1_Key_Message"3);
      }
    }
  }

  
//---

  
else if (asEntity == "Room1_KeyChest")
  {
    
GiveSanityBoostSmall();
    
CompleteQuest("Room1_Chest""Room1_Chest");
  }

  
//---

  
else if (asEntity == "Room1_Cabinet")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// disable player movement
    
SetPlayerActive(false);

    
// disable lantern
    
SetLanternActive(falsefalse);

    
// push the player a little bit backwards
    
AddPlayerBodyForce(-7500.0f0.0f0.0ffalse);

    
// open the cabinet door a little bit, so that the broom becomes visible
    
AddPropImpulse("Room1_Cabinet"0030"World");

    
// Sanity Damage
    
GiveSanityDamage(20.0ftrue);

    
// play 'breathing sound' as 'shocking noise'
    
PlayGuiSound("react_breath4.ogg"0.9f);

    
// play 'whisper' as 'shocking noise'
    
PlayGuiSound("insanity_whisper01.ogg"0.8f);

    
// shake the screen
    
StartScreenShake(0.13f0.5f0.1f0.1f);

    
// let player look at the floor, where broom lies
    
StartPlayerLookAt("Room1_LookAt_3"1025"");

    
AddTimer("Room1_Cabinet"2"InteractTimer"); // 2 seconds
  
}

  
//---

  
else if (asEntity == "Room2_NotePaper")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// neuen Checkpoint setzen
    
CheckPoint ("Room2_Checkpoint""PlayerStartArea_3""PlayerDied""DeathMessage""Dead");
  }

  
//---

  
else if (asEntity == "SecretBook_1")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// set secret books stuck state to default (free/unstuck)
    
SetPropObjectStuckState(asEntity0);
  }
  else if (
asEntity == "SecretBook_2")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// set secret books stuck state to default (free/unstuck)
    
SetPropObjectStuckState(asEntity0);
  }
  else if (
asEntity == "SecretBook_3")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// set secret books stuck state to default (free/unstuck)
    
SetPropObjectStuckState(asEntity0);
  }
  else if (
asEntity == "SecretBook_4")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// set secret books stuck state to default (free/unstuck)
    
SetPropObjectStuckState(asEntity0);
  }

  
//---

  
else if (asEntity == "Cellar_Padlock")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    if (
HasItem("ChemicalContainer"))
    {
      
// Message - use acid on padlock
      
SetMessage("Messages""Padlock_UseAcid_Message"4);
    }
    else if (
StringContains(GetLocalVarString("VarSecretCode"), "done"))
    {
      if (!
QuestIsAdded("PadlockGoStorage"))
      {
        
// quest name, language file name
        
AddQuest("PadlockGoStorage","PadlockGoStorage");
        
SetMessage("Messages""Padlock_Locked_Message"3);
      }
      else if (!
QuestIsCompleted("PadlockGoStorage") && GetSwingDoorLocked("Cellar_Hatch"))
      {
        
SetMessage("Messages""Padlock_Locked_Message"3);
      }
    }
    else if (
GetSwingDoorLocked("Cellar_Hatch"))
    {
      if (!
QuestIsAdded("PadlockFindStorage"))
      {
        
// quest name, language file name
        
AddQuest("PadlockFindStorage","PadlockFindStorage");
        
SetMessage("Messages""Padlock_Locked_Message"3);
      }
      else if (!
QuestIsCompleted("PadlockFindStorage") && GetSwingDoorLocked("Cellar_Hatch"))
      {
        
SetMessage("Messages""Padlock_Locked_Message"3);
      }
    }
  }
  else if (
asEntity == "Cellar_Padlock_Broken")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// break sound
    
PlaySoundAtEntity("break""impact_metal_high""Cellar_Padlock_Broken"0.0ffalse);

    
// unlock the hatch
    
SetSwingDoorLocked("Cellar_Hatch"falsefalse);

    
GiveSanityBoostSmall();

    
// complete/remove quest
    
CompleteQuest("PadlockGoStorage""PadlockGoStorage");

    
// acivate ladder area
    
SetEntityActive("CellarLadderArea"true);
  }

  else if (
asEntity == "ChemicalContainer")
  {
    
AddDebugMessage("Interact with " asEntityfalse);

    
// complete quest
    
if (QuestIsAdded("PadlockFindStorage"))
    {
      
GiveSanityBoostSmall();
      
CompleteQuest("PadlockFindStorage""PadlockFindStorage");
    }
  }
}

//-----------------------------------------------------------------------------
//--- INTERACT TIMER FUNCTION ---
//-----------------------------------------------------------------------------

void InteractTimer(string &in asTimer)
{
  if(
asTimer == "Room1_Cabinet" || asTimer == "Room2_Shelf")
  {
    
StopPlayerLookAt();

    
// activate player movement
    
SetPlayerActive(true);
  }

  
//---

  
else if (asTimer == "SecretBooksMove")
  {
    
// "locked" sound as success noise
    
PlayGuiSound("gameplay_tick"0.8f);

    
// move secret books to normal pos
    
SetPropObjectStuckState("SecretBook_*", -1);

    
// timer for changing stuck state + message
    
AddTimer("SecretBooksFree"1"InteractTimer"); // 1 second
  
}
  else if (
asTimer == "SecretBooksFree")
  {
    
// set secret books stuck state to default (free/unstuck)
    
SetPropObjectStuckState("SecretBook_*"0);

    
// Message - nothing happened... books back at original position
    
SetMessage("Messages""Room2_SecretBooks_Message"4);

    
// reset vars
    
SetLocalVarInt("VarSecretMoves"0);
    
SetLocalVarString("VarSecretCode""");
  }

  
//---

  
else if (asTimer == "DestroyParticle")
  {
    
DestroyParticleSystem("dust");

    
AddTimer("5"3"IntroTimer"); // 3 seconds
  
}

  
//---

  
else if (asTimer == "StorageRoom_Statue")
  {
    
// play 'breathing sound' as 'shocking noise'
    
PlayGuiSound("react_breath4.ogg"1.0f);
  }
}

//-----------------------------------------------------------------------------

void LookAt(string &in asEntityint alState)
{
  if (
asEntity == "Room1_Broom" && alState == 1)
  {
    
AddDebugMessage("Player looking at Room1_Broom"false);
  }
}

//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//--- USE KEY FUNCTION ---
//-----------------------------------------------------------------------------

void UseKey(string &in asItemstring &in asEntity)
{
  
// unlock the door
  
SetSwingDoorLocked(asEntityfalsetrue);

  
// play 'unlock door' sound
  
PlayGuiSound("unlock_door"0.4f);

  
// remove the key from inventory, cause it is not needed anymore
  
RemoveItem(asItem);
}

//---

void UseKey_Chest(string &in asItemstring &in asEntity)
{
  
// unlock the chest
  
SetLeverStuckState(asEntity0false);

  
// play 'unlock door' sound
  
PlayGuiSound("unlock_door"0.4f);

  
// remove the key from inventory, cause it is not needed anymore
  
RemoveItem(asItem);
}

//-----------------------------------------------------------------------------
//--- USE ACID FUNCTION ---
//-----------------------------------------------------------------------------

void UseAcid(string &in asItemstring &in asEntity)
{
  
// remove the ChemicalContainer (filled one with acid) from inventory
  
RemoveItem(asItem);

  
// add a empty container
  
GiveItemFromFile("ChemicalContainerEmpty""chemical_container.ent");

  
// play acid burn sound
  
PlaySoundAtEntity("burnlock""puzzle_acid""Cellar_Padlock"1.0ffalse);

  
// change the padlocks with fade out/fade in
  
SetPropActiveAndFade("Cellar_Padlock"false2.0f);
  
SetPropActiveAndFade("Cellar_Padlock_Broken"true1.0f);

  
// disable the padlock collisions area
  
SetEntityActive("PadlockArea"false);
}

//-----------------------------------------------------------------------------
//--- prevent CANDLES from shining trough walls ---
//-----------------------------------------------------------------------------

void CandleSmall_Off(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Room1: small candle OFF"false);

  
SetLampLit("Room1_CandleSmall"falsefalse);
}

void CandleSmall_On(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Room1: small candle ON"false);

  
SetLampLit("Room1_CandleSmall"truefalse);
}

//---

void CandleBig_Off(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Room1: big candle OFF"false);

  
SetLampLit("Room1_CandleBig"falsefalse);
  
SetLampLit("Room1_Candle_3"falsefalse);
  
SetLampLit("Room1_Candle_4"falsefalse);

  
// Room 2
  
SetLampLit("Room2_Candle_1"truefalse);
  
SetLampLit("Room2_Candle_4"truefalse);
  
SetLampLit("Room2_Candle_5"truefalse);
  
SetLampLit("Room2_Candle_9"truefalse);
  
SetLampLit("Room2_Fire"truefalse);
}

void CandleBig_On(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Room1: big candle ON"false);

  
SetLampLit("Room1_CandleBig"truefalse);
  
SetLampLit("Room1_Candle_3"truefalse);
  
SetLampLit("Room1_Candle_4"truefalse);

  
// Room 2
  
SetLampLit("Room2_Candle_1"falsefalse);
  
SetLampLit("Room2_Candle_4"falsefalse);
  
SetLampLit("Room2_Candle_5"falsefalse);
  
SetLampLit("Room2_Candle_9"falsefalse);
  
SetLampLit("Room2_Fire"falsefalse);
}

//---

void Room3Candles_Off(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Room3 Candles: OFF"false);

  
SetLampLit("Room3_Fire"falsefalse);
}

void Room3Candles_On(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Room3 Candles: OFF"false);

  
SetLampLit("Room3_Fire"truefalse);
}

//---

void StairHallCandles_Off(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Stair Hall Candles: OFF"false);

  
SetLampLit("StairHall_CandleTri_*"falsefalse);
  
SetEntityActive("StairHall_SpotLight_*"false);
}

void StairHallCandles_On(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("Stair Hall Candles: ON"false);

  
SetLampLit("StairHall_CandleTri_*"truefalse);
  
SetEntityActive("StairHall_SpotLight_*"true);
}

//-----------------------------------------------------------------------------
//--- Room2 --- move shelf (in front of hidden tunnel) ---
//-----------------------------------------------------------------------------

void CollideSecretBook(string &in asParentstring &in asChildint alState)
{
  
// Debug Message
  
AddDebugMessage("moved book " asParentfalse);

  if (
alState == || alState == -1)
  {
    if (
GetLocalVarInt("VarSecretMoves") != 4)
    {
      
SetLocalVarInt("VarSecretMoves"GetLocalVarInt("VarSecretMoves")+1);
      
SetLocalVarString("VarSecretCode"GetLocalVarString("VarSecretCode") + asParent ",");

      
// Debug Message
      
AddDebugMessage("current code: " GetLocalVarString("VarSecretCode"), false);
    }
    else
    {
      
SetLocalVarString("VarSecretCode"GetLocalVarString("VarSecretCode") + asParent);

      
// Code == 3,1,4,2,3
      
if (GetLocalVarString("VarSecretCode") == "SecretBook_3,SecretBook_1,SecretBook_4,SecretBook_2,SecretBook_3")
      {
        
// Debug Message
        
AddDebugMessage("open shelf"false);

        
// set var to "moving" to prevent "wrong" message
        // set var to "done" to use it later (check)
        
SetLocalVarString("VarSecretCode""moving+done");

        
// deactivate player movement
        
SetPlayerActive(false);

        
// "locked" sound as success noise
        
PlaySoundAtEntity("BooksDone""lock_door""Player"0false);

        
// move secret books to default position
        
SetPropObjectStuckState("SecretBook_*", -1);
        
AddTimer("Room2_SecretBooks"0.25f"InteractTimer"); // 0.25 seconds

        // disbale interaction with secret books
        
SetEntityInteractionDisabled("SecretBook_*"true);

        
// let player look at the floor, where broom lies
        
StartPlayerLookAt("Room2_SecretShelf"23"");

        
AddTimer("Room2_Shelf"2"InteractTimer"); // 3 seconds

        // roate the shelf (open)
        
SetMoveObjectState("Room2_SecretShelf"0.5f);

        
// dust
        
CreateParticleSystemAtEntity("dust""ps_dust_falling_door_quick""Room2_SecretParticleArea"false);
        
AddTimer("DestroyParticle"15"InteractTimer"); // 15 seconds

        // puzzle secret - music
        
PlayMusic("03_puzzle_secret.ogg"false0.7f010false);
      }
      else if (!
StringContains(GetLocalVarString("VarSecretCode"), "moving"))
      {
        
// set var to "moving" to prevent repeat of "wrong" message
        
SetLocalVarString("VarSecretCode""moving");

        
// move secret books to default position
        
AddTimer("SecretBooksMove"1"InteractTimer"); // 1 second
      
}
    }
  }
}

//-----------------------------------------------------------------------------
//--- Room 2 - Painting collides with AreaPainting, when player picks it ---
//-----------------------------------------------------------------------------

void PuzzleSound(string &in asParentstring &in asChildint alState)
{
  
AddDebugMessage("Interact with " asParentfalse);

  
// puzzle solved sound
  
PlayMusic("02_puzzle.ogg"false0.7f010false);
}

//-----------------------------------------------------------------------------
//--- Storage Room - Statue collide with door ---
//-----------------------------------------------------------------------------

void SmashStatue(string &in asParentstring &in asChildint alState)
{
  
AddDebugMessage("Interact with StorageRoom_Door"false);

  
// stop the door from moving, like hittin the statue
  
AddPropImpulse("StorageRoom_Door"002"World");

  
// shake the screen
  
StartScreenShake(0.10f0.2f0.1f0.1f);

  
// Sanity Damage
  
GiveSanityDamage(35.0ftrue);

  
PlaySoundAtEntity("Impact""15_body_impact.snt""StorageRoom_ArmorFall"0false);
  
AddTimer("StorageRoom_Statue"1"InteractTimer"); // 1 second
}

//-----------------------------------------------------------------------------
//--- Room 3 - bloody vision scare ---
//-----------------------------------------------------------------------------

void BeginVision(string &in asParentstring &in asChildint alState)
{
  
// deactivate player movement
  
SetPlayerActive(false);

  
// Sanity Damage
  
GiveSanityDamage(35.0ftrue);

  
// disable lantern
  
SetLanternActive(falsefalse);

  
// puzzle secret - music
  
PlayMusic("19_event_brute.ogg"false1.1f010false);

  
// counter var - to decrease speed
  
SetLocalVarInt("Counter"0);

  
// var to stop player
  
SetLocalVarInt("Stop"0);

  
// let player look at the bed on the right
  
StartPlayerLookAt("Room3_LookAt_1"23"");

  
// Timer for player movement - to bed
  
AddTimer("1"0.1f"MovePlayerTimer"); // 0.1 seconds
}

//---

void MovePlayerTimer(string &in asTimer)
{
  if (
asTimer == "1")
  {
    
// move the player to the bed
    
AddPlayerBodyForce(3150 - (GetLocalVarInt("Counter") * 10), 01100false);

    if (
GetLocalVarInt("Stop") != 1)
    {
      
// Timer for player movement - to bed
      
AddTimer("1"0.1f"MovePlayerTimer"); // 0.1 seconds

      // increase counter var - to decrease speed
      
SetLocalVarInt("Counter"GetLocalVarInt("Counter")+1);
    }
    else
    {
      
// counter var - reset
      
SetLocalVarInt("Counter"0);

      
// var to stop player - reset
      
SetLocalVarInt("Stop"0);

      
// Timer for player movement - to cabinet
      
AddTimer("look2"1"MovePlayerTimer"); // 1 second
    
}
  }
  else if (
asTimer == "look2")
  {
    
// let player look at the bloody floor
    
StartPlayerLookAt("Room3_LookAt_2"23"");

    
AddTimer("look3"1"MovePlayerTimer"); // 1 second
  
}
  else if (
asTimer == "look3")
  {
    
// let player look at the bloody floor
    
StartPlayerLookAt("Room3_LookAt_3"23"");

    
AddTimer("2"1"MovePlayerTimer"); // 1 second
  
}
  else if (
asTimer == "2")
  {
    
// move the player from the bed to the cabinet
    
AddPlayerBodyForce(-3150 + (GetLocalVarInt("Counter") * 10), 0900 - (GetLocalVarInt("Counter") * 10), false);

    if (
GetLocalVarInt("Stop") != 1)
    {
      
// Timer for player movement - to cabinet
      
AddTimer("2"0.1f"MovePlayerTimer"); // 0.1 seconds

      // increase counter var - to decrease speed
      
SetLocalVarInt("Counter"GetLocalVarInt("Counter")+1);
    }
    else
    {
      
// let player look at the bloody cabinet
      
StartPlayerLookAt("Room3_LookAt_end"23"");

      
// counter var - reset
      
SetLocalVarInt("Counter"0);

      
// var to stop player - reset
      
SetLocalVarInt("Stop"0);

      
// Timer for player movement - to cabinet
      
AddTimer("3"0.1f"MovePlayerTimer"); // 0.1 seconds
    
}
  }
  else if (
asTimer == "3")
  {
    
// push the player from the bed to the cabinet
    
AddPlayerBodyForce(-1400 + (GetLocalVarInt("Counter") * 10), 02600 - (GetLocalVarInt("Counter") * 10), false);

    if (
GetLocalVarInt("Stop") != 1)
    {
      
// Timer for player movement - to cabinet
      
AddTimer("3"0.1f"MovePlayerTimer"); // 0.1 seconds

      // increase counter var - to decrease speed
      
SetLocalVarInt("Counter"GetLocalVarInt("Counter")+1);
    }
    else
    {
      
// counter var - reset
      
SetLocalVarInt("Counter"0);

      
// Timer for open cabinet
      
AddTimer("open cabinet"1"MovePlayerTimer"); // 1 second

      
AddDebugMessage("open cabinet doors"false);
    }
  }
  else if (
asTimer == "open cabinet")
  {
    
// open the cabinet doors
    
AddPropForce("Room3_Cabinet"00, -45,"World");

    if (
GetLocalVarInt("Counter") != 15)
    {
      
// Timer for player movement - to cabinet
      
AddTimer("open cabinet"0.1f"MovePlayerTimer"); // 0.1 second

      // counter var
      
SetLocalVarInt("Counter"GetLocalVarInt("Counter")+1);
    }
    else
    {
      
// play 'breathing sound' as 'shocking noise'
      
PlayGuiSound("react_breath4.ogg"0.9f);

      
// Sanity Damage
      
GiveSanityDamage(10.0ftrue);

      
// Timer for smashing the door
      
AddTimer("smash door"3"MovePlayerTimer"); // 3 seconds
    
}
  }
  else if (
asTimer == "smash door")
  {
    
AddDebugMessage("smash door"false);

    
// smash the door
    
SetSwingDoorClosed("Room3_Door"truefalse);

    
// dust
    
CreateParticleSystemAtEntity("dust_door""ps_dust_impact_vert.ps""Room3_AreaDust"false);

    
// sound for door smashing
    
PlayGuiSound("21_bang_door"1.5f);

    
// shake the screen
    
StartScreenShake(0.25f0.1f0.25f0.1f);

    
// Sanity Damage
    
GiveSanityDamage(15.0ftrue);

    
// Timer for looking to the door
    
AddTimer("look door"0.7f"MovePlayerTimer"); // 0.7 seconds
  
}
  else if (
asTimer == "look door")
  {
    
// play 'breathing sound' as 'shocking noise'
    
PlayGuiSound("react_breath4.ogg"0.9f);

    
// let player look at the bloody cabinet
    
StartPlayerLookAt("Room3_Door"48"");

    
// Timer for activation of player movement
    
AddTimer("end"1"MovePlayerTimer"); // 1 second
  
}
  else if (
asTimer == "end")
  {
    
// play 'breathing sound' as 'shocking noise'
    
PlayGuiSound("react_breath4.ogg"0.9f);

    
// activate player movement
    
SetPlayerActive(true);
    
StopPlayerLookAt();

    
// Timer for activation of player movement
    
AddTimer("quest"1"MovePlayerTimer"); // 1 second
  
}
  else if (
asTimer == "quest")
  {
    
// find a way out of the mansion quest
    
AddQuest("GetOutOfHere","GetOutOfHere");
  }
}

//-----------------------------------------------------------------------------
//--- Room 3 - bloody vision scare --- area collide callbacks ---
//-----------------------------------------------------------------------------

//--- movement - area collide - door to bed

void MoveLeft_1(string &in asParentstring &in asChildint alState)
{
  
// move the player to the left
  
AddPlayerBodyForce(00, -1500false);
}

void MoveRight_1(string &in asParentstring &in asChildint alState)
{
  
// move the player to the right
  
AddPlayerBodyForce(001500false);
}

//--- movement - area collide - bed to cabinet 1

void MoveLeft_2(string &in asParentstring &in asChildint alState)
{
  
// move the player to the left
  
AddPlayerBodyForce(001500false);
}

void MoveRight_2(string &in asParentstring &in asChildint alState)
{
  
// move the player to the right
  
AddPlayerBodyForce(00, -1500false);
}

//--- movement - area collide - bed to cabinet 2

void MoveLeft_3(string &in asParentstring &in asChildint alState)
{
  
// move the player to the left
  
AddPlayerBodyForce(150000false);
}

void MoveRight_3(string &in asParentstring &in asChildint alState)
{
  
// move the player to the right
  
AddPlayerBodyForce(-150000false);
}

//--- movement - area collide - stop movement

void StopMove_1(string &in asParentstring &in asChildint alState)
{
  
AddDebugMessage("stop movement"false);

  
// var to stop player
  
SetLocalVarInt("Stop"1);

  
// remove collide callbacks 1
  
RemoveEntityCollideCallback("Player""MoveL1");
  
RemoveEntityCollideCallback("Player""MoveR1");
  
RemoveEntityCollideCallback("Player""StopMove1");
}

void StopMove_2(string &in asParentstring &in asChildint alState)
{
  
AddDebugMessage("stop movement"false);

  
// var to stop player
  
SetLocalVarInt("Stop"1);

  
// remove collide callbacks 2
  
RemoveEntityCollideCallback("Player""MoveL2");
  
RemoveEntityCollideCallback("Player""MoveR2");
  
RemoveEntityCollideCallback("Player""StopMove2");
}

void StopMove_3(string &in asParentstring &in asChildint alState)
{
  
AddDebugMessage("stop movement"false);

  
// var to stop player
  
SetLocalVarInt("Stop"1);

  
// remove collide callbacks 3
  
RemoveEntityCollideCallback("Player""MoveL3");
  
RemoveEntityCollideCallback("Player""MoveR3");
  
RemoveEntityCollideCallback("Player""StopMove3");
}

//-----------------------------------------------------------------------------
//--- Room 4 - Table Area Scare ---
//-----------------------------------------------------------------------------

void BreakTables(string &in asParentstring &in asChildint alState)
{
  
// deactivate player movement
  
SetPlayerActive(false);

  
// sound for door smashing
  
PlayGuiSound("21_bang_door"0.7f);

  
// let player look at the door
  
StartPlayerLookAt("Room4_Door_2"48"");

  
// open the door
  
SetSwingDoorDisableAutoClose("Room4_Door_2"true);
  
SetSwingDoorClosed("Room4_Door_2"falsefalse);
  
SetSwingDoorLocked("Room4_Door_2"falsefalse);

  
// force the door to open
  
AddPropImpulse("Room4_Door_2", -4500"World");

  
// dust
  
CreateParticleSystemAtEntity("dust_door""ps_dust_impact_vert.ps""Room4_AreaDust"false);

  
// Sanity Damage
  
GiveSanityDamage(15.0ftrue);

  
// shake the screen
  
StartScreenShake(0.25f0.1f0.25f0.1f);

  
// player reaction
  
PlaySoundAtEntity("react""react_pant.snt""Player"0false);

  
// disable lantern
  
SetLanternActive(falsefalse);

  
// counter var
  
SetLocalVarInt("Counter"0);

  
// timer to break and move objects
  
AddTimer("push"0.5f"BreakTimer"); // 0.5 seconds
}

//---

void BreakTimer(string &in asTimer)
{
  if (
asTimer == "push")
  {
    
// push the chairs away
    
AddPropImpulse("Room4_Chair_L" GetLocalVarInt("Counter"), 00, -5"World");
    
AddPropImpulse("Room4_Chair_R" GetLocalVarInt("Counter"), 00,  5"World");

    
// push the plates away
    
AddPropImpulse("Room4_PlateL_" GetLocalVarInt("Counter"), 00, -5"World");
    
AddPropImpulse("Room4_PlateR_" GetLocalVarInt("Counter"), 00,  5"World");

    
// push the silver away
    
AddPropImpulse("Room4_SilverL_" GetLocalVarInt("Counter"), 00, -5"World");
    
AddPropImpulse("Room4_SilverR_" GetLocalVarInt("Counter"), 00,  5"World");

    
// disable lights
    
if (GetLocalVarInt("Counter") ==  2)
    {
      
SetLampLit("Room4_Candle_1"falsefalse);
    }
    else if (
GetLocalVarInt("Counter") ==  5)
    {
      
SetLampLit("Room4_Candle_2"falsefalse);
    }
    else if (
GetLocalVarInt("Counter") ==  8)
    {
      
SetLampLit("Room4_Candle_3"falsefalse);
    }
    else if (
GetLocalVarInt("Counter") ==  11)
    {
      
SetLampLit("Room4_Candle_4"falsefalse);
    }
    else if (
GetLocalVarInt("Counter") ==  14)
    {
      
SetLampLit("Room4_Candle_5"falsefalse);
    }

    if (
GetLocalVarInt("Counter") != 16)
    {
      
// increase counter var
      
SetLocalVarInt("Counter"GetLocalVarInt("Counter") + 1);

      
// timer to break and move objects
      
AddTimer("push"0.2f"BreakTimer"); // 0.4 seconds
    
}
    else
    {
      
SetPlayerSanity(0.0f);
      
AddTimer("push_end"0.2f"BreakTimer"); // 0.4 seconds
    
}
  }
  else if (
asTimer == "push_end")
  {
    
AddPropImpulse("Room4_Chair_End", -500"World");

    
// activate player movement
    
SetPlayerActive(true);
    
StopPlayerLookAt();

    
AddTimer("quest"12"BreakTimer"); // 12 seconds
  
}
  else if (
asTimer == "quest")
  {
    
AddQuest("Shadow","Shadow");
  }
}

//-----------------------------------------------------------------------------
//--- Hallway - Enable Grunts and disable all hallway lights ---
//-----------------------------------------------------------------------------

void EnableHallGrunts(string &in asParentstring &in asChildint alState)
{
  
// deactivate player movement
  
SetPlayerActive(false);

  
// let player look at the first grunt
  
StartPlayerLookAt("AreaGrunt_1"48"");

  
// Sanity Damage
  
GiveSanityDamage(5.0ftrue);

  
// disable lantern
  
SetLanternActive(falsefalse);

  
// counter var
  
SetLocalVarInt("Counter"0);

  
// timer to turn the lights off
  
AddTimer("lights off"0.2f"LightsOffTimer"); // 0.2 seconds
}

void LightsOffTimer(string &in asTimer)
{
  if (
asTimer == "lights off")
  {
    
// set candles off
    
SetLampLit("HallM_Candle_" GetLocalVarInt("Counter"), falsefalse);

    if (
GetLocalVarInt("Counter") != 12)
    {
      
// increase counter var
      
SetLocalVarInt("Counter"GetLocalVarInt("Counter") + 1);

      
// timer to turn the lights off
      
AddTimer("lights off"0.2f"LightsOffTimer"); // 0.2 seconds
    
}
    else
    {
      
// let player look at the floor
      
StartPlayerLookAt("AreaLookGrunt"12"");

      
// set all candles off
      
SetLampLit("HallM_Candle_*"falsefalse);

      
// player sanity '0'
      
SetPlayerSanity(0.0f);

      
// push the player in the middle of the hall
      
AddPlayerBodyForce(00, -25000false);

      
// timer to spawn the grunts
      
AddTimer("spawn grunts"2.5f"LightsOffTimer"); // 2.5 seconds

      // counter var - "-1" for grunt hit door
      
SetLocalVarInt("Counter", -1);
    }
  }
  else if (
asTimer == "spawn grunts")
  {
    
// sound for monster
    
PlayGuiSound("insanity_monster_roar01.ogg"1.5f);

    
// enable grunt 1 and let it run to player
    
SetEntityActive("servant_brute_1"true);
    
ShowEnemyPlayerPosition("servant_brute_1");

    
// let player look at the first grunt
    
StartPlayerLookAt("servant_brute_1"48"");

    
// timer to look at the 2nd grunt
    
AddTimer("look to grunt 2"10.0f"LightsOffTimer"); // 10 seconds
  
}
  else if (
asTimer == "look to grunt 2")
  {
    
// sound for monster
    
PlayGuiSound("insanity_monster_roar02.ogg"1.5f);

    
// enable grunt 2 and let it run to player
    
SetEntityActive("servant_brute_2"true);
    
ShowEnemyPlayerPosition("servant_brute_2");

    
// let player look at the first grunt
    
StartPlayerLookAt("servant_brute_2"48"");

    
// timer to make player active
    
AddTimer("look door"10.0f"LightsOffTimer"); // 10 seconds
  
}
  else if (
asTimer == "look door")
  {
    
// sound for monster
    
PlayGuiSound("enabled01.ogg"1.5f);

    
// let player look at the first grunt
    
StartPlayerLookAt("Room5_AreaDust"48"");

    
// timer to hit the door
    
AddTimer("hit door"2.0f"LightsOffTimer"); // 2 seconds

    // timer to make player active
    
AddTimer("player active"3.0f"LightsOffTimer"); // 3 seconds
  
}
  else if (
asTimer == "hit door")
  {
    if (
GetLocalVarInt("Counter") == -1)
    {
      
// push the door
      
AddPropImpulse("Room5_Door", -2500"World");

      
// sound for door hit
      
PlayGuiSound("hit_wood1.ogg"1.5f);

      
// dust
      
CreateParticleSystemAtEntity("dust_door""ps_dust_impact_vert.ps""Room5_AreaDust"false);

      
// timer to hit the door
      
AddTimer("hit door"RandInt(14), "LightsOffTimer"); // 2 seconds
    
}

    
SetLocalVarInt("random"RandInt(120));

    if (
GetLocalVarInt("random") == 5)
    {
      
// sound for monster
      
PlayGuiSound("enabled01.ogg"1.5f);
    }
    else if (
GetLocalVarInt("random") == 10)
    {
      
// sound for monster
      
PlayGuiSound("enabled02.ogg"1.5f);
    }
    else if (
GetLocalVarInt("random") == 15)
    {
      
// sound for monster
      
PlayGuiSound("enabled04.ogg"1.5f);
    }
  }
  else if (
asTimer == "player active")
  {
    
// activate player movement
    
SetPlayerActive(true);
    
StopPlayerLookAt();

    
// timer to play grunt attack music
    
AddTimer("attack music"1.0f"LightsOffTimer"); // 1 seconds
  
}
  else if (
asTimer == "attack music")
  {
    
// ambient music 'guardian attack'
    
PlayMusic("att_guardian"true1.0f50true);

    
// timer to play normal ambient music
    
AddTimer("ambient music"38.0f"LightsOffTimer"); // 38 seconds
  
}
  else if (
asTimer == "ambient music")
  {
    
// ambient music 'normal'
    
PlayMusic("10_amb"true0.5f50true);

    
// counter var reset (stop the grunt hitting the door)
    
SetLocalVarInt("Counter"0);
  }
}

//-----------------------------------------------------------------------------
//--- Player died ---
//-----------------------------------------------------------------------------

void PlayerDied(string &in asNameint alCount)
{
  
StopMusic(1.0f1);

  
// ambient music 'normal'
  
PlayMusic("10_amb"true0.5f50true);

  if (
asName == "Room1_Checkpoint")
  {
    
// Room1 lights ON / Room2 lights OFF
    
CandleSmall_On(""""1);
    
CandleBig_On(""""1);
  }
  else if (
asName == "Room2_Checkpoint")
  {
    
// Room1 lights OFF / Room2 lights ON
    
CandleSmall_Off(""""1);
    
CandleBig_Off(""""1);
  }
}

//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//--- ROOM EXIT --- PLAY CREDITS ---
//-----------------------------------------------------------------------------

void Credits(string &in asParentstring &in asChildint alState)
{
  
StartCredits("credits.ogg"false"Ending""MyCredits", -1);
}

//----------------------------------------------------------------------------- 

Regards
iNs
(This post was last modified: 05-03-2011, 08:01 PM by iNs.)
04-04-2011, 02:36 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#2
RE: [WIP][beta testing] no name yet - v0.2b

So uh... why didn't you wait until you had more to show us to make this thread?

[Image: signature-2.png]
04-05-2011, 03:58 AM
Find
iNs Offline
Junior Member

Posts: 21
Threads: 4
Joined: Mar 2011
Reputation: 0
#3
RE: [WIP][beta testing] no name yet - v0.2b

(04-05-2011, 03:58 AM)Streetboat Wrote: So uh... why didn't you wait until you had more to show us to make this thread?

Because I just wanted to get some feedback, before I work on it any further.
I did some scripting, that is new to amnesia, afaik. I wanted to know, how the
other players would think about it.

Also I was interested in some feedback for my level of detail for the rooms.

For me, it is easier to ask people BEFORE I created the whole map.
Because it is hard work to create a map, and Iam not interested to do
big changes again, after I have finsihed the map.


Regards
iNs
04-05-2011, 01:48 PM
Find
Dalroc Offline
Member

Posts: 57
Threads: 2
Joined: Mar 2011
Reputation: 0
#4
RE: [WIP][beta testing] no name yet - v0.2b

Dude, not to be mean or anything, but a corridor and 4 rooms isn't enough too get people interested..
You barely give any info either..
04-05-2011, 07:12 PM
Find
iNs Offline
Junior Member

Posts: 21
Threads: 4
Joined: Mar 2011
Reputation: 0
#5
RE: [WIP][beta testing] no name yet - v0.2b

(04-05-2011, 07:12 PM)Dalroc Wrote: Dude, not to be mean or anything, but a corridor and 4 rooms isn't enough too get people interested..
You barely give any info either..

You guys dont undestand what Iam saying!

I wanted to have FEEDBACK. I did not want to get people interested in my map yet.
I just wanted some players to test my map, and give a feedback on my scripts
and on my map and details used for the rooms... thats all and nothing more.
04-05-2011, 07:28 PM
Find
KenOfAllTrades Offline
Member

Posts: 53
Threads: 2
Joined: Apr 2011
Reputation: 0
#6
RE: [WIP][beta testing] no name yet - v0.2b

Hey bro, no worries, I'll try your story

EDIT: Oh, so DL link isn't in the post, guess I'll have to write a PM then

I probably made a LP of this! Youtube channel here!
(This post was last modified: 04-06-2011, 11:42 AM by KenOfAllTrades.)
04-06-2011, 11:41 AM
Find
Dark Knight Offline
Senior Member

Posts: 634
Threads: 5
Joined: Feb 2008
Reputation: 5
#7
RE: [WIP][beta testing] no name yet - v0.2b

hey, where "s download link? Big Grin
04-06-2011, 12:04 PM
Find
iNs Offline
Junior Member

Posts: 21
Threads: 4
Joined: Mar 2011
Reputation: 0
#8
RE: [WIP][beta testing] no name yet - v0.2b

(04-06-2011, 12:04 PM)Dark Knight Wrote: hey, where "s download link? Big Grin

The fact that you can write this message, tells me that you can read.
Now use your skillz and READ the first post.... <.<
04-06-2011, 02:15 PM
Find
Ghostflame Offline
Member

Posts: 152
Threads: 0
Joined: Mar 2011
Reputation: 0
#9
RE: [WIP][beta testing] no name yet - v0.2b

Wow wow wow, no need to be that way about it, just 9 times out of 10 theres a download link, so people assume there is one, it's got nothing to do with reading abilities.
04-06-2011, 08:36 PM
Find
Dark Knight Offline
Senior Member

Posts: 634
Threads: 5
Joined: Feb 2008
Reputation: 5
#10
RE: [WIP][beta testing] no name yet - v0.2b

(04-06-2011, 02:15 PM)iNs Wrote: The fact that you can write this message, tells me that you can read.
Now use your skillz and READ the first post.... <.<
funny really!


can"t realize that Sad
04-07-2011, 02:49 PM
Find




Users browsing this thread: 7 Guest(s)