Frictional Games Forum (read-only)
Script Error - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Script Error (/thread-8641.html)



Script Error - Rouvis - 06-16-2011

Everytime i start my Map i get this message "FATAL ERROR: Could not load script file 'custom_stories/myfirst/custom_stories/myfirst/maps/Basement.hps'!
main (15,1 : ERR : Expected ',' or ';'


This is my Script. http://www.mediafire.com/?dimnlm15ztb761t

Please tell me what i did wrong. =) I am a noob at Scripting Tongue


RE: Script Error - Roenlond - 06-16-2011

Spoiler below!

////////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("12_amb.ogg", true, 100.0, 0.0, 1, true);
AddEntityCollideCallback("Player", "AreaBangDoor", "CollideBangDoor", true, 1); //Begin the door bang and pain event
}

////////////////////////////
// Run when entering map
void OnEnter()
{
}
//////////////////////////////
//BEGIN BANG AND PAIN SOUNDS//
void CollideBangDoor(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("bangs", "05_event_door_bang", "scare_door_1", 1, false);
PlaySoundAtEntity("whineaa", "scare_whine_loop", "Player", 0.5f, false);

FadeSepiaColorTo(0.75f, 0.3f);
FadeImageTrailTo(1.5, 0.5);

AddTimer("bang1", 0.6f, "TimerBangDoor");
AddTimer("bang2", 1.6f, "TimerBangDoor");
AddTimer("bang3", 2.5f, "TimerBangDoor");
AddTimer("bang4", 3.0f, "TimerBangDoor");
}
void TimerBangDoor(string &in asTimer)
{
if(asTimer == "bang1"){
AddPropImpulse("scare_door_1", 0, 0, 5, "World");
PlaySoundAtEntity("scare", "react_scare", "Player", 0.25f, false);
CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "scare_door_1", false);
StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
GiveSanityDamage(10, true);
}
else if(asTimer == "bang2") {
AddPropImpulse("scare_door_1", 0, 0, 5, "World");
CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "scare_door_1", false);
StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
}
else if(asTimer == "bang3") {
AddPropImpulse("scare_door_1", 0, 0, 5, "World");
PlaySoundAtEntity("scare", "react_breath", "Player", 0.5f, false);
CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "scare_door_1", false);
StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
}
else {
SetSwingDoorLocked("scare_door_1", false, false);
FadeSepiaColorTo(0, 0.3f);
FadeImageTrailTo(0, 0.1);
StopSound("whineaa", 4);
}
}
//END BANG AND PAIN SOUNDS//
////////////////////////////

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


You missed { } after void OnEnter(). By the way, just use [spoiler]a spoiler to post your code rather than uploading it.[/spoiler*]. Delete the * for it to work.


RE: Script Error - Rouvis - 06-16-2011

Finally it works! Thank you very much! =))))