Frictional Games Forum (read-only)
01.hps FATAL ERROR Help!! [FIXED] - 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: 01.hps FATAL ERROR Help!! [FIXED] (/thread-17267.html)



01.hps FATAL ERROR Help!! [FIXED] - theveeus - 07-25-2012

Please someone help me, i cant get my map to open, i get this error "FATAL ERROR: Could not load script file 'custom_stories/Test/maps/01.hps(01 is the name of the .map file too)!' main (8,32): ERR : Expected data type"


////////////////////////////
// Run first time starting map
void OnEnter()
{
AddUseItemCallback("", "DoorKey_1", "EXAMPLE_DOOR", "UsedKeyOnDoor", true);
}
void MyFunc(string &in asItem, &in asEntity)
{
SetSwingDoorLocked("EXAMPLE_DOOR", false, true);
PlaySoundAtEntity("", "unlock_door", "EXAMPLE_DOOR", 0, false);
RemoveItem(DoorKey_1);
}

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

}

Thank you!!


RE: 01.hps FATAL ERROR Help!! - SilentStriker - 07-25-2012

MyFunc

^ there you have your problem. You are calling the function UsedKeyOnDoor but the function is named MyFunc it should be named UsedKeyOnDoor.

also is you door named EXAMPLE_DOOR? and is your key named DoorKey_1? and you need to change this to RemoveItem("DoorKey_1");

and put the AddUseItemCallback on OnStart and the MyFunc function under the OnStart like you have now but under the OnStart instead of OnEnter


RE: 01.hps FATAL ERROR Help!! - Adny - 07-25-2012

You didn't declare (which means put into quotations) "DoorKey_1", and the name of the function UsedKeyOnDoor didn't match MyFunc. I also put the callbacks under OnStart instead of OnEnter. Here's the revision:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "DoorKey_1", "EXAMPLE_DOOR", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("EXAMPLE_DOOR", false, true);
PlaySoundAtEntity("", "unlock_door", "EXAMPLE_DOOR", 0, false);
RemoveItem("DoorKey_1");
}

///on enter
void OnEnter()
{

}

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

}


RE: 01.hps FATAL ERROR Help!! - theveeus - 07-25-2012

thank you very much, im really a noob with this stuff Smile