Frictional Games Forum (read-only)

Full Version: Errors on my errors?!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
15,14 ERR: Expected "("

Still have an OnStart error also.

CURRENT CODE:

Code:
void OnStart()
{
        AddEntityCollideCallback("Player", "attic_sound_scare1", "OnStart", true, 1);
        AddEntityCollideCallback("Player", "mainatticscare", "OnPickup", true, 1);
        SetEntityPlayerInteractCallback("note_attic_desk", "OnTake", true);
}
void OnStart(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "amb_idle_whimp.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "insanity_baby_cry.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "door_level_cistern_close.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "general_thunder.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "break_stairs.snt", "attic_sound_scare1", 0.0f, true);
}
void OnPickup[b](string &in asEntity)[/b]
{
        [b]SetEntityActive("mainatticscare");[/b]
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor1", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor1", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor2", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor2", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor3", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor3", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor4", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor4", false);
        PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
        GiveSanityDamage(20, true);
        AddPlayerBodyForce(-40000, 25000, 0, false);
        FadePlayerRollTo(75, 3, 2);
        StartPlayerLookAt("level_celler_1", 2, 2, "");
        SetPlayerCrouching(true);
        AddTimer("", 2, "Timer1");
        AddTimer("", 10, "Timer2");
        GivePlayerDamage(10, "BloodSplat", false, false);
        SetLanternDisabled(true);
        PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
        FadeRadialBlurTo(1, 0.5);
}
void Timer1(string &in asTimer)
{
    StartPlayerLookAt("level_celler_1", 0.4, 0.4, "");
    FadePlayerRollTo(-75, 3, 2);
    AddTimer("", 2, "Timer3");
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);

}
void Timer3(string &in asTimer)
{
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
    StartPlayerLookAt("level_celler_1", 0.7, 0.7, "");
    FadePlayerRollTo(0, 0, 0);
    AddTimer("", 2, "Timer5");
    FadeRadialBlurTo(0, 1);
}
void Timer5(string &in asTimer)
{
    PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
void Timer2(string &in asTimer)
{
    SetPlayerCrouching(false);
    StopPlayerLookAt();
    SetLanternDisabled(false);
}
void OnLeave ()
{
}

Anyone got a solution?
Well before I just fixed select parts of your script. This should be the fix for the whole thing.

Code:
void OnStart()
{
        AddEntityCollideCallback("Player", "attic_sound_scare1", "OnBegin", true, 1);
        AddEntityCollideCallback("Player", "mainatticscare", "OnPickup", true, 1);
        SetEntityPlayerInteractCallback("note_attic_desk", "OnTake", true);
}
void OnBegin(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "amb_idle_whimp.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "insanity_baby_cry.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "door_level_cistern_close.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "general_thunder.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "break_stairs.snt", "attic_sound_scare1", 0.0f, true);
}
void OnPickup(string &in asEntity)
{
        SetEntityActive("mainatticscare");
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor1", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor1", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor2", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor2", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor3", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor3", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor4", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor4", false);
        PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
        GiveSanityDamage(20, true);
        AddPlayerBodyForce(-40000, 25000, 0, false);
        FadePlayerRollTo(75, 3, 2);
        StartPlayerLookAt("level_celler_1", 2, 2, "");
        SetPlayerCrouching(true);
        AddTimer("", 2, "Timer1");
        AddTimer("", 10, "Timer2");
        GivePlayerDamage(10, "BloodSplat", false, false);
        SetLanternDisabled(true);
        PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
        FadeRadialBlurTo(1, 0.5);
}
void Timer1(string &in asTimer)
{
    StartPlayerLookAt("level_celler_1", 0.4, 0.4, "");
    FadePlayerRollTo(-75, 3, 2);
    AddTimer("", 2, "Timer3");
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);

}
void Timer3(string &in asTimer)
{
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
    StartPlayerLookAt("level_celler_1", 0.7, 0.7, "");
    FadePlayerRollTo(0, 0, 0);
    AddTimer("", 2, "Timer5");
    FadeRadialBlurTo(0, 1);
}
void Timer5(string &in asTimer)
{
    PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
void Timer2(string &in asTimer)
{
    SetPlayerCrouching(false);
    StopPlayerLookAt();
    SetLanternDisabled(false);
}
void OnLeave ()
{
}
I copy and pasted this exact code in:
Code:
void OnStart()
{
        AddEntityCollideCallback("Player", "attic_sound_scare1", "OnBegin", true, 1);
        AddEntityCollideCallback("Player", "mainatticscare", "OnPickup", true, 1);
        SetEntityPlayerInteractCallback("note_attic_desk", "OnTake", true);
}
void OnBegin(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "amb_idle_whimp.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "insanity_baby_cry.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "door_level_cistern_close.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "general_thunder.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "break_stairs.snt", "attic_sound_scare1", 0.0f, true);
}
void OnPickup(string &in asEntity)
{
        SetEntityActive("mainatticscare" bool abActive);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor1", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor1", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor2", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor2", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor3", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor3", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor4", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor4", false);
        PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
        GiveSanityDamage(20, true);
        AddPlayerBodyForce(-40000, 25000, 0, false);
        FadePlayerRollTo(75, 3, 2);
        StartPlayerLookAt("level_celler_1", 2, 2, "");
        SetPlayerCrouching(true);
        AddTimer("", 2, "Timer1");
        AddTimer("", 10, "Timer2");
        GivePlayerDamage(10, "BloodSplat", false, false);
        SetLanternDisabled(true);
        PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
        FadeRadialBlurTo(1, 0.5);
}
void Timer1(string &in asTimer)
{
    StartPlayerLookAt("level_celler_1", 0.4, 0.4, "");
    FadePlayerRollTo(-75, 3, 2);
    AddTimer("", 2, "Timer3");
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);

}
void Timer3(string &in asTimer)
{
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
    StartPlayerLookAt("level_celler_1", 0.7, 0.7, "");
    FadePlayerRollTo(0, 0, 0);
    AddTimer("", 2, "Timer5");
    FadeRadialBlurTo(0, 1);
}
void Timer5(string &in asTimer)
{
    PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
void Timer2(string &in asTimer)
{
    SetPlayerCrouching(false);
    StopPlayerLookAt();
    SetLanternDisabled(false);
}
void OnLeave ()
{
}

And Still have the OnStart error, and an "Expected , or ; ERR" On line 17
Your line 17 error is here:

Code:
void OnStart()
{
        AddEntityCollideCallback("Player", "attic_sound_scare1", "OnBegin", true, 1);
        AddEntityCollideCallback("Player", "mainatticscare", "OnPickup", true, 1);
        SetEntityPlayerInteractCallback("note_attic_desk", "OnTake", true);
}
void OnBegin(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "amb_idle_whimp.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "insanity_baby_cry.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "door_level_cistern_close.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "general_thunder.snt", "attic_sound_scare1", 0.0f, true);
        PlaySoundAtEntity("", "break_stairs.snt", "attic_sound_scare1", 0.0f, true);
}
void OnPickup(string &in asEntity)
{
        [b]SetEntityActive("mainatticscare", bool abActive);[/b]
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor1", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor1", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor2", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor2", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor3", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor3", false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor4", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor4", false);
        PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
        GiveSanityDamage(20, true);
        AddPlayerBodyForce(-40000, 25000, 0, false);
        FadePlayerRollTo(75, 3, 2);
        StartPlayerLookAt("level_celler_1", 2, 2, "");
        SetPlayerCrouching(true);
        AddTimer("", 2, "Timer1");
        AddTimer("", 10, "Timer2");
        GivePlayerDamage(10, "BloodSplat", false, false);
        SetLanternDisabled(true);
        PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
        FadeRadialBlurTo(1, 0.5);
}
void Timer1(string &in asTimer)
{
    StartPlayerLookAt("level_celler_1", 0.4, 0.4, "");
    FadePlayerRollTo(-75, 3, 2);
    AddTimer("", 2, "Timer3");
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);

}
void Timer3(string &in asTimer)
{
    PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
    StartPlayerLookAt("level_celler_1", 0.7, 0.7, "");
    FadePlayerRollTo(0, 0, 0);
    AddTimer("", 2, "Timer5");
    FadeRadialBlurTo(0, 1);
}
void Timer5(string &in asTimer)
{
    PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
void Timer2(string &in asTimer)
{
    SetPlayerCrouching(false);
    StopPlayerLookAt();
    SetLanternDisabled(false);
}
void OnLeave ()
{
}

You forgot the comma. Smile
Bah! Blasted commas. So small and easy to miss.
An error inside an error? Errception.

Line 17:
SetEntityActive("mainatticscare" bool abActive); <----- missing a comma

SetEntityActive("mainatticscare", bool abActive);

See if that solves it.
(08-17-2011, 11:44 PM)Acies Wrote: [ -> ]An error inside an error? Errception.

Line 17:
SetEntityActive("mainatticscare" bool abActive); <----- missing a comma

SetEntityActive("mainatticscare", bool abActive);

See if that solves it.

I beat you, already adressed that. Big Grin

ARGHHHHBqa]v[geihjw]e-hj]pHJbgnw!!!!!!!!!!!!!

Still no worky. Here are the NEW ERRORS Big Grin
[Image: awdawdj.png]
usually when you get an OnStart() error, it is a bit misleading. You should solve your other error before even thinking about the OnStart error, as this will probably fix itself when you fix the other problem.

"expected , or ;" means exactly what it says. It expected a comma, but never found one. take another look at line 17. you have forgot to put a comma between the name, and the bool value. - ( which should be either true or false btw)

SetEntityActive("mainatticscare" , true); // this sets "mainatticscare" active

SetEntityActive("mainatticscare" , false); // this sets "mainatticscare" inactive

edit: i was pretty late Tongue but "expected expression value" means it expected a value. you just put "bool abActive" which is not a bool value. bool is either true or false Smile


(08-17-2011, 11:48 PM)JenniferOrange Wrote: [ -> ]I beat you, already adressed that. Big Grin

(08-17-2011, 11:51 PM)DRedshot Wrote: [ -> ]SetEntityActive("mainatticscare" , true); // this sets "mainatticscare" active

SetEntityActive("mainatticscare" , false); // this sets "mainatticscare" inactive

Nobody gets the cake Tongue
Pages: 1 2 3