The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Fancy door + quest scripting.
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#1
Fancy door + quest scripting.

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! Smile

[Image: signature-2.png]
(This post was last modified: 03-18-2011, 09:08 PM by Streetboat.)
03-18-2011, 07:47 PM
Find


Messages In This Thread
Fancy door + quest scripting. - by Streetboat - 03-18-2011, 07:47 PM
RE: Fancy door + quest scripting. - by Nye - 03-18-2011, 09:09 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-18-2011, 09:45 PM
RE: Fancy door + quest scripting. - by Nye - 03-18-2011, 10:00 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-18-2011, 10:27 PM
RE: Fancy door + quest scripting. - by Nye - 03-19-2011, 12:21 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 02:43 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 08:05 AM
RE: Fancy door + quest scripting. - by Nye - 03-19-2011, 08:47 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 09:11 AM
RE: Fancy door + quest scripting. - by Nye - 03-19-2011, 10:15 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 10:33 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-20-2011, 06:38 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-20-2011, 11:41 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 12:53 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 04:10 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 08:08 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 09:57 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-22-2011, 10:16 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-23-2011, 01:59 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-23-2011, 02:26 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-24-2011, 09:59 AM



Users browsing this thread: 1 Guest(s)