Frictional Games Forum (read-only)

Full Version: If has item func
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello I have a problem trying to load a map after the player have picked up its lantern and interacts with a door. so it looks something like this
Spoiler below!


void OnStart()
{
SetEntityPlayerInteractCallback("CastleGate", "StartMap", false);
}

void StartMap(string& asMapName, string& asStartPos)
{
if (HasItem("Lantern.ent") == true)
{
ChangeMap("01CastleBasement.map", "PlayerStartArea_1", "", "");
}
else
{
SetMessage("Messages", "FindItems", 4.0f);
}
}

Been awhile since I made this so might be way off, please help Smile

HasItem takes in the name of the item, not the filename of the entity file.
(05-06-2012, 02:22 AM)Your Computer Wrote: [ -> ]HasItem takes in the name of the item, not the filename of the entity file.
Tried but still doesnt work :-\ think the mistake is in

void StartMap(string& asMapName, string& asStartPos)

not working with the has item part
Yeah, SetEntityPlayerInteractCallback callback takes only one string.
(05-06-2012, 02:35 AM)Your Computer Wrote: [ -> ]Yeah, SetEntityPlayerInteractCallback callback takes only one string.
ah okay, which one should I use in this case?

EDIT: Got it working now, thanks for help Smile