Frictional Games Forum (read-only)
Errors on my errors?! - 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: Errors on my errors?! (/thread-9831.html)

Pages: 1 2 3


Errors on my errors?! - JetlinerX - 08-17-2011

Anyone know what I did wrong? Heres the errors:
[Image: dwadwadawd.png]

And heres the script:

Code:
void OnStart()
{
        AddEntityCollideCallback("Player", "attic_sound_scare1", "OnStart", true, 1);
        SetEntityPlayerInteractCallback("note_attic_desk", "OnPickup", true);
        AddEntityCollideCallback("Player", "mainatticscare", "OnPickup", true, 1);
}
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(string &in parent, string &in child, int state)
{
     if (parent == "Player" && child == "note_attic_desk")
     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 ()
{
}



RE: Errors on my errors?! - Your Computer - 08-17-2011

I think it would be easier for the both of us in helping you understand the error itself. When it says "no matching signatures to <function here>" it means it couldn't find that exact function, neither in your script nor from the game itself. This is often due to a misspelling of the function name or not filling in all the required parameters to the targeted function. Parameters are those you pass into the function (what goes inside the parentheses).

I should also note, it is often better if you read the error message from bottom to top. In this case, what is wrong with SetEntityActive() in your script? Is there anything missing from it? Wink


RE: Errors on my errors?! - JetlinerX - 08-17-2011

Eh... I am not sure, as I have said before, I am still decently new to scripts. Sooo... I am honestly not sure whats wrong?


RE: Errors on my errors?! - Your Computer - 08-17-2011

(08-17-2011, 09:46 PM)JetlinerX Wrote: Eh... I am not sure, as I have said before, I am still decently new to scripts. Sooo... I am honestly not sure whats wrong?

Can you tell me the difference between the one in your script and the one here: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#entities ?


RE: Errors on my errors?! - JetlinerX - 08-17-2011

The "bool abActive);"?


RE: Errors on my errors?! - Your Computer - 08-17-2011

(08-17-2011, 09:58 PM)JetlinerX Wrote: The "bool abActive);"?

Correct. Big Grin


RE: Errors on my errors?! - JetlinerX - 08-17-2011

YAY! Now what about the OnStart error?! Big Grin


RE: Errors on my errors?! - Obliviator27 - 08-17-2011

Rename your second function.


RE: Errors on my errors?! - JetlinerX - 08-17-2011

Also, its saying that there was an "Expected ( on line 19" Eh?
Still didnt fix the OnStart error by changing the name.


RE: Errors on my errors?! - Obliviator27 - 08-17-2011

(08-17-2011, 10:11 PM)JetlinerX Wrote: Also, its saying that there was an "Expected ( on line 19" Eh?

Code:
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);
}
As you didn't have an else statement, I removed the if statement entirely, though perhaps you'll need it for a later use. Also, your syntax for AddEntityPlayerInteractCallback was incorrect.