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
Trying to get a script to work
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#9
RE: Trying to get a script to work

Okay, here is my solution:

Add a script area that covers the wood pile in the stove so you won't be able to interact with the fire. I called it "InteractArea".

Here comes the script part:
void OnStart()
{
SetEntityPlayerInteractCallback("InteractArea", "ChimneyNotClosed", false); //makes the area interactable
SetEntityCustomFocusCrossHair("InteractArea", "Ignite"); //gives the InteractArea an ingite icon instead of a hand icon
}

void ChimneyNotClosed(string &in entity)
{
    AddDebugMessage("pull the freaking lever first!", false);
//ToDo: Stuff that you want to happen when the player "interacts" with the fire and the lever is not pulled yet
}

void StateChangeLever(string &in asEntity, int alState)
{
    if(alState == 1){
    SetLeverStuckState(asEntity, 1, true);
    SetEntityActive("InteractArea", false);
}
}

You won't need the burn part anymore, just make sure you uncheck the "lit"-box in the editor.
The player won't be able to interact with the pile as long as the lever is not pulled, since the script area blocks it. You can give the player a message (by using SetMessage("Message", "YourEntryHere", 0); <- also need to add an entry in extra_english.lang) that he has to open the hatch in the chimney first.

<CATEGORY Name ="Message">
<Entry Name="YourEntryHere">I can't light the fire as long as the hatch in the chimney is closed. Maybe there is a lever around.</Entry>
</CATEGORY>

09-19-2010, 06:42 PM
Find


Messages In This Thread
Trying to get a script to work - by Akasu - 09-19-2010, 11:02 AM
RE: Trying to get a script to work - by Akasu - 09-19-2010, 03:14 PM
RE: Trying to get a script to work - by khawaja07 - 09-19-2010, 03:35 PM
RE: Trying to get a script to work - by Akasu - 09-19-2010, 05:59 PM
RE: Trying to get a script to work - by Akasu - 09-19-2010, 06:29 PM
RE: Trying to get a script to work - by Pandemoneus - 09-19-2010, 06:42 PM
RE: Trying to get a script to work - by Akasu - 09-19-2010, 07:14 PM



Users browsing this thread: 1 Guest(s)