Frictional Games Forum (read-only)
Basic problem with script editor - 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: Basic problem with script editor (/thread-11274.html)



Basic problem with script editor - Holger - 11-09-2011

Hi. I'm new to the scripting/modding thing. I've been playing around for some time on my map, but now it wont load because of an error.
I've had this error many times and got it fixed by doing random things, but this time I can't get it away
It's unexpected end of file 59,2
And everytime a remove an entire void paragraph, it just says unexpected end of file at 48,2 maybe etc (it always references to the last } in the file.
So what am I doing wrong? Notepad++ counts both 6 {'s and }'s so I don't lack any. I skimmed through entire sript with a friend and we couldn't see what's wrong.. Somebody help please, because I'm stuck^^.

Code:
void OnStart ()
{
    AddEntityCollideCallback("Player", "ScriptAreaTest_1", "ScriptTest", true, 1);
    AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
    AddEntityCollideCallback("servant_room_1", "MonsterPoofArea", "MonsterPoofArea", true, 1);
    AddEntityCollideCallback("servant_door_2", "MonsterPoofArea", "MonsterPoofArea", true, 1);
    AddEntityCollideCallback("servant_brute_1", "MonsterPoofArea", "MonsterPoofArea", true, 1);
    AddUseItemCallback("", "Door_Key_1", "mansion_1", "OpenDoor", true);
    SetEntityPlayerInteractCallback("door_explo_1", "DoorExplode", true);
/////////
// Enemy_Patrol
AddEnemyPatrolNode("servant_hall_1", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("servant_hall_1", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("servant_room_1", "PathNodeArea_11", 1, "");    
AddEnemyPatrolNode("servant_room_1", "PathNodeArea_19", 5, "");    
}
void ScriptTest(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 0);
SetEntityActive("chest_of_drawers_nice_1", false");
}
void OpenDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("mansion_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
    RemoveItem("Door_Key_1");
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
    // SetEntityActive("servant_room_1", true);
    // SetEnemyIsHallucination("servant_room_1", true);
    SetSwingDoorClosed("mansion_1", true, false);
    
    // ShowEnemyPlayerPosition("servant_hall_1");
    
    
    
}

void MonsterPoofArea(string &in asParent, string &in asChild, int alState)
{
    SetEnemyIsHallucination("servant_room_1", true);
    SetEnemyIsHallucination("servant_brute_1", true);
    SetEnemyIsHallucination("servant_door_2", true);
    
}
    void DoorExplode(string &in asEntity)
{
    SetEntityActive("servant_door_2", true);
    SetEntityActive("servant_brute_1", true);
    SetPropHealth("door_explo_1", 0);
    PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
    PlaySoundAtEntity("", "react_scare", "Player", 0, false);
    PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
    SetSwingDoorLocked("mansion_1", true, true);

}




RE: Basic problem with script editor - Your Computer - 11-09-2011

ScriptTest -> SetEntityActive, you have a dangling quotation mark.



RE: Basic problem with script editor - Holger - 11-09-2011

What is that supposed to mean?



RE: Basic problem with script editor - Your Computer - 11-09-2011

In other words, in your ScriptTest function where you tried to call SetEntityActive, you have a quotation mark ( " ) that isn't supposed to be there.


RE: Basic problem with script editor - Holger - 11-09-2011

Ohh.............. I must be tired. Every time I read your post I read "question mark".. Thanks alot! I've been extremely blind