Frictional Games Forum (read-only)
[SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! (/thread-12537.html)

Pages: 1 2


[SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - heyitsrobert97 - 01-11-2012

This is My third time i've edited my script file and every time i add something an error occurs then i add the script here and someone says there is a bracket or line missing and fixes it so can you help me again?\

void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 0);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f;
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
}

void StartEffectEmotionFlash("basementdoortext","dooropen","00_laugh.snt")
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}

/////////////////////////////

The Music area and basement door smash worked together but now i added a corpse that dissapears and a scary noise plus a Emotion flash and now it say at the very eng after the /// unexpected end of file i think i did the english.lang right?

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
Your Name is Robert,You are Inside This strange House that you entered after hearing screams from inside. You walked into the basement but a gush of wind slammed the door shut and blew out every light except one you must try and escape!
</Entry>
</CATEGORY>
</LANGUAGE>
<CATEGORY Name="basementdoortext">
<Entry Name ="dooropen">
This Place Is Creepy I Need to get Out! Oh No where did all this water come from?
</Entry>
</CATEGORY>
</LANGUAGE>



Every one who helps here will get thir username in the credits for scriptingSmile


RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - Tripication - 01-11-2012

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f);
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
}

Missed the bracket in ("basementcorpse:, 0.0f;

Also, the </LANGUAGE> Is at the VERY END OF THE FILE. it means, stop using this file pretty much, like html. but you only need one </LANGUAGE>, and that is at the end.

Use This one below instead.


<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
Your Name is Robert,You are Inside This strange House that you entered after hearing screams from inside. You walked into the basement but a gush of wind slammed the door shut and blew out every light except one you must try and escape!
</Entry>
</CATEGORY>
<CATEGORY Name="basementdoortext">
<Entry Name ="dooropen">
This Place Is Creepy I Need to get Out! Oh No where did all this water come from?
</Entry>
</CATEGORY>
</LANGUAGE>





EDIT
I missed one more thing.
With <Entry Name ="dooropen"> remove the Space between the "Name" and the "=" so you have this

<Entry Name="dooropen">


RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - flamez3 - 01-11-2012



void StartEffectEmotionFlash("basementdoortext","dooropen","00_laugh.snt")
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}

You haven't used a callback for that; and you are using strings in syntax's. When do you want the StartEffectMotionFlash to happen?


RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - Tripication - 01-11-2012

(01-11-2012, 01:51 PM)flamez3 Wrote: void StartEffectEmotionFlash("basementdoortext","dooropen","00_laugh.snt")
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}

You haven't used a callback for that; and you are using strings in syntax's. When do you want the StartEffectMotionFlash to happen?
I completely missed that part.

Also, even if it is wrong, you should get into the habit of putting spaces after your commas. so rather than
("basementdoortext","dooropen","00_laugh.snt")

Use
("basementdoortext", "dooropen", "00_laugh.snt")

But dont actually use that, its wrong, so for now your script should be like this

void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 0);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f);
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
}


RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - heyitsrobert97 - 01-11-2012

(01-11-2012, 01:51 PM)flamez3 Wrote: void StartEffectEmotionFlash("basementdoortext","dooropen","00_laugh.snt")
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}

You haven't used a callback for that; and you are using strings in syntax's. When do you want the StartEffectMotionFlash to happen?
I want the Emotion flash and sound to play when i enter the basementdoorsmash area .
then i want it so water fills that room to your knees. What code could you use to enable a liquid area when you walk into the "basementdoorsmash" script area i'll call the liquid area "basementwater" .

Sorry But it didnt work It came up with an error in the .hps file

(21,30) : ERR : Expected data type

void StartEffectEmotionFlash("basementdoortext", "dooropen", "00_laugh.snt")
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}

/////////////////////////////
on void StartEffectEmotionFlash at the (" part ?



RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - Tripication - 01-11-2012

This is how it should look

void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 0);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f);
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
StartEffectEmotionFlash("basementdoortext", "dooropen", "00_laugh.snt")
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
SetEntityActive("basementwater", true);
}



The two in red will probably conflict and it will probably play ONLY whatever the top one is...What is the top one anyway


RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - flamez3 - 01-11-2012

Use this script:


Quote:void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 0);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f;
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
StartEffectEmotionFlash("basementdoortext","dooropen","00_laugh.snt")
}
As for the liquid coming to your knees. Unfortunately there is not easy way of doing it. BUT, Statyk made a awesome tutorial on how to do : http://www.frictionalgames.com/forum/thread-11294.html?highlight=rising+water
(01-11-2012, 02:23 PM)Tripication Wrote: This is how it should look

void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 0);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f);
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
StartEffectEmotionFlash("basementdoortext", "dooropen", "00_laugh.snt")
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
SetEntityActive("basementwater", true);
}



The two in red will probably conflict and it will probably play ONLY whatever the top one is...What is the top one anyway
Two noises will always play; they won't conflict.




RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - Tripication - 01-11-2012

Actually, your probably better off listening to flames3

He has more experience with this kinda stuff.

So DO Use his script


RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - heyitsrobert97 - 01-11-2012

(01-11-2012, 02:23 PM)Tripication Wrote: void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 0);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f);
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
StartEffectEmotionFlash("basementdoortext", "dooropen", "00_laugh.snt")
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
SetEntityActive("basementwater", true);
}



The two in red will probably conflict and it will probably play ONLY whatever the top one is...What is the top one anyway
the basementcorpse is a body standing in front of the door and should disappear when you enter the doorsmash area then the door will smash play teh scary_human_noises.snt then the text should show up and the sound play so that it should go
Walk into door script area
Corpse disappears,and door breaks
Noises play and text shows at the same time
then Water fills room





RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE! - Tripication - 01-11-2012

(01-11-2012, 02:28 PM)heyitsrobert97 Wrote:
(01-11-2012, 02:23 PM)Tripication Wrote: void OnStart()

{
AddEntityCollideCallback("Player", "musicareabasement", "MusicPlay", true, 0);
AddEntityCollideCallback("Player", "basementdoorsmash", "func_slam", true, 1);

}

void MusicPlay(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Music_01.ogg" , true , 10 , 2.0f , 0 , true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("basementdoor", 0.0f);
SetPropHealth("basementcorpse:, 0.0f);
PlaySoundAtEntity("", "scare_human_noises.snt", "Player", 0, false);
StartEffectEmotionFlash("basementdoortext", "dooropen", "00_laugh.snt")
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
SetEntityActive("basementwater", true);
}



The two in red will probably conflict and it will probably play ONLY whatever the top one is...What is the top one anyway
the basementcorpse is a body standing in front of the door and should disappear when you enter the doorsmash area then the door will smash play teh scary_human_noises.snt then the text should show up and the sound play so that it should go
Walk into door script area
Corpse disappears,and door breaks
Noises play and text shows at the same time
then Water fills room

Previous post, listen to Flames3, im just too tired and too lost in this thread and i'm still new to modding.

Good luck with the rest of the mod tho