Frictional Games Forum (read-only)
What is this error and where is it? [SOLVED] - 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: What is this error and where is it? [SOLVED] (/thread-24688.html)



What is this error and where is it? [SOLVED] - Radical Batz - 02-23-2014

I did the code right and it gets me an error! just great. well here is the code that i'm using for my map

Code:
void OnStart()
{
    AddUseItemCallback("", "Crowbar", "CrowbarDoor", "UseCrowbarOnDoor", true);
    AddEntityCollideCallback("Joint", "AreaBreak", "BreakDoor", true, 1);    
}

void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
    RemoveItem(asItem);
    PlaySoundAtEntity("", "player_crouch.snt", "Player", 0.05, false);
    AddTimer(asEntity, 0.2, "TimerPlaceCrowbar");

}

void TimerPlaceCrowbar(string &in asTimer)
{
    SetEntityActive("Joint", true);
    PlaySoundAtEntity("", "puzzle_place_jar.snt", "asTimer", 0, false);
}

void BreakDoor("", string &in asChild, int alState)
{
    SetEntityActive("Joint", false);
    SetEntityActive("Broken", true);

    SetSwingDoorLocked("CrowbarDoor", false, false);
    SetSwingDoorClosed("CrowbarDoor", false, false);
    SetSwingDoorDisableAutoClose("CrowbarDoor", true);

    AddPropImpulse("CrowbarDoor", 0, 0, -3, "world");

    CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "AreaEffect", false);
    PlaySoundAtEntity("", "break_wood_metal", "AreaEffect", 0, false);

    GiveSanityBoostSmall();

    PlayMusic("02_puzzle.ogg", false, 0.7, 0.1, 1, false);

    AddTimer("",0.1,"TimerPushDoor");
}

void TimerPushDoor(String &in asTimer)
{
    AddPropImpulse("CrowbarDoor", 4, 2, -1, "world");
    AddTimer("", 1.1, "TimerDoorCanClose")
}

void TimerDoorCanClose(String &in asTimer)
{
    SetSwingDoorDisableAutoClose("CrowbarDoor", false);        
}

ok well this is the error that it gets me when I load the map

Code:
FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon/maps/Mansion.hps'!
main (21, 16) : ERR  : Expected data type
what does that even mean?

can you guys help me and tell me If you can see where the error is pls, I really do understand some errors but not this one, what does "expected data type" even mean? pls help


RE: What is this error and where is it? - daortir - 02-23-2014

void BreakDoor("", string &in asChild, int alState) makes no sense 'v'. You want it to be

void BreakDoor(string &in asPotato, string &in asNoodle, int alMacSwaggyBurger). Or, as it usually is:

void BreakDoor(string &in asParent, string &in asChild, int alState)


RE: What is this error and where is it? - MsHannerBananer - 02-23-2014

(02-23-2014, 05:59 PM)Badcat5550 Wrote: I did the code right and it gets me an error! just great. well here is the code that i'm using for my map

Code:
void OnStart()
{
    AddUseItemCallback("", "Crowbar", "CrowbarDoor", "UseCrowbarOnDoor", true);
    AddEntityCollideCallback("Joint", "AreaBreak", "BreakDoor", true, 1);    
}

void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
    RemoveItem(asItem);
    PlaySoundAtEntity("", "player_crouch.snt", "Player", 0.05, false);
    AddTimer(asEntity, 0.2, "TimerPlaceCrowbar");

}

void TimerPlaceCrowbar(string &in asTimer)
{
    SetEntityActive("Joint", true);
    PlaySoundAtEntity("", "puzzle_place_jar.snt", "asTimer", 0, false);
}

void BreakDoor("", string &in asChild, int alState)
{
    SetEntityActive("Joint", false);
    SetEntityActive("Broken", true);

    SetSwingDoorLocked("CrowbarDoor", false, false);
    SetSwingDoorClosed("CrowbarDoor", false, false);
    SetSwingDoorDisableAutoClose("CrowbarDoor", true);

    AddPropImpulse("CrowbarDoor", 0, 0, -3, "world");

    CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "AreaEffect", false);
    PlaySoundAtEntity("", "break_wood_metal", "AreaEffect", 0, false);

    GiveSanityBoostSmall();

    PlayMusic("02_puzzle.ogg", false, 0.7, 0.1, 1, false);

    AddTimer("",0.1,"TimerPushDoor");
}

void TimerPushDoor(String &in asTimer)
{
    AddPropImpulse("CrowbarDoor", 4, 2, -1, "world");
    AddTimer("", 1.1, "TimerDoorCanClose")
}

void TimerDoorCanClose(String &in asTimer)
{
    SetSwingDoorDisableAutoClose("CrowbarDoor", false);        
}

ok well this is the error that it gets me when I load the map

Code:
FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon/maps/Mansion.hps'!
main (21, 16) : ERR  : Expected data type
what does that even mean?

can you guys help me and tell me If you can see where the error is pls, I really do understand some errors but not this one, what does "expected data type" even mean? pls help

It seems it's because you touched some void bracket functions.

