Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with sounds!
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#18
RE: Help with sounds!

(09-17-2010, 03:56 PM)Cgturner Wrote: Okay, I am now working on the description when the door is interacted with (locked, and once unlocked).

AddEntityCollideCallback("Player","PrisonDoor","CollidePlayerWithPrisonDoor");

    AddEntityCollideCallback("Player","castle_arched01_1","CollidePlayerWithcastle_arched01_1");

void CollidePlayerWithPrisonDoor()
{
    if(HasItem("PrisonKey") == true)
    {
        SetMessage("Use your inventory to select the key and use it on the door.", 10);
    }
    else
    {
        SetMessage("You will need a key to open the cell door.", 5);
    }

}

void CollidePlayerWithcastle_arched01_1()
{
    if(HasItem("key_1") == true)
    {
        SetMessage("Use your inventory to select the key and use it on the door.", 10);
    }
    else
    {
        SetMessage("You will need a key to open this door.", 5);
    }

}
The game crashes upon starting when I use the code above. I got this off of the script functions wiki, but I may have used it the wrong way.

EDIT:
I would also like to know how to properly name in-game items, such as keys, so that it shows up both on-screen when the player is close enough, and in the inventory.

As it says on the wiki, the code is not complete and does not work, it is simplified to be an example of the actual syntax. That is why the game will crash.
09-17-2010, 04:17 PM
Website Find


Messages In This Thread
Help with sounds! - by Cgturner - 09-16-2010, 07:42 PM
RE: Help with sounds! - by MulleDK19 - 09-16-2010, 07:54 PM
RE: Help with sounds! - by Armored Cow - 09-16-2010, 08:01 PM
RE: Help with sounds! - by Cgturner - 09-16-2010, 08:18 PM
RE: Help with sounds! - by MulleDK19 - 09-16-2010, 08:19 PM
RE: Help with sounds! - by Cgturner - 09-17-2010, 01:00 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 01:07 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 01:18 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 01:31 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 01:45 AM
RE: Help with sounds! - by Armored Cow - 09-17-2010, 02:11 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 03:21 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 03:25 AM
RE: Help with sounds! - by Cgturner - 09-17-2010, 03:51 AM
RE: Help with sounds! - by MulleDK19 - 09-17-2010, 04:06 PM
RE: Help with sounds! - by Cgturner - 09-17-2010, 03:56 PM
RE: Help with sounds! - by jens - 09-17-2010, 04:17 PM
RE: Help with sounds! - by Armored Cow - 09-17-2010, 04:04 PM
RE: Help with sounds! - by Cgturner - 09-17-2010, 04:25 PM
RE: Help with sounds! - by Cgturner - 09-18-2010, 06:58 AM
RE: Help with sounds! - by gosseyn - 09-18-2010, 07:19 AM
RE: Help with sounds! - by Cgturner - 09-18-2010, 07:51 AM



Users browsing this thread: 3 Guest(s)