Frictional Games Forum (read-only)
[SCRIPT] Script 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: [SCRIPT] Script Error (/thread-24953.html)



Script Error - MaksoPL - 03-30-2014

Hi. My next script error. main (11,1) ERR: Unexpected token. That's my script:


void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages","Alexander",10);
}

{
AddUseItemCallback("","key1","door1","Door",true);
}

void Door (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false)
}


RE: Script Error - Romulator - 03-30-2014

(03-30-2014, 08:20 PM)MaksoPL Wrote: {
AddUseItemCallback("","key1","door1","Door",true);
}

This is your problem. Smile To fix it, simply move it to OnStart().

Try this!

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
AddUseItemCallback("","key1","door1","Door",true);
}

void Message1(string &in asChildstring &in asParentint alState)
{
SetMessage("Messages","Alexander",10); 
}

void Door (string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false)




RE: Script Error - MaksoPL - 03-30-2014

(03-30-2014, 09:04 PM)Romulator Wrote:
(03-30-2014, 08:20 PM)MaksoPL Wrote: {
AddUseItemCallback("","key1","door1","Door",true);
}

This is your problem. Smile To fix it, simply move it to OnStart().

Try this!

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
AddUseItemCallback("","key1","door1","Door",true);
}

void Message1(string &in asChildstring &in asParentint alState)
{
SetMessage("Messages","Alexander",10); 
}

void Door (string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false)


Main (16,1) ERR: Expected ';'


RE: Script Error - Neelke - 03-30-2014

Code:
void OnStart()
{
AddEntityCollideCallback("Player","alexander1","Message1",true,1);
AddUseItemCallback("","key1","door1","Door",true);
}

void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages","Alexander",10);
}

void Door (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1",false,true);
PlaySoundAtEntity("","unlock_door","door1",1,false);
}

A missing ; in PlaySoundAtEntity.


RE: Script Error - 7heDubz - 03-30-2014

so you can debug your own files
16,1 means

16 lines down from the top
and
1 character over from the right.