Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If has item func
Author Message
Rownbear Offline
Member

Posts: 157
Joined: Apr 2011
Reputation: 2
Post: #1
If has item func

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


(This post was last modified: 05-06-2012 02:46 AM by Rownbear.)
05-06-2012 01:28 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 235
Post: #2
RE: If has item func

HasItem takes in the name of the item, not the filename of the entity file.

Tutorials: From Noob to Pro
05-06-2012 02:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Rownbear Offline
Member

Posts: 157
Joined: Apr 2011
Reputation: 2
Post: #3
RE: If has item func

(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

05-06-2012 02:29 AM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 235
Post: #4
RE: If has item func

Yeah, SetEntityPlayerInteractCallback callback takes only one string.

Tutorials: From Noob to Pro
05-06-2012 02:35 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Rownbear Offline
Member

Posts: 157
Joined: Apr 2011
Reputation: 2
Post: #5
RE: If has item func

(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

(This post was last modified: 05-06-2012 02:43 AM by Rownbear.)
05-06-2012 02:38 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)