Frictional Games Forum (read-only)

Full Version: Will this work with notes?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
(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!
(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!