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
#5
RE: Fancy door + quest scripting.

All right, so here's the order of things I want:

Interact with door:
If key != in inventory, display message "I need a key."
If key == in inventory, keep key and display message "My hands are too cold, I need to warm them up."

Light fire:
If key != in inventory, nothing happens.
If key == in inventory, it will now work on door.

I need to do some inventory things to make this work, it seems.

Here's my code, anyways
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
    {
    if(GetLocalVarInt("FireLit") == 1)
        {
        SetSwingDoorLocked("cellar_wood01", false, true);
        PlaySoundAtEntity("", "unlock_door", "cellar_wood01", 0, false);
        RemoveItem("shop_key");
        }
    if(GetLocalVarInt("FireLit") != 1)
        {
        SetMessage("00_woodshop", "LockedDoorNoFire", 0);
        }
    }
void getwarm(string &in EntityName, string &in Type)
    {
        if(Type == "OnIgnite")
        {
        CompleteQuest("questtext1","questtext1");
        GiveSanityBoost();
        SetLocalVarInt("firelit", 1);
        }
    }

It looks good to me, but it's missing parts, such as checking the inventory for the key when the door is used.
This is really complicated considering I just started working with this code two days ago, but if it works this is gonna be great. Big Grin
Okay, so the code I just pasted above works almost perfectly. The only problem is that once the fire is lit, the key doesn't work on the door. It says "Can't use item this way!". However, the key does give the message that your hands are too cold if you use it without the fire. HOWEVER, if you light the fire before you pick the key up, the key works.

[Image: signature-2.png]
(This post was last modified: 03-18-2011, 10:53 PM by Streetboat.)
03-18-2011, 10:27 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)