In your void Breakdoor function, you replaced (string &in asParent, string &in asChild, int alState) with ("", string &in asChild, int alState). I'm only 80% sure, but I think that's the problem.

I don't see any other problems, and when putting it in Notepad++ that is the exact area your error is calling for.

Corrected script
Spoiler below!
void OnStart()
{
AddUseItemCallback("", "Crowbar", "CrowbarDoor", "UseCrowbarOnDoor", true);
AddEntityCollideCallback("Joint", "AreaBreak", "BreakDoor", true, 1);
}

void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
RemoveItem(asItem);
PlaySoundAtEntity("", "player_crouch.snt", "Player", 0.05, false);
AddTimer(asEntity, 0.2, "TimerPlaceCrowbar");

}

void TimerPlaceCrowbar(string &in asTimer)
{
SetEntityActive("Joint", true);
PlaySoundAtEntity("", "puzzle_place_jar.snt", "asTimer", 0, false);
}

void BreakDoor(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Joint", false);
SetEntityActive("Broken", true);

SetSwingDoorLocked("CrowbarDoor", false, false);
SetSwingDoorClosed("CrowbarDoor", false, false);
SetSwingDoorDisableAutoClose("CrowbarDoor", true);

AddPropImpulse("CrowbarDoor", 0, 0, -3, "world");

CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "AreaEffect", false);
PlaySoundAtEntity("", "break_wood_metal", "AreaEffect", 0, false);

GiveSanityBoostSmall();

PlayMusic("02_puzzle.ogg", false, 0.7, 0.1, 1, false);

AddTimer("",0.1,"TimerPushDoor");
}

void TimerPushDoor(String &in asTimer)
{
AddPropImpulse("CrowbarDoor", 4, 2, -1, "world");
AddTimer("", 1.1, "TimerDoorCanClose")
}

void TimerDoorCanClose(String &in asTimer)
{
SetSwingDoorDisableAutoClose("CrowbarDoor", false);
}

Tell me if that works and if not, we'll wrangle someone else up. ;D


RE: What is this error and where is it? - Radical Batz - 02-23-2014

thanks it's working now Big Grin I should stay more focused on my script, but yeah, thanks.


RE: What is this error and where is it? [SOLVED] - FoodOnCrack - 02-23-2014

(02-23-2014, 05:59 PM)Badcat5550 Wrote: I did the code right and it gets me an error! just great. well here is the code that i'm using for my map

Code:
void OnStart()
{
    AddUseItemCallback("", "Crowbar", "CrowbarDoor", "UseCrowbarOnDoor", true);
    AddEntityCollideCallback("Joint", "AreaBreak", "BreakDoor", true, 1);    
}

void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
    RemoveItem(asItem);
    PlaySoundAtEntity("", "player_crouch.snt", "Player", 0.05, false);
    AddTimer(asEntity, 0.2, "TimerPlaceCrowbar");

}

void TimerPlaceCrowbar(string &in asTimer)
{
    SetEntityActive("Joint", true);
    PlaySoundAtEntity("", "puzzle_place_jar.snt", "asTimer", 0, false);
}

void BreakDoor("", string &in asChild, int alState)
{
    SetEntityActive("Joint", false);
    SetEntityActive("Broken", true);

    SetSwingDoorLocked("CrowbarDoor", false, false);
    SetSwingDoorClosed("CrowbarDoor", false, false);
    SetSwingDoorDisableAutoClose("CrowbarDoor", true);

    AddPropImpulse("CrowbarDoor", 0, 0, -3, "world");

    CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "AreaEffect", false);
    PlaySoundAtEntity("", "break_wood_metal", "AreaEffect", 0, false);

    GiveSanityBoostSmall();

    PlayMusic("02_puzzle.ogg", false, 0.7, 0.1, 1, false);

    AddTimer("",0.1,"TimerPushDoor");
}

void TimerPushDoor(String &in asTimer)
{
    AddPropImpulse("CrowbarDoor", 4, 2, -1, "world");
    AddTimer("", 1.1, "TimerDoorCanClose")
}

void TimerDoorCanClose(String &in asTimer)
{
    SetSwingDoorDisableAutoClose("CrowbarDoor", false);        
}

ok well this is the error that it gets me when I load the map

Code:
FATAL ERROR: Could not load script file 'custom_stories/Lifeless_The Abandon/maps/Mansion.hps'!
main (21, 16) : ERR  : Expected data type
what does that even mean?

can you guys help me and tell me If you can see where the error is pls, I really do understand some errors but not this one, what does "expected data type" even mean? pls help


In a "void" function line you want only string &in OR int alStates between the brackets. If i am correct, "double quotes" cause a crash in a void function line.
Plus, a good way to solve the error is taking a look at the FATAL ERROR message, when it says (21, 16) it gives the location of the error in your script. So if you use Notepad++ or Geany, it says the row (21) and the letter in the row (, 16) where the error is located.

Another good tip that i have is to look at http://wiki.frictionalgames.com/hpl2/amnesia/script_functions at the scripts which call a function. For example an collidecallback between you and a sript area, it will say under the line: Callback syntax: void MyFunc(string &in asName, int alCount) . The correct void function is always listed under the callback line so just copy paste that one Tongue.