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.
Nye Offline
Senior Member

Posts: 250
Threads: 8
Joined: Jan 2011
Reputation: 2
#12
RE: Fancy door + quest scripting.

Try using the function,
HasItem(string& asName);

So, you would put
if(HasItem("lantern") == true
{
   STUFF
}
if(HasItem("lantern") == false (or put != true)
{
   STUFF
}

I have never done the above code, but it should work! Blush

Second, you don't need to put anything inside the OnLeave() and OnEnter().

Although, inside the OnLeave(), I put sounds (eg. creepy whispers) and also specify the loading screen and text I want the player to load.

Here is an example from one of my scripts:
void OnEnter()
{
}
void OnLeave()
{
    PlaySoundAtEntity("", "insanity_whisper.snt", "Player", 0.0f, true);    
    SetupLoadScreen("LoadingText", "catacombs", 0, "");                
    StopMusic(3.0f, 10);
}

Also, it's up to you what you do with the lantern check. Maybe it would be cooler if you entered the area, created a 'Block Box' entity and created a trigger in the darkness, just before the block box. Then, when the player collides with the trigger, if he has the lantern, the callback removes the block box ((SetEntityActive, "BlockBox", false)Wink. Else, it triggers a message telling the player that they should go back to get a lantern.


Finally, with regards to your sound question. ONLY use the level editor for repeated sounds (eg. waterfall streams, water drips, machine humming).

Every other sound, you should create triggers and use the PlaySoundAtEntity function to call. (Create a script area for the entity and place it where you want the sound source to be). Otherwise, the game will just play every single sound and it gets really buggy Tongue

(This post was last modified: 03-19-2011, 10:18 AM by Nye.)
03-19-2011, 10:15 AM
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)