Frictional Games Forum (read-only)
[SCRIPT] cant get multi script to work - 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: [SCRIPT] cant get multi script to work (/thread-17670.html)



cant get multi script to work - BirdMan1988 - 08-11-2012

Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{
}

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

}

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

}


RE: cant get multi script to work - The Shanus - 08-11-2012

(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}



void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}



RE: cant get multi script to work - Lizard - 08-11-2012

(08-11-2012, 10:18 AM)The Shanus Wrote:
(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}//add this


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}



RE: cant get multi script to work - BirdMan1988 - 08-11-2012

(08-11-2012, 10:18 AM)The Shanus Wrote:
(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}//add this


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}
[/quote]

thanks for the help , the script loads on the map with out crashin , but how ever they key wont show in inventory . eny help would be apreshated thanks agin

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");
}

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

}

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

}


RE: cant get multi script to work - Theforgot3n1 - 08-12-2012

(08-11-2012, 04:09 PM)BirdMan1988 Wrote:
(08-11-2012, 10:18 AM)The Shanus Wrote:
(08-11-2012, 05:51 AM)BirdMan1988 Wrote: Hello there,
i have came across a problem and my script gives me this error message when i run the map , it states i have an unexpected ending .. this is a new error for me , so any help is apresheated

this is my scripts

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}//add this


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");

{ //Remove this line?
}

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

}

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

}

thanks for the help , the script loads on the map with out crashin , but how ever they key wont show in inventory . eny help would be apreshated thanks agin

void OnStart()
{
SetEntityConnectionStateChangeCallback("LibaryLever", "func_shelf");
AddUseItemCallback("", "LibDeskKey_1", "LibSwitch", "UsedKeyOnDoor", true);
}


void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("ShelfRot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LibSwitch", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "LibSwitch", 0, false);
RemoveItem("LibDeskKey_1");
}

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

}

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

}


What is it you're trying to say? I don't understand.