JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
Errors on my errors?!
Anyone know what I did wrong? Heres the errors:
And heres the script:
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 ()
{
}
|
|
08-17-2011, 09:22 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Errors on my errors?!
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?
|
|
08-17-2011, 09:43 PM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Errors on my errors?!
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?
|
|
08-17-2011, 09:46 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Errors on my errors?!
(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/amn...s#entities ?
|
|
08-17-2011, 09:50 PM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Errors on my errors?!
The "bool abActive);"?
|
|
08-17-2011, 09:58 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Errors on my errors?!
(08-17-2011, 09:58 PM)JetlinerX Wrote: The "bool abActive);"?
Correct.
|
|
08-17-2011, 10:00 PM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Errors on my errors?!
YAY! Now what about the OnStart error?!
|
|
08-17-2011, 10:06 PM |
|
Obliviator27
Posting Freak
Posts: 792
Threads: 10
Joined: Jul 2011
Reputation:
66
|
RE: Errors on my errors?!
Rename your second function.
|
|
08-17-2011, 10:10 PM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Errors on my errors?!
Also, its saying that there was an "Expected ( on line 19" Eh?
Still didnt fix the OnStart error by changing the name.
(This post was last modified: 08-17-2011, 10:19 PM by JetlinerX.)
|
|
08-17-2011, 10:11 PM |
|
Obliviator27
Posting Freak
Posts: 792
Threads: 10
Joined: Jul 2011
Reputation:
66
|
RE: Errors on my errors?!
(08-17-2011, 10:11 PM)JetlinerX Wrote: Also, its saying that there was an "Expected ( on line 19" Eh?
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.
|
|
08-17-2011, 10:21 PM |
|
|