Frictional Games Forum (read-only)
[SCRIPT] Adding mementos to locked doors? - 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] Adding mementos to locked doors? (/thread-19089.html)

Pages: 1 2 3


RE: Adding mementos to locked doors? - The chaser - 11-05-2012

That means to be that there's a missing bracket, ;, or parenthesis.


RE: Adding mementos to locked doors? - Tiger - 11-05-2012

(11-05-2012, 02:33 PM)The chaser Wrote: That means to be that there's a missing bracket, ;, or parenthesis.
Ok, thanks. I will check through the script Smile


RE: Adding mementos to locked doors? - FlawlessHappiness - 11-05-2012

If you can't find it, post the script here. The whole script


RE: Adding mementos to locked doors? - Tiger - 11-05-2012

ok, here it is:

Spoiler below!


void OnStart()
{
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);
}

void ChangeMap_1 (string &in asParent, string &in asChild, int alState);
{
ChangeMap("InsideCabin.map", "PlayerStartArea_2, "player_jump6.ogg", "player_bodyfall5.ogg");
}

if(GetSwingDoorLocked("BlockedDoor") == true);
{
AddQuest("BlockedDoorQuest", "BlockedDoorQuest");
}


void OnEnter()
{
SetSkyBoxActive(true);
SetSkyBoxTexture("NightSky.dds");
}




RE: Adding mementos to locked doors? - FlawlessHappiness - 11-06-2012

Is this your full script?

Well the only thing i can find is: void ChangeMap_1 (string &in asParent, string &in asChild, int alState);
There shouldn't be a space


RE: Adding mementos to locked doors? - Adny - 11-06-2012

(11-05-2012, 05:34 PM)Tigerwaw Wrote: ok, here it is:

Spoiler below!


void OnStart()
{
AddEntityCollideCallback("Player", "ChangeLevelScript_1", "ChangeMap_1", true, 1);
}

void ChangeMap_1 (string &in asParent, string &in asChild, int alState);
{
ChangeMap("InsideCabin.map", "PlayerStartArea_2, "player_jump6.ogg", "player_bodyfall5.ogg");
}

if(GetSwingDoorLocked("BlockedDoor") == true);
{
AddQuest("BlockedDoorQuest", "BlockedDoorQuest");
}


void OnEnter()
{
SetSkyBoxActive(true);
SetSkyBoxTexture("NightSky.dds");
}

Hello!

ChangeMap("InsideCabin.map", "PlayerStartArea_2, "player_jump6.ogg", "player_bodyfall5.ogg");


After PlayerStartArea_2, you missed a quotation mark. If you're using notepad++ or geany (which you should be using for scripting) be sure to set the language to C++; this color codes everything and makes mistakes like that easier to point out.

Hope that helped!


RE: Adding mementos to locked doors? - The chaser - 11-06-2012

(11-06-2012, 11:27 AM)beecake Wrote: Is this your full script?

Well the only thing i can find is: void ChangeMap_1 (string &in asParent, string &in asChild, int alState);
There shouldn't be a space
Shouldn't it be:

void ChangeMap_1 (string &in asParent, string &in asChild, int alState)


RE: Adding mementos to locked doors? - FlawlessHappiness - 11-06-2012

(11-06-2012, 12:34 PM)The chaser Wrote:
(11-06-2012, 11:27 AM)beecake Wrote: Is this your full script?

Well the only thing i can find is: void ChangeMap_1 (string &in asParent, string &in asChild, int alState);
There shouldn't be a space
Shouldn't it be:

void ChangeMap_1 (string &in asParent, string &in asChild, int alState)
I meant there should be space between 1 and (


RE: Adding mementos to locked doors? - The chaser - 11-06-2012

(11-06-2012, 01:36 PM)beecake Wrote:
(11-06-2012, 12:34 PM)The chaser Wrote:
(11-06-2012, 11:27 AM)beecake Wrote: Is this your full script?

Well the only thing i can find is: void ChangeMap_1 (string &in asParent, string &in asChild, int alState);
There shouldn't be a space
Shouldn't it be:

void ChangeMap_1 (string &in asParent, string &in asChild, int alState)
I meant there should be space between 1 and (
It doesn't matter Wink A space doesn't do really anything to the script.


RE: Adding mementos to locked doors? - craven7 - 11-06-2012

Code:
if(GetSwingDoorLocked("BlockedDoor") == true);

{

AddQuest("BlockedDoorQuest", "BlockedDoorQuest");

}

the semicolon after the condition needs to be removed.
Also (the bigger problem I guess) your if (the code I posted 2 lines above) is not in a function/methode.

If you want to add a memento to a locked door I would do it like this:

Code:
SetEntityPlayerInteractCallback("door","interactLockedDoor",true);

void interactLockedDoor(string &in item)
{
    AddQuest("","lockedDoor");
}