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] ANOTHER ERROR UNEXPECTED END OF FILE!
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#1
[SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

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

This Darn House! , Four Doors, Youtube
(This post was last modified: 01-11-2012, 01:27 PM by heyitsrobert97.)
01-11-2012, 01:26 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#2
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

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">

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-11-2012, 01:39 PM by Tripication.)
01-11-2012, 01:29 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!



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?

01-11-2012, 01:51 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#4
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

(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);
}

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-11-2012, 02:04 PM by Tripication.)
01-11-2012, 01:56 PM
Find
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#5
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

(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 ?

This Darn House! , Four Doors, Youtube
(This post was last modified: 01-11-2012, 02:19 PM by heyitsrobert97.)
01-11-2012, 02:15 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#6
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

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

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-11-2012, 02:25 PM by Tripication.)
01-11-2012, 02:23 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#7
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

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/thr...sing+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.


(This post was last modified: 01-11-2012, 02:25 PM by flamez3.)
01-11-2012, 02:23 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#8
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

Actually, your probably better off listening to flames3

He has more experience with this kinda stuff.

So DO Use his script

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-11-2012, 02:32 PM by Tripication.)
01-11-2012, 02:27 PM
Find
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#9
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

(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



This Darn House! , Four Doors, Youtube
01-11-2012, 02:28 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#10
RE: [SCRIPT] ANOTHER ERROR UNEXPECTED END OF FILE!

(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

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-11-2012, 02:35 PM by Tripication.)
01-11-2012, 02:34 PM
Find




Users browsing this thread: 1 Guest(s)