meneadeszz
Junior Member
Posts: 20
Threads: 9
Joined: Apr 2012
Reputation:
0
|
Error While adding music to area Please HELP
Helllow
I'm Starting to make a Custom Story and I already got a couple of scripts in my HPS file.
But i realy want to add some music to a certain area.
I watched a couple of tutorials and every one was the same so i copied everything what the scripter of the video did.
I got everything the same as him.But when i start my custom story i get this error
I update the script a little here it is..
void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i< 10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
PlaySoundAtEntity("", "break_glass_bottle.snt", "Player", 0, false);
SetPlayerActive(false);
SetPlayerCrouching(true);
FadeOut(0);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
AddEntityCollideCallback("player", "musci_1", "StartMusic", "true", 1);
AddEntityCollideCallback("Player", "FlyingJesus_1", "HolyJesus", true, 1);
AddEntityCollideCallback("Jesus_1", "FlyingJesus_1", "Sound", true, 1);
AddUseItemCallback("", "crowbar_1", "mansion_1", "UsedCrowbarOnDoor", true);
AddCombineCallback("Player", "Music1", "StartMusic", "true", "0)";
}
void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic(01_paper_self, "true", "5", "0", "0", "true");
}
void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
BUT NOW I GET THIS ERROR
|
|
04-17-2012, 04:09 PM |
|
Greven
Member
Posts: 106
Threads: 13
Joined: May 2011
Reputation:
3
|
RE: Error While adding music to area Please HELP
Try putting 01_paper_self in quotation marks like this:
PlayMusic("01_paper_self", true, 5, 0, 0, true);
Also at AddCombineCallback("Player", "Music1", "StartMusic", "true", "0)";
Remove the marks at the 0 like this:
AddCombineCallback("Player", "Music1", "StartMusic", "true", 0);
[WIP] Recidivus
(This post was last modified: 04-17-2012, 04:16 PM by Greven.)
|
|
04-17-2012, 04:12 PM |
|
meneadeszz
Junior Member
Posts: 20
Threads: 9
Joined: Apr 2012
Reputation:
0
|
RE: Error While adding music to area Please HELP
(04-17-2012, 04:12 PM)Greven Wrote: Try putting 01_paper_self in quotation marks like this:
PlayMusic("01_paper_self", true, 5, 0, 0, true);
Also at AddCombineCallback("Player", "Music1", "StartMusic", "true", "0)";
Remove the marks at the 0 like this:
AddCombineCallback("Player", "Music1", "StartMusic", "true", 0); Thanks for helping me i think it work because i don't get the error about the lines.
Butt there is one problem now
I get an error which says unexpected end of line this is the ending of my script at line 126
void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
FadeOut(4);
}
else if (x == "T2")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
StartPlayerLookAt("Intro1", 2, 2, "");
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("Intro2, 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
StopPlayerLookAt();
}
}
////////////////////////////
// This runs when the player enters the map
void OnEnter()
{
}
////////////////////////////
// This runs when the player leaves the map
void OnLeave()
{
} THIS IS LINE 119 I GET THE ERRO FOR LINE 126
(This post was last modified: 04-17-2012, 04:25 PM by meneadeszz.)
|
|
04-17-2012, 04:24 PM |
|
Greven
Member
Posts: 106
Threads: 13
Joined: May 2011
Reputation:
3
|
RE: Error While adding music to area Please HELP
Just because it says the error is on line 119 doesnt mean the Actual error is there. Basicly what it says right now is that a function is not properly closed. Can you give the whole script so I can see if anything is missing?
[WIP] Recidivus
(This post was last modified: 04-17-2012, 06:17 PM by Greven.)
|
|
04-17-2012, 06:16 PM |
|
meneadeszz
Junior Member
Posts: 20
Threads: 9
Joined: Apr 2012
Reputation:
0
|
RE: Error While adding music to area Please HELP
.posted a new reply below
(This post was last modified: 04-17-2012, 08:05 PM by meneadeszz.)
|
|
04-17-2012, 06:21 PM |
|
Greven
Member
Posts: 106
Threads: 13
Joined: May 2011
Reputation:
3
|
RE: Error While adding music to area Please HELP
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("Intro2, 2, 2, "");
}
StartPlayerLookAt("Intro2", 2, 2, "");
also remove this from the script
void HolyJesus(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus_1", true);
AddPropForce("Jesus_1", 0, 0, -30000, "World");
}
void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false);
Everybody hates them....
[WIP] Recidivus
|
|
04-17-2012, 07:47 PM |
|
meneadeszz
Junior Member
Posts: 20
Threads: 9
Joined: Apr 2012
Reputation:
0
|
RE: Error While adding music to area Please HELP
(04-17-2012, 07:47 PM)Greven Wrote: else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("Intro2, 2, 2, "");
}
StartPlayerLookAt("Intro2", 2, 2, "");
also remove this from the script
void HolyJesus(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus_1", true);
AddPropForce("Jesus_1", 0, 0, -30000, "World");
}
void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false);
Everybody hates them.... i alread deleted it but i don't know if people also hate this but.
i want a cabinet wheich contains oil and after u pick up example oil_1 the just spawn a pedobear or something random
One more question..
I would like to add music or a sound to a note when the player picks it up
this is what i sue right now,
SetEntityPlayerLookAtCallback("Letter_One", "letter1music", true);
}
void Letter_One(string &in Entity )
{
PlaySoundAtEntity("letter1music", "05_event_door_bang.ogg", "letter1music", 0, false);
}
i'ts not working could somebody help me
(This post was last modified: 04-17-2012, 08:57 PM by meneadeszz.)
|
|
04-17-2012, 08:00 PM |
|
|