Hi all, I'm trying to make a little puzzle involving lighting a fireplace, a door, and a key. What I want to happen is the player needs to get through a door, but needs a key to do so. This I have all figured out in the script, works like a charm. There's an interim step in there, too. The player starts the level out freezing his buns off, and needs to get warm. I made this work as well, creating a quest as soon as the level starts and having it complete when a fireplace is lit. Now, the problem is, I want to tie the fireplace quest to being able to progress. I want to make it so the player can acquire the key, but not be able to use it on the door until he activates the fireplace. It should flash a message when he tries to use the key prematurely, saying "My hands are too frozen to do that."
I feel like this is a fairly complex if...then script, and I have no idea where to even start. On the plus side, I do have working scripts for the key working and the fireplace completing the quest, separately. Take a gander:
void OnStart()
{
AddUseItemCallback("", "shop_key", "cellar_wood01", "UsedKeyOnDoor", true);
AddQuest("questtext1","questtext1");
GiveSanityDamage(25.0f,true);
}
void getwarm(string &in EntityName, string &in Type)
{
if(Type == "OnIgnite")
{
CompleteQuest("questtext1","questtext1");
GiveSanityBoost();
}
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01", 0, false);
RemoveItem("shop_key");
}
This is paraphrased, btw. There are other scripts in there, but I only copy-pasted the ones that are pertinent to this question.
Thank you for your time!