Frictional Games Forum (read-only)
Script ERROR need help N00B - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Script ERROR need help N00B (/thread-7714.html)

Pages: 1 2


Script ERROR need help N00B - X4anco - 04-30-2011

Here is my script can you see any errors because the game thinks there is:

void OnStart ()
{
AddUseItemCallback ("", "Corridor Key", "door_1", "UsedkeyOnDoor", true);
}
void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
playSoundAtEntity("", "unlock_door", "door_1", 0, false,);
RemoveItem("Corridor key");
}

I have done all the extra_english stuff :d


RE: Script ERROR need help N00B - NylePudding - 04-30-2011

If I understand correctly you have made an extremely easy mistake to correct.

playSoundAtEntity("", "unlock_door", "door_1", 0, false,);

should be: playSoundAtEntity("", "unlock_door", "door_1", 0, false);

You had a comma at the end of "false".

C++ is annoying like that, hope it helps. Big Grin


RE: Script ERROR need help N00B - Exostalker - 04-30-2011

Did you add:

Spoiler below!

void OnEnter()
{

}

and
Spoiler below!

void OnLeave()
{

}




RE: Script ERROR need help N00B - X4anco - 04-30-2011

Thnx guys Big Grin
Now its saying no matching signatures
Now its saying something about it cant find a signature Angry Angry Angry Angry


RE: Script ERROR need help N00B - Kyle - 04-30-2011

Please repeat your updated script file so I can see it.
(04-30-2011, 09:22 PM)NylePudding Wrote: If I understand correctly you have made an extremely easy mistake to correct.

playSoundAtEntity("", "unlock_door", "door_1", 0, false,);

should be: playSoundAtEntity("", "unlock_door", "door_1", 0, false);

You had a comma at the end of "false".

C++ is annoying like that, hope it helps. Big Grin

I love C++ it always works nearly perfect for me. Big Grin
Nevermind, I found the problem.

You need to watch your capitalization and punctuation.

This: playSoundAtEntity("", "unlock_door", "door_1", 0, false,);

Is supposed to be this:

PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);


RE: Script ERROR need help N00B - X4anco - 04-30-2011

Now my door doesn't unlock Huh Angry Huh Angry
it never did Sad


RE: Script ERROR need help N00B - Tottel - 04-30-2011

Yes, that's what Nylepudding already told him 1 hour before you did. Smile


RE: Script ERROR need help N00B - Simpanra - 04-30-2011

Try This;


void OnStart()
{
AddUseItemCallback ("", "Corridor_Key", "door_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("Corridor_key");
}


And also, go in your editor and rename "Corridor Key" to "Corridor_Key"

I am sure if you do exactly this it will work =)


RE: Script ERROR need help N00B - Kyle - 04-30-2011

(04-30-2011, 11:34 PM)Tottel Wrote: Yes, that's what Nylepudding already told him 1 hour before you did. Smile

If you notice, sir, Nye forgot to capitalize the first letter.


RE: Script ERROR need help N00B - Karai16 - 05-01-2011

Code:
void OnStart()
{
    AddUseItemCallback("", "RoomKey", "RoomDoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string&in asEntity)
{
    SetSwingDoorLocked("RoomDoor", false, true);
    PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
    RemoveItem("RoomKey");
}
This is my code of my test map. It has a UsedKeyOnDoor code. My code is working, so you can compare and see if there are any mistakes.

Smile