Frictional Games Forum (read-only)
Scripting error help - 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: Scripting error help (/thread-18518.html)



Scripting error help - DashFire61 - 09-27-2012

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "templekey", "startdoor_nextmap", "UsedKeyOnDoor", true);
}


Void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("startdoor_nextmap", false, true);
PlaySoundAtEntity("", "unlock_door", "startdoor_nextmap", 0, false);
RemoveItem("templekey");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



The error: FATAL ERROR: Could not load script file 'custom_stories/MLP/maps/start.hps
main(9,1): ERR :'Void is not a data type
main(9,1): ERR :'Void is not a data type
main(10,1): ERR : Not all paths return a value


RE: Scripting error help - Mine Turtle - 09-27-2012

your second void function has a capital V. change it to lowercase


RE: Scripting error help - The chaser - 09-27-2012

I think it's this way:

////////////////////////////

// Run first time starting map

void OnStart()

{

AddUseItemCallback("", "templekey", "startdoor_nextmap", "UsedKeyOnDoor", true);

}





void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("startdoor_nextmap", false, true);

PlaySoundAtEntity("", "unlock_door.snt", "startdoor_nextmap", 0, false);

RemoveItem("templekey");

}



////////////////////////////

// Run when entering map

void OnEnter()

{



}



////////////////////////////

// Run when leaving map

void OnLeave()

{



}







The error: FATAL ERROR: Could not load script file 'custom_stories/MLP/maps/start.hps

main(9,1): ERR :'Void is not a data type

main(9,1): ERR :'Void is not a data type

main(10,1): ERR : Not all paths return a value