| eroniss55   Junior Member
 
 Posts: 9
 Threads: 1
 Joined: Sep 2015
 Reputation: 
0
 | 
			|  RE: I've just bought penumbra series from steam but can't play 
 
				I guess I've found my issue. 
level00_01_boat_cabin.hps 
(As I though)
 //////////////////////////END LEVEL START///
 void EndLevel01(string asTimer)
 {
 PlaySoundEntity("boathorn1",false);
 
 AddSubTitleTrans("00_01_boat_cabin", "EndLevel01", 4);
 
 SetGameEntityActive("exitdoor",true);
 
 AddEntityCallback("PlayerInteract","exitdoor","ExitDoorInteract01");
 }
 
 void ExitDoorInteract01(string asEntity)
 {
 ChangeMap(    "level01_01_outside.dae", //New map
 "link1", //Positon on new map
 "door_metal_boat_open","", //Stop and end sound.
 0.5f , 0.5f,//Fade out and in time (seconds).
 "LoadTexts", "00_01_to_01_01"); //Load text (cat and entry)
 }
 ////END LEVEL STOP///
 /////////////////////
There is something wrong about this line. ("Exitdoor" structure)
 
Here is my level00_01_boat_cabin.hps file.
 ///////////////////////*CALLBACK FUNCTIONS*/
 
 
 ///////////////////
 ////INTRO START////
 void FadeEffect01(string asTimer)
 {
 FadeIn(3.5);
 
 SetDepthOfFieldActive(true,0);
 SetupDepthOfField(0,0.1,0.2);
 }
 void IntroEffect01(string asTimer)
 {
 StartPlayerLookAt("lookintro2",0.25f, 4);
 }
 void IntroEffect02(string asTimer)
 {
 //Removes widescreen after moving head at start, but keeps player locked
 SetWideScreenActive(false);
 
 StopPlayerLookAt();
 
 SetDepthOfFieldActive(false,4);
 
 SetGameEntityActive("lookintro1",false);
 SetGameEntityActive("lookintro2",false);
 }
 ////INTRO STOP////
 //////////////////
 
 
 ///////////////////////////////
 ////HORN SOUND & TEXT START////
 void HornEvent01(string asTimer)
 {
 PlaySoundEntity("boathorn1",false);
 
 PlayGameMusic("penumbra_music_E1_A6",0.7,0.2,true,0);
 
 CreateTimer("Horn2", 1, "HornEvent02",false);
 DestroyTimer("Horn1");
 }
 void HornEvent02(string asTimer)
 {
 CreateTimer("Horn3", 0.5, "HornEvent03",false);
 DestroyTimer("Horn2");
 }
 void HornEvent03(string asTimer)
 {
 AddToTempStringTrans("00_01_boat_cabin", "BoatHorn01");
 AddToTempStringAction("Interact");
 AddToTempStringTrans("00_01_boat_cabin", "BoatHorn02");
 AddToTempStringAction("Examine");
 AddToTempStringTrans("Misc", "QuoteDot");
 AddMessageTempString();
 
 /*AddMessage(Translate("00_01_boat_cabin", "BoatHorn01")
 + GetActionKeyString("Interact")
 + Translate("00_01_boat_cabin", "BoatHorn02")
 + GetActionKeyString("Examine")
 + Translate("Misc", "QuoteDot"));*/
 
 SetMessagesOverCallback("HornEvent04");
 
 DestroyTimer("Horn3");
 }
 void HornEvent04()
 {
 //Finally the player is unlocked and can move, the intro sequence is over.
 SetPlayerActive(true);
 }
 ////HORN SOUND & TEXT STOP////
 //////////////////////////////
 
 
 ///////////////////////////
 ////LOCKED LOCKER START////
 //EXAMINE PADLOCK
 void PadLockAreaExamine01(string asEntity)
 {
 AddToTempStringTrans("00_01_boat_cabin", "PadLock01");
 AddToTempStringAction("Inventory");
 AddToTempStringTrans("Misc", "ParentDot");
 AddMessageTempString();
 
 /*AddMessage(Translate("00_01_boat_cabin", "PadLock01")
 + GetActionKeyString("Inventory")
 + Translate("Misc", "ParentDot"));*/
 
 RemoveEntityCallback("PlayerExamine","padlockarea");
 }
 
 //USE KEY ON LOCK
 void LockAreaUseKey01(string asItem, string asEntity)
 {
 PlayGuiSound("key_unlock", 0.8);
 
 GiveItem("padlock","boat_lock.ent",-1);
 
 //Partitialy removes help about locked locker, play opened locker but not found map folder
 SetLocalVar("lockerlesshelp", 1);
 
 RemoveUseCallback("LockAreaUseKey01");
 RemoveUseCallback("Locker01UseKey01");
 
 RemoveItem("padlock_key");
 
 SetGameEntityDescriptionOnceTrans("locker1", "", "");
 
 SetGameEntityActive("lock1",false);
 SetGameEntityActive("padlockarea",false);
 }
 //TO MAKE IT EASIER, THE WHOLE LOCKER CAN BE USED TO OPEN WITH THE KEY
 void Locker01UseKey01(string asItem, string asEntity)
 {
 PlayGuiSound("key_unlock", 0.8);
 
 GiveItem("padlock","boat_lock.ent",-1);
 
 //Partitialy removes help about locked locker, play opened locker but not found map folder
 SetLocalVar("lockerlesshelp", 1);
 
 RemoveUseCallback("LockAreaUseKey01");
 RemoveUseCallback("Locker01UseKey01");
 
 RemoveItem("padlock_key");
 
 SetGameEntityDescriptionOnceTrans("locker1", "", "");
 
 SetGameEntityActive("lock1",false);
 SetGameEntityActive("padlockarea",false);
 }
 
 //TUTORIAL ON FLASHLIGHT
 void FlashlightTutorial01(string asParent, string asChild)
 {
 if(HasItem("flashlight") == true)
 {
 AddToTempStringTrans("00_01_boat_cabin", "TutorialFlashLight01");
 AddToTempStringAction("Flashlight");
 AddToTempStringTrans("00_01_boat_cabin", "TutorialFlashLight02");
 AddSubTitleTempString(4);
 
 /*AddSubTitle(Translate("00_01_boat_cabin", "TutorialFlashLight01")
 + GetActionKeyString("Flashlight")
 + Translate("00_01_boat_cabin", "TutorialFlashLight02"), 4);*/
 }
 else if(HasItem("flashlight") == false)
 {
 AddSubTitleTrans("00_01_boat_cabin", "TutorialFlashLight03", 5);
 }
 
 SetGameEntityActive("locker1area",false);
 RemoveEntityCallback("PlayerExamine","locker1");
 }
 
 //LOCKER HELP
 void LockerHelp01(string asTimer)
 {
 if(GetLocalVar("lockerlesshelp") == 0)
 {
 AddToTempStringTrans("00_01_boat_cabin", "LockerHelp01");
 AddToTempStringAction("Inventory");
 AddToTempStringTrans("Misc", "ParentDot");
 AddMessageTempString();
 
 /*AddMessage(Translate("00_01_boat_cabin", "LockerHelp01")
 + GetActionKeyString("Inventory")
 + Translate("Misc", "ParentDot"));*/
 }
 else if(GetLocalVar("lockerlesshelp") == 1)
 {
 AddMessageTrans("00_01_boat_cabin", "LockerHelp02");
 }
 DestroyTimer("LockerTimer1");
 }
 ////LOCKED LOCKER STOP////
 //////////////////////////
 
 
 //////////////////////
 ////PICK UPS START////
 void PickFlashlight01(string asItem)
 {
 AddToTempStringTrans("00_01_boat_cabin", "TutorialFlashLight04");
 AddToTempStringAction("Inventory");
 AddToTempStringTrans("00_01_boat_cabin", "TutorialFlashLight05");
 AddToTempStringAction("Flashlight");
 AddToTempStringTrans("Misc", "QuoteDot");
 AddMessageTempString();
 
 /*AddMessage(Translate("00_01_boat_cabin", "TutorialFlashLight04")
 + GetActionKeyString("Inventory")
 + Translate("00_01_boat_cabin", "TutorialFlashLight05")
 + GetActionKeyString("Flashlight")
 + Translate("Misc", "QuoteDot"));*/
 }
 
 void PickBattery01(string asItem)
 {
 AddMessageTrans("00_01_boat_cabin", "TutorialBattery01");
 }
 
 void PickNotebook01(string asItem)
 {
 AddToTempStringTrans("00_01_boat_cabin", "TutorialNotebook01");
 AddToTempStringAction("NoteBook");
 AddToTempStringTrans("00_01_boat_cabin", "TutorialNotebook02");
 AddToTempStringAction("PersonalNotes");
 AddToTempStringTrans("Misc", "ParentDot");
 AddMessageTempString();
 
 /*AddMessage(Translate("00_01_boat_cabin", "TutorialNotebook01")
 + GetActionKeyString("NoteBook")
 + Translate("00_01_boat_cabin", "TutorialNotebook02")
 + GetActionKeyString("PersonalNotes")
 + Translate("Misc", "ParentDot"));*/
 //DRAWER TUTORIAL IF PLAYER HAS NOT ALREADY TAKEN FLASHLIGHT
 if(HasItem("flashlight") == false)
 {
 CreateTimer("flashlighttimer1", 0.5f, "DrawerTutorial01",false);
 }
 }
 //TUTORIAL FOR OPENING DRAWERS
 void DrawerTutorial01(string asTimer)
 {
 AddToTempStringTrans("00_01_boat_cabin", "TutorialDrawer01");
 AddToTempStringAction("Interact");
 AddToTempStringTrans("00_01_boat_cabin", "TutorialDrawer02");
 AddMessageTempString();
 
 /*AddMessage(Translate("00_01_boat_cabin", "TutorialDrawer01")
 + GetActionKeyString("Interact")
 + Translate("00_01_boat_cabin", "TutorialDrawer02"));*/
 }
 
 void Mapfolder01(string asItem)
 {
 AddToTempStringTrans("00_01_boat_cabin", "TutorialMapfolder01");
 AddToTempStringAction("GlowStick");
 AddToTempStringTrans("Misc", "QuoteDot");
 AddMessageTempString();
 
 /*AddMessage(Translate("00_01_boat_cabin", "TutorialMapfolder01")
 + GetActionKeyString("GlowStick")
 + Translate("Misc", "QuoteDot"));*/
 
 //Turns off help message for locker, player managed to open the locker and already found the map folder.
 SetLocalVar("lockerhelp", 1);
 }
 ////PICK UPS STOP////
 /////////////////////
 
 
 //////////////////////
 ////END LEVEL START///
 void EndLevel01(string asTimer)
 {
 PlaySoundEntity("boathorn1",false);
 
 AddSubTitleTrans("00_01_boat_cabin", "EndLevel01", 4);
 
 SetGameEntityActive("exitdoor",true);
 
 AddEntityCallback("PlayerInteract","exitdoor","ExitDoorInteract01");
 }
 
 void ExitDoorInteract01(string asEntity)
 {
 ChangeMap(    "level01_01_outside.dae", //New map
 "link1", //Positon on new map
 "door_metal_boat_open","", //Stop and end sound.
 0.5f , 0.5f,//Fade out and in time (seconds).
 "LoadTexts", "00_01_to_01_01"); //Load text (cat and entry)
 }
 ////END LEVEL STOP///
 /////////////////////
 
 
 //////////////////////////////////////////////////////////
 /*This function is run the FIRST time the map is loaded */
 void OnStart()
 {
 //---- AREA INIT ----------------------
 AddEntityCollideCallback("Enter","locker1","locker1area","FlashlightTutorial01");
 
 SetGameEntityActive("exitdoor",false);
 
 SetAreaCustomIcon("exitdoor", "DoorLink");
 
 
 //---- AUDIO INIT -----------------------
 StopSoundEntity("boathorn1",false);
 
 
 //---- INTERACT INIT ----------------------
 AddEntityCallback("PlayerExamine","padlockarea","PadLockAreaExamine01");
 AddEntityCallback("PlayerInteract","exitdoor","ExitDoorInteract01");
 
 AddUseCallback("padlock_key", "padlockarea", "LockAreaUseKey01");
 AddUseCallback("padlock_key", "locker1", "Locker01UseKey01");
 AddUseCallback("padlock_key", "lock1", "Locker01UseKey01");
 
 AddPickupCallback("flashlight", "PickFlashlight01");
 AddPickupCallback("battery1", "PickBattery01");
 AddPickupCallback("notebook", "PickNotebook01");
 AddPickupCallback("glowstick", "Mapfolder01");
 
 bool bIntro = true;
 
 //---- INTRO INIT ------------------
 if(bIntro)
 {
 FadeOut(0);
 
 SetPlayerActive(false);
 SetWideScreenActive(true);
 
 StartPlayerLookAt("lookintro1",100, 0.001f);
 }
 
 
 //---- LIGHT INIT -------------------
 SetLight3DFlicker("parrafinlight_light1",
 0.73,0.63,0.48,0.5,
 3.8,
 0.4, 0.8, "", "",
 0.8, 1.6, "","",
 true, 1.5,2);
 
 SetLight3DFlickerActive("parrafinlight_light1",true);
 
 
 //---- LOCAL VAR INIT -------------------
 //For extra help with locker ->See OnUpdate
 CreateLocalVar("lockerhelp", 0);
 CreateLocalVar("lockerlesshelp", 0);
 
 //For end level check ->See OnUpdate
 CreateLocalVar("endlevel", 0);
 
 
 //----TEXT INIT----------------------
 SetGameEntityDescriptionOnceTrans("exitdoordesc","00_01_boat_cabin","ExitDoorDesc");
 SetGameEntityDescriptionOnceTrans("mapdesc","00_01_boat_cabin","MapDesc");
 SetGameEntityDescriptionOnceTrans("beddesc","00_01_boat_cabin","BedDesc");
 SetGameEntityDescriptionOnceTrans("coffin1","00_01_boat_cabin","Coffin01Desc");
 SetGameEntityDescriptionOnceTrans("smalltabledesc","00_01_boat_cabin","SmallTableDesc");
 SetGameEntityDescriptionOnceTrans("windowdesc1","00_01_boat_cabin","Window01Desc");
 SetGameEntityDescriptionOnceTrans("windowdesc2","00_01_boat_cabin","Window02Desc");
 SetGameEntityDescriptionOnceTrans("whiskeybottle1","00_01_boat_cabin","WhiskeyBottle01Desc");
 SetGameEntityDescriptionOnceTrans("locker1", "00_01_boat_cabin", "Locker01");
 SetGameEntityDescriptionOnceTrans("descwife", "00_01_boat_cabin", "DescPicture");
 SetGameEntityDescriptionOnceTrans("descpinup", "00_01_boat_cabin", "DescPoster");
 
 
 //---- TIMER INIT --------------------
 //For boat horn event
 CreateTimer("Horn1", 5.5, "HornEvent01",false);
 
 if(bIntro)
 {
 //For fade from black at start
 CreateTimer("Fade1", 0.5, "FadeEffect01",false);
 //For wide screen end and view movement
 CreateTimer("Intro1", 2, "IntroEffect01",false);
 CreateTimer("Intro2", 6, "IntroEffect02",false);
 }
 
 //---- PLAYER INIT --------------------
 GiveItem("padlock_key","item_key01.ent",-1);
 }
 
 
 /////////////////////////////////////////////////////
 /*This function is run everytime the map is loaded */
 void OnLoad()
 {
 //SetDepthOfFieldActive(true,0);
 //SetupDepthOfField(0.3,2.1,15.2);
 
 SetAmbientColor(0.25,0.25,0.3);
 
 SetSkyboxActive(true);
 SetSkyboxColor(0.5,0.5,1,1);
 
 //---- GRAVITY/WAVE EFFECT --------------------
 SetWaveGravityActive(true);
 SetupWaveGravity(6, //Max angle
 8.0f, //Time for each wave
 9.8, //Gravity size
 "x" //Axis of wave.
 );
 }
 
 
 ///////////////////////////////////////
 /*This function is run 60 times a sec*/
 void OnUpdate()
 {
 //ADD TIMER FOR HELP MESSAGE TO OPEN LOCKER, SEE -> CALLBACKS
 if(HasItem("flashlight") == true && HasItem("notebook")== true
 && GetLocalVar("lockerhelp") == 0)
 {
 CreateTimer("LockerTimer1", 0.5f, "LockerHelp01",false);
 
 SetLocalVar("lockerhelp", 1);
 }
 
 //ADD TIMER TO FINSH LEVEL WHEN PLAYER HAS ALL ITEMS, SEE -> CALLBACKS
 if(HasItem("flashlight") == true && HasItem("notebook") == true &&
 HasItem("glowstick") == true && GetLocalVar("endlevel") == 0)
 {
 CreateTimer("EndLevelTimer1", 6.5f, "EndLevel01",false);
 
 SetLocalVar("endlevel", 1);
 }
 }
 
 
 /////////////////////////////////////////////////////
 /*This function is run everytime the map is unloaded */
 void OnExit()
 {
 SetWaveGravityActive(false);
 StopGameMusic(0.5,0);
 }
Do you see anything wrong in code ?
			
				
(This post was last modified: 09-19-2015, 07:43 PM by eroniss55.)
 |  |