Frictional Games Forum (read-only)
Scripting error - 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: Scripting error (/thread-11989.html)

Pages: 1 2


RE: Scripting error - flamez3 - 12-22-2011

Did you use my script? I told you that the "true" (without quotations) in AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", True); was capitalized (spelling). And what is SetLightVisible(string& asLightName, bool abVisible); doing there? Same thing I told you, in RemoveItem("deurkey_1"); you don't have the quotations. Use this:


Quote:void OnStart()
{
AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "doorclose", "Collidedeur", true, 1);
}
void doorclose(string &in asParent, string &in asChild, int alState) ;
{
SetSwingDoorLocked("deur", true, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked("deur", false, true);
PlaySoundAtEntity("", "unlock_door", "deur", 0, false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}



RE: Scripting error - viccie - 12-22-2011

(12-22-2011, 02:54 PM)flamez3 Wrote: Did you use my script? I told you that the "true" (without quotations) in AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", True); was capitalized (spelling). And what is SetLightVisible(string& asLightName, bool abVisible); doing there? Same thing I told you, in RemoveItem("deurkey_1"); you don't have the quotations. Use this:


Quote:void OnStart()
{
AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "doorclose", "Collidedeur", true, 1);
}
void doorclose(string &in asParent, string &in asChild, int alState) ;
{
SetSwingDoorLocked("deur", true, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked("deur", false, true);
PlaySoundAtEntity("", "unlock_door", "deur", 0, false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
I now copy/pasted yours but yet another error
now it's again an ''unexpected token "{" '' at (7,2) and (11,2)





RE: Scripting error - flamez3 - 12-22-2011

(12-22-2011, 06:50 PM)viccie Wrote:
(12-22-2011, 02:54 PM)flamez3 Wrote: Did you use my script? I told you that the "true" (without quotations) in AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", True); was capitalized (spelling). And what is SetLightVisible(string& asLightName, bool abVisible); doing there? Same thing I told you, in RemoveItem("deurkey_1"); you don't have the quotations. Use this:


Quote:void OnStart()
{
AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "doorclose", "Collidedeur", true, 1);
}
void doorclose(string &in asParent, string &in asChild, int alState) ;
{
SetSwingDoorLocked("deur", true, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked("deur", false, true);
PlaySoundAtEntity("", "unlock_door", "deur", 0, false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
I now copy/pasted yours but yet another error
now it's again an ''unexpected token "{" '' at (7,2) and (11,2)
Didn't I already tell you that you have a ; on the end of
void UsedKeyOnDoor(string &in asItem, string &in asEntity). And same deal here
void UsedKeyOnDoor(string &in asItem, string &in asEntity). Get rid of the ;'s. Hopefully that will work.




RE: Scripting error - viccie - 12-22-2011

(12-22-2011, 07:46 PM)flamez3 Wrote:
(12-22-2011, 06:50 PM)viccie Wrote:
(12-22-2011, 02:54 PM)flamez3 Wrote: Did you use my script? I told you that the "true" (without quotations) in AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", True); was capitalized (spelling). And what is SetLightVisible(string& asLightName, bool abVisible); doing there? Same thing I told you, in RemoveItem("deurkey_1"); you don't have the quotations. Use this:


Quote:void OnStart()
{
AddUseItemCallback("", "deurkey_1", "deur", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "doorclose", "Collidedeur", true, 1);
}
void doorclose(string &in asParent, string &in asChild, int alState) ;
{
SetSwingDoorLocked("deur", true, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity) ;
{
SetSwingDoorLocked("deur", false, true);
PlaySoundAtEntity("", "unlock_door", "deur", 0, false);
RemoveItem("deurkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
I now copy/pasted yours but yet another error
now it's again an ''unexpected token "{" '' at (7,2) and (11,2)
Didn't I already tell you that you have a ; on the end of
void UsedKeyOnDoor(string &in asItem, string &in asEntity). And same deal here
void UsedKeyOnDoor(string &in asItem, string &in asEntity). Get rid of the ;'s. Hopefully that will work.

IT WORKS Big Grin
thank you so much everyone!!!