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
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.
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.
I love C++ it always works nearly perfect for me.
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);
Yes, that's what Nylepudding already told him 1 hour before you did.
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 =)
(04-30-2011, 11:34 PM)Tottel Wrote: [ -> ]Yes, that's what Nylepudding already told him 1 hour before you did.
If you notice, sir, Nye forgot to capitalize the first letter.
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.