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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script problems
justin Offline
Junior Member

Posts: 2
Threads: 1
Joined: Nov 2012
Reputation: 0
#1
Script problems

Hello, (first im german,so my english is very bad Tongue)
I maked a custom story, but if I start it, there appears a message:
FATAL ERROR :Could not load script file "custom_stories/Die Flucht/maps/Die Flucht.hps"!
main (98.2): ERR :Unexpected end of file.... Huh
thats my hps file: The error is in the last line after the } pls help .thanks Big Grin
void OnStart()
{
AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "event", "event1", true, 1);
SetEntityCallbackFunc("schraube", "OnPickup");
AddEntityCollideCallback("Player", "infa", "startinf", true, 1);
AddEntityCollideCallback("inf", "infent", "entinf", true, 1);
AddUseItemCallback("", "key2", "tuer2", "UsedKeyOnDoor2", true);
AddEntityCollideCallback("stuhl,wandbrechen,brech, true, 1);
AddEntityCollideCallback("player", "vatera", "vaterevent", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, false);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false);
RemoveItem("key_tomb_1");
}
void event1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "amb_idle.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPlayerActive(false);
SetMessage("Message", "intro1", 3);
StartPlayerLookAt("abc", 2, 2, "");
AddTimer("", 3.5f, "gerausch");
}
void gerausch(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}
void OnPickup(string &in asEntity, string &in type)
{
SetMessage("Message", "schraubea", 3);
GiveSanityBoostSmall();
}
void startinf(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("inf", "true");
AddEnemyPatrolNode("inf", "PathNodeArea_1", 5, "");
AddEnemyPatrolNode("inf", "PathNodeArea_2", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_3", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_4", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_5", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_6", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_7", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_8", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_9", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_10", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_11", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_12", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_13", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_14", 0.001, "");
AddEnemyPatrolNode("inf", "PathNodeArea_15", 0.001, "");
SetMessage("Message", "versteck", 3);
}
void entinf(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("inf", false);
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
SetMessage("Message", "weg", 2);
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("tuer2", false, false);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false);
RemoveItem("key2");
}
void brech(string &in asParent, string &in asChild, int alState)
{
SetMessage("Message", "geschafft", 3);
PlaySoundAtEntity("", "break_wood_metal.snt", "Player", 0, false);
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
GiveSanityBoostSmall();
SetEntityActive("zu", false);
SetEntityActive("offen", true);
StartScreenShake(0.01,0,0,2.9);
}
void vaterevent(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("vater", 3, 3, "");
AddTimer("", 2.0f, "vaterend");
SetMessage("Message", "vateraa", 3);
}
void vaterend(string &in asTimer)
{
StopPlayerLookAt();
}
Here is the error......
11-26-2012, 03:45 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Script problems

The error "Unexpected end of file" means that somewhere you placed 1 " or ( or { where there actually should be 2 like this: "" or () or {}

I found a line where you forgot them.

Try placing it the right way. Here is the line:
AddEntityCollideCallback("stuhl,wandbrechen,brech, true, 1);



You forgot it at the end of "stuhl" and on both sides of "wandbrechen", and "brech"

Trying is the first step to success.
(This post was last modified: 11-26-2012, 05:44 PM by FlawlessHappiness.)
11-26-2012, 05:44 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Script problems

void OnStart()

{

AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true);

AddEntityCollideCallback("Player", "event", "event1", true, 1);

SetEntityCallbackFunc("schraube", "OnPickup");

AddEntityCollideCallback("Player", "infa", "startinf", true, 1);

AddEntityCollideCallback("inf", "infent", "entinf", true, 1);

AddUseItemCallback("", "key2", "tuer2", "UsedKeyOnDoor2", true);

AddEntityCollideCallback("stuhl,wandbrechen,brech, true, 1);

AddEntityCollideCallback("player", "vatera", "vaterevent", true, 1);

}

You have that without ""'s. It should be (I think so):

AddEntityCollideCallback("stuhl","wandbrechen","brech", true, 1);

Edit: Ninja'd by beecake Big Grin

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 11-26-2012, 05:51 PM by The chaser.)
11-26-2012, 05:51 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Script problems

Again haha Big Grin Sorry

Trying is the first step to success.
11-26-2012, 05:52 PM
Find
justin Offline
Junior Member

Posts: 2
Threads: 1
Joined: Nov 2012
Reputation: 0
#5
RE: Script problems

thanks it works Cool
11-27-2012, 05:18 PM
Find




Users browsing this thread: 3 Guest(s)