Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


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

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: If has item func

Yeah, SetEntityPlayerInteractCallback callback takes only one string.

Tutorials: From Noob to Pro
05-06-2012, 02:35 AM
Website Find
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#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




Users browsing this thread: 1 Guest(s)