Frictional Games Forum (read-only)
Will this work with notes? - 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: Will this work with notes? (/thread-17519.html)



Will this work with notes? - ElectricRed - 08-05-2012

So I have a script here where I want an area to teleport the player only if they have a note. However, is this the right way to go about this? For some reason it's not working, so I'm thinking maybe this command only works with items, and not notes.

Code:
void CollideAreaTeleportTrail(string &in asParent, string &in asChild, int alState)
{
if(HasItem("note_key") == true)
{
SetEntityActive("AreaDisplayMessage", false);
ChangeMap("04__Trail.map", "PlayerStartArea_1", "", "");
}
}

If I wanted to do this with a note, would I need to go about it a different way, or am I just doing something wrong here?

Thanks.


RE: Will this work with notes? - Your Computer - 08-05-2012

HasItem is normally for items that can be dragged out of the inventory and dropped onto the environment (which notes cannot do). You're probably better off using an interaction callback that sets a local map variable which you can check against.


RE: Will this work with notes? - ElectricRed - 08-05-2012

(08-05-2012, 10:38 PM)Your Computer Wrote: HasItem is normally for items that can be dragged out of the inventory and dropped onto the environment (which notes cannot do). You're probably better off using an interaction callback that sets a local map variable which you can check against.
Okay, thanks!


RE: Will this work with notes? - Theforgot3n1 - 08-06-2012

(08-05-2012, 10:58 PM)ElectricRed Wrote:
(08-05-2012, 10:38 PM)Your Computer Wrote: HasItem is normally for items that can be dragged out of the inventory and dropped onto the environment (which notes cannot do). You're probably better off using an interaction callback that sets a local map variable which you can check against.
Okay, thanks!
If the thread is solved, please mark it as such!