Frictional Games Forum (read-only)
if - NoMatchingSignatures - 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: if - NoMatchingSignatures (/thread-17758.html)



if - NoMatchingSignatures - FlawlessHappiness - 08-14-2012

I have an if statement that doesn't want to go as i want it to...

ERR: No matching signatures to 'ChangeCharacterMark()'
INFO: Candidates are:
INFO: void ChangeCharacterMark(string&in)

ERR: No matching signatures to 'ChangeCharacterSimon()'
INFO: Candidates are:
INFO: void ChangeCharacterSimon(string&in)


Here is the if statement:

Spoiler below!


void NextLevelCheck(string &in asEntity)
{
if(asEntity == "AreaSimon")
{
if(GetLocalVarInt("SimonReady") == 1 && GetLocalVarInt("MarkReady") == 1)
{
ChangeCharacterMark();
return;
}
}

if(asEntity == "AreaMark")
{
if(GetLocalVarInt("SimonReady") == 1 && GetLocalVarInt("MarkReady") == 1)
{
ChangeCharacterSimon();
return;
}

}

if(GetLocalVarInt("SimonReady") == 0)
{
SetMessage("Messages", "NotDone", 0);
}

if(GetLocalVarInt("MarkReady") == 0)
{
SetMessage("Messages", "NotDone", 0);
}
}


And here are the 2 scripts:

Spoiler below!


void ChangeCharacterSimon(string &in asEntity)
{
FadeOut(2);
SetPlayerActive(false);
CheckPoint("Simon", "SimonStart", "", "DeathHints", "NormalDeath");
PlaySoundAtEntity("", "insanity_whisper", "Player", 0.5f, false);
FadePlayerFOVMulTo(2, 2.0f);
AddTimer("ChangeCharacterSimonTimer", 2, "ChangeCharacterSimonTimer");
}


void ChangeCharacterMark(string &in asEntity)
{
FadeOut(2);
SetPlayerActive(false);
CheckPoint("Mark", "MarkStart", "", "DeathHints", "NormalDeath");
PlaySoundAtEntity("", "insanity_whisper", "Player", 0.5f, false);
FadePlayerFOVMulTo(2, 2.0f);
AddTimer("ChangeCharacterMarkTimer", 2, "ChangeCharacterMarkTimer");
}


I can't say what i have to do with ChangeCharacterMark(); and ChangeCharacterSimon();
Can anobody help?

EDIT: If i write something inside the () then it says "Expected ("


RE: if - NoMatchingSignatures - Apjjm - 08-14-2012

The clue is in the signatures for each function:

Code:
void ChangeCharacterSimon(string &in asEntity)
void ChangeCharacterMark(string &in asEntity)

As you can see - they are expecting a string parameter (which isn't being used inside the functions currently). The solution is to either change the signatures so they no longer use this parameter, I.e:

Code:
void ChangeCharacterSimon()
{
   //stuff...
}
void ChangeCharacterMark()
{
   //stuff...
}

OR pass a parameter in (in this case i am assuming you want to pass in "asEntity" from the calling function):
Code:
void NextLevelCheck(string &in asEntity)
{
if(asEntity == "AreaSimon")
{
if(GetLocalVarInt("SimonReady") == 1 && GetLocalVarInt("MarkReady") == 1)
{
ChangeCharacterMark(asEntity);
return;
}
}

if(asEntity == "AreaMark")
{
if(GetLocalVarInt("SimonReady") == 1 && GetLocalVarInt("MarkReady") == 1)
{
ChangeCharacterSimon(asEntity);
return;
}

}

if(GetLocalVarInt("SimonReady") == 0)
{
SetMessage("Messages", "NotDone", 0);
}

if(GetLocalVarInt("MarkReady") == 0)
{
SetMessage("Messages", "NotDone", 0);
}
}



RE: if - NoMatchingSignatures - FlawlessHappiness - 08-14-2012

Yes! You are a genius! Thank you... I should have though of doing asEntity instead of string &in... Thank you!