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


Thread Rating:
  • 6 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script causing game to randomly crash (No FATAL ERROR)
RawkBandMan Offline
Posting Freak

Posts: 1,146
Threads: 35
Joined: Nov 2010
Reputation: 5
#98
RE: extra_english no longer working, once again!!!

(08-24-2011, 07:39 PM)graykin Wrote: You have to close off your <Entry Name="Description" in the beginning. It should be:

<Entry Name="Description">

Well, the description is working, but when I enter the game, it crashes and says
(83,1) Unexpected end of file
Or something like that...

.hps
Spoiler below!

void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
SetPlayerLampOil(100);
}
AddUseItemCallback("", "key_torture_chamber_1", "cells_door_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_study_1", "cellar_wood01_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_study_2", "level_celler_1", "UseKey", true);
AddEntityCollideCallback("Player", "key_study_2", "GruntCells", true, 1);
AddEntityCollideCallback("servant_grunt_1", "monstergone_area", "MonsterGone", true, 1);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 3.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0.5f, "");
AddEntityCollideCallback("Player", "GruntWalkBy", "ActivateGrunt", false, 1);
wakeUp();
}

void wakeUp () {
StartPlayerLookAt("servant_grunt_1", 11.0f, 11.0f, "");
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(10); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 16.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
StopPlayerLookAt();
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cells_door_1", false, true) ;
PlaySoundAtEntity("", "unlock_door", "cells_door_1", 0, false);
RemoveItem("key_torture_chamber_1");
}


void MonsterGone(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_grunt_1", false);
}

void GruntCells(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_3", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_7", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_8", 5.0f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_11", 2.0f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_12", 0.5f, "");
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_1", 0, false);
RemoveItem("key_study_1");
}

void UseKey(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_celler_1, false);
PlaySoundAtEntity("", "unlock_door", "level_celler_1", 0, false);
RemoveItem("key_study_2");
}


I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
08-24-2011, 08:34 PM
Find


Messages In This Thread
RE: Where can I find water? - by Greven - 05-08-2011, 05:19 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 05:44 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 08:33 PM
RE: Where can I find water? - by Greven - 05-08-2011, 09:22 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:28 PM
RE: Where can I find water? - by Greven - 05-08-2011, 09:32 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:33 PM
RE: Where can I find water? - by Greven - 05-08-2011, 09:38 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:46 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 09:50 PM
RE: Where can I find water? - by Roenlond - 05-08-2011, 08:31 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 09:18 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:59 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 10:27 PM
RE: Where can I find water? - by Karai16 - 05-08-2011, 11:22 PM
RE: Where can I find water? - by RawkBandMan - 05-09-2011, 12:01 AM
RE: extra_english no longer working, once again!!! - by RawkBandMan - 08-24-2011, 08:34 PM



Users browsing this thread: 1 Guest(s)