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

(03-18-2011, 09:45 PM)Streetboat Wrote: All right, thank you, that's definitely a start. I want to do more than just copy and paste that, though, I want to understand what to do.

So, I set a variant in order to tell the game that the game can't unlock the door unless I have the key AND the fire is lit? What do I put for that integer? Also, where can I tell it to say "Your fingers are too frozen for that" when I try to use the key without the fire? Without that text, the player won't have any clue why he can't use it.

Thank you very much for your help!

Eugh, I was in a hurry to go to dinner when I posted that reply, so I didn't give it enough detail Tongue

Okay, here goes:

The integer which you set for the local variant, can take any value. For example, 0, 1, 2 , 3, 5, 10, 100.

When you set the local variant, to for example, 1, when the game calls that variable, it will see that it holds the value, "1".

We can manipulate this system. So, when the player interacts with the door, WITHOUT lighting the fire, the first thing you want to put inside the function is:
if(GetLocalVarInt("FireLit") != 1)
{
    SetMessage("CATEGORY NAME", "ENTRY NAME", TIME DISPLAYED);
}

By default, the game will run the procedure and unless you have already specified the value of your local variant, it will default to 0. In this case, it will run all the functions you have put inside the curly braces, as 0 is not 1, so it will show the message (until "FireLit" takes the value 1)

In the above case, the player will see the message stored in your extra_english.hps file, under the category and entry name you have chosen and display for the custom time you choose.

Now, second. We want to add a second 'IF' statement within our function that is called when we interact with the door.
if(GetLocalVarInt("FireLit") == 1)
{
    INSERT STUFF FOR WHEN THE THE FIRE IS LIT AND THE DOOR OPENS ETC.
}

Now, only when the FireLit local variant takes the value 1, will the game run the stuff located in-between the curly braces.

However, in order for the game to recognise when the player has lit the fire, upon running the function called when the player LIGHTS the fire, you need to add the line
SetLocalVarInt("FireLit", 1);
Reading this out loud is: "Set the local variant, "FireLit" to take the value 1."

And as an example for the if statements above, "If the local variant "FireLit" does NOT equal 1, then...INSERT STUFF in-between the curly bracket/braces."

(!= means NOT equal is not assigned to...) and (== means equal/IS assigned to...).

I hope this helped a little better, local variants are MASSIVELY useful for lots of things, especially when making larger, more complex custom stories Smile

If you get stuck, copy and paste your script and I will show you what you need to do Smile

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