Frictional Games Forum (read-only)
Lever Problem - 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: Lever Problem (/thread-17471.html)



Lever Problem - Brothersvv09 - 08-04-2012

After i made the script the ERR messages kept coming again. It said the same thing, I fixed it but it still didnt work. Here is my script:
void UnlockDoor(String &in entity, int level_state)
{
if (level_state == 1)
{
SetEntityActive("LockedDoor2", true);
}

}
What is wrong?


RE: Lever Problem - Kazakarumariou - 08-04-2012

void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever", "UnlockDoor");
}


void UnlockDoor(string &in asEntity, int alState)
{
if (alState == 1)
{
SetEntityActive("LockedDoor2", true);
return;
}
}


RE: Lever Problem - Brothersvv09 - 08-04-2012

That didnt work :/ it said :
main ERR 4,6 can't be void
main ERR 4,44 only objects have constructors
Here is my script:
void OnStart()
{
AddUseItemCallback("", "key", "LockedDoor1", "UsedKeyOnDoor", true);
void SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor1", false, true);
RemoveItem("key");
}

void UnlockDoor(string &in asEntity, int alState);
{
if (alState == 1)
{
SetEntityActive("LockedDoor2", true);
return;
}
}


RE: Lever Problem - Kazakarumariou - 08-04-2012

void SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);


RE: Lever Problem - Brothersvv09 - 08-04-2012

I know I figured that out.. but it says 14,2 unexpected token "{"

when i take out the { in 14 and 2 it gives me a whole list of MORE problems... :/


RE: Lever Problem - Kazakarumariou - 08-04-2012

void UnlockDoor(string &in asEntity, int alState);
At the end of the function remove the ;


RE: Lever Problem - Brothersvv09 - 08-04-2012

That worked but after it say'd
No matching signatures to SetEntityConnectionStateChangeCallback("Lever", UnlockDoor);
but Lever was &in Name or something, do i have to change the name?

sorry I mean string @&.. thats what it said
SetEntityConnectionStateChangeCallback(string @&, UnlockDoor)