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? - FlawlessHappiness - 11-06-2012

(11-06-2012, 02:16 PM)craven7 Wrote:
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");
}
string &in asItem is only used when you use an item on an entity. And that is: (string &in asItem, string &in asEntity)

(string &in asEntity) is when you interact with something


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

Should I place the
"SetEntityPlayerInteractCallback("door","interactLockedDoor",true);"
in the Onstart or by itself?


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

SetEntityPlayerInteractCallback("nameofdoor","interactLockedDoor",true);

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


Copy-paste this, adjust it and it should work.


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

(11-06-2012, 04:19 PM)The chaser Wrote: SetEntityPlayerInteractCallback("nameofdoor","interactLockedDoor",true);

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


Copy-paste this, adjust it and it should work.
It still doesn't work.
Here is my script:


void OnStart()
{
}

SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true);

void BlockedDoorQuest(string &in asEntity)
{
AddQuest("","BlockedDoorQuest");
}

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

void OnLeave()
{
CompleteQuest("", "BlockedDoorQuest");
}


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

Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.

Quote: string &in asItem is only used when you use an item on an entity.
And that is: (string &in asItem, string &in asEntity)



(string &in asEntity) is when you interact with something
It doesn't matter if you name it item, entity, cookie or whatever. But semantically you are right Big Grin


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

(11-06-2012, 05:29 PM)craven7 Wrote: Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.

Quote: string &in asItem is only used when you use an item on an entity.
And that is: (string &in asItem, string &in asEntity)



(string &in asEntity) is when you interact with something
It doesn't matter if you name it item, entity, cookie or whatever. But semantically you are right Big Grin
It does matter! If you write the syntax wrong, it won't work


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

(11-06-2012, 05:29 PM)craven7 Wrote: Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.
That's what I asked before but you guys didn't say so D:<


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

(11-06-2012, 08:31 PM)Tigerwaw Wrote:
(11-06-2012, 05:29 PM)craven7 Wrote: Because you have to put SetEntityPlayerInteractCallback("BlockedDoor","BlockedDoorQuest",true); in OnStart() or OnEnter() or some other function.
That's what I asked before but you didn't say so D:<


You can also just go into the editor and place your function under: PlayerInteractCallback in the door-properties


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

Quote: That's what I asked before but you didn't say so D:<
Sorry.
You always have to put statements into functions ( == everything with ";" at the end has to be put in a { })
Big Grin


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

I'm still not sure what to write here:

AddQuest("Here","BlockedDoorQuest");