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
neocrawler Offline
Member

Posts: 57
Threads: 19
Joined: Sep 2011
Reputation: 1
#1
ifstate

Can anyone tell me something about ifstate coding. because it seems to me very usefull in some points. but i havent really an idea how the script works. Just a few examples would be allready great Smile
05-07-2012, 11:20 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: ifstate

http://msdn.microsoft.com/en-us/library/...80%29.aspx

Tutorials: From Noob to Pro
05-07-2012, 11:27 PM
Website Find
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
neocrawler Offline
Member

Posts: 57
Threads: 19
Joined: Sep 2011
Reputation: 1
#4
RE: ifstate

Thanks Big Grin
05-08-2012, 12:05 AM
Website Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#5
RE: ifstate

They're calling it "a type of coding" now? Huh (It's only the nuts and bolts of every program ever.)

Noob scripting tutorial: From Noob to Pro

05-08-2012, 01:30 AM
Find
neocrawler Offline
Member

Posts: 57
Threads: 19
Joined: Sep 2011
Reputation: 1
#6
RE: ifstate

Yea I would have could it just "ifstate" instead of "ifstead coding". Because its no preticiliar type of coding. It is indeed something thats in every language software. But I just didnt remember the use of it anymore. I have a while ago used it in "website building part : JavaScripting". But its such a while ago that i kinda forgot Tongue
05-09-2012, 01:07 AM
Website Find




Users browsing this thread: 1 Guest(s)