Frictional Games Forum (read-only)
ifstate - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: ifstate (/thread-15328.html)



ifstate - neocrawler - 05-07-2012

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


RE: ifstate - Your Computer - 05-07-2012

http://msdn.microsoft.com/en-us/library/fh88ctk1%28v=vs.80%29.aspx


RE: ifstate - Rownbear - 05-08-2012

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.




RE: ifstate - neocrawler - 05-08-2012

Thanks Big Grin


RE: ifstate - Cranky Old Man - 05-08-2012

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


RE: ifstate - neocrawler - 05-09-2012

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