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
ifstate
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#3
RE: ifstate

recently had a problem with that aswell
Spoiler below!

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

///CHANGEMAP
void StartMap(string &in asEntity)
{
if (HasItem("lantern") == true)
{
ChangeMap("01CastleBasement.map", "PlayerStartArea_1", "", "");
}
else
{
SetMessage("Messages", "FindItems", 4.0f);
}
}

When player interacts with "CastleGate" it then start the function StartMap. IF the player have the item "lantern" = true, then it changes map... ELSE it displays a message on screen telling you to find the items.

thats how it works in my case, but you can just switch the script around to suit what you had in mind.


05-08-2012, 12:03 AM
Find


Messages In This Thread
ifstate - by neocrawler - 05-07-2012, 11:20 PM
RE: ifstate - by Your Computer - 05-07-2012, 11:27 PM
RE: ifstate - by Rownbear - 05-08-2012, 12:03 AM
RE: ifstate - by neocrawler - 05-08-2012, 12:05 AM
RE: ifstate - by Cranky Old Man - 05-08-2012, 01:30 AM
RE: ifstate - by neocrawler - 05-09-2012, 01:07 AM



Users browsing this thread: 1 Guest(s